diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/ArmManagedNetworkFabricModelFactory.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/ArmManagedNetworkFabricModelFactory.cs index fe690bef69d1..0f775f409f7e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/ArmManagedNetworkFabricModelFactory.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/ArmManagedNetworkFabricModelFactory.cs @@ -32,11 +32,15 @@ public static partial class ArmManagedNetworkFabricModelFactory /// List of match configurations. /// List of dynamic match configurations. /// The last synced timestamp. + /// Access Control List (ACL) Type. + /// Device Role. + /// Global Access Control List (ACL) actions. + /// Details of the last operation performed on the resource. /// Configuration state of the resource. /// Provisioning state of the resource. /// Administrative state of the resource. /// A new instance for mocking. - public static NetworkFabricAccessControlListData NetworkFabricAccessControlListData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, NetworkFabricConfigurationType? configurationType = null, Uri aclsUri = null, CommunityActionType? defaultAction = null, IEnumerable matchConfigurations = null, IEnumerable dynamicMatchConfigurations = null, DateTimeOffset? lastSyncedOn = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + public static NetworkFabricAccessControlListData NetworkFabricAccessControlListData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, NetworkFabricConfigurationType? configurationType = null, Uri aclsUri = null, CommunityActionType? defaultAction = null, IEnumerable matchConfigurations = null, IEnumerable dynamicMatchConfigurations = null, DateTimeOffset? lastSyncedOn = null, AclType? aclType = null, DeviceRole? deviceRole = null, NetworkFabricBooleanValue? globalAccessControlListActionsEnableCount = null, string lastOperationDetails = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) { tags ??= new Dictionary(); matchConfigurations ??= new List(); @@ -56,37 +60,58 @@ public static NetworkFabricAccessControlListData NetworkFabricAccessControlListD matchConfigurations?.ToList(), dynamicMatchConfigurations?.ToList(), lastSyncedOn, + aclType, + deviceRole, + globalAccessControlListActionsEnableCount != null ? new GlobalAccessControlListActionProperties(globalAccessControlListActionsEnableCount, serializedAdditionalRawData: null) : null, + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, configurationState, provisioningState, administrativeState, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The error object. - /// A new instance for mocking. - public static NetworkFabricErrorResult NetworkFabricErrorResult(ResponseError error = null) + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The Internet Gateway Rule properties. + /// A new instance for mocking. + public static NetworkFabricInternetGatewayRuleData NetworkFabricInternetGatewayRuleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, InternetGatewayRuleProperties properties = null) { - return new NetworkFabricErrorResult(error, serializedAdditionalRawData: null); - } + tags ??= new Dictionary(); - /// Initializes a new instance of . - /// The error object. - /// Gets the configuration state. - /// A new instance for mocking. - public static StateUpdateCommonPostActionResult StateUpdateCommonPostActionResult(ResponseError error = null, NetworkFabricConfigurationState? configurationState = null) - { - return new StateUpdateCommonPostActionResult(error, serializedAdditionalRawData: null, configurationState); + return new NetworkFabricInternetGatewayRuleData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The error object. - /// Gets the configuration state. - /// URL for the details of the response. - /// A new instance for mocking. - public static ValidateConfigurationResult ValidateConfigurationResult(ResponseError error = null, NetworkFabricConfigurationState? configurationState = null, Uri uri = null) + /// Initializes a new instance of . + /// Switch configuration description. + /// Rules for the InternetGateways. + /// Details of the last operation performed on the resource. + /// Provisioning state of the resource. + /// List of Internet Gateway resource Id. + /// A new instance for mocking. + public static InternetGatewayRuleProperties InternetGatewayRuleProperties(string annotation = null, InternetGatewayRules ruleProperties = null, string lastOperationDetails = null, NetworkFabricProvisioningState? provisioningState = null, IEnumerable internetGatewayIds = null) { - return new ValidateConfigurationResult(error, serializedAdditionalRawData: null, configurationState, uri); + internetGatewayIds ??= new List(); + + return new InternetGatewayRuleProperties( + annotation, + ruleProperties, + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, + provisioningState, + internetGatewayIds?.ToList(), + serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -101,10 +126,12 @@ public static ValidateConfigurationResult ValidateConfigurationResult(ResponseEr /// IPv4 Address of Internet Gateway. /// Port number of Internet Gateway. /// Gateway Type of the resource. + /// Gateway Type of the resource. /// ARM Resource ID of the Network Fabric Controller. + /// Details of the last operation performed on the resource. /// Provisioning state of resource. /// A new instance for mocking. - public static NetworkFabricInternetGatewayData NetworkFabricInternetGatewayData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, ResourceIdentifier internetGatewayRuleId = null, string ipV4Address = null, int? port = null, InternetGatewayType typePropertiesType = default, ResourceIdentifier networkFabricControllerId = null, NetworkFabricProvisioningState? provisioningState = null) + public static NetworkFabricInternetGatewayData NetworkFabricInternetGatewayData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, ResourceIdentifier internetGatewayRuleId = null, string ipV4Address = null, int? port = null, InternetGatewayType? typePropertiesType = null, InternetGatewayType? internetGatewayType = null, ResourceIdentifier networkFabricControllerId = null, string lastOperationDetails = null, NetworkFabricProvisioningState? provisioningState = null) { tags ??= new Dictionary(); @@ -120,69 +147,55 @@ public static NetworkFabricInternetGatewayData NetworkFabricInternetGatewayData( ipV4Address, port, typePropertiesType, + internetGatewayType, networkFabricControllerId, + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, provisioningState, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// Rules for the InternetGateways. - /// Provisioning state of the resource. - /// List of Internet Gateway resource Id. - /// A new instance for mocking. - public static NetworkFabricInternetGatewayRuleData NetworkFabricInternetGatewayRuleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, InternetGatewayRules ruleProperties = null, NetworkFabricProvisioningState? provisioningState = null, IEnumerable internetGatewayIds = null) + /// The IP Community Properties. + /// A new instance for mocking. + public static NetworkFabricIPCommunityData NetworkFabricIPCommunityData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IPCommunityProperties properties = null) { tags ??= new Dictionary(); - internetGatewayIds ??= new List(); - return new NetworkFabricInternetGatewayRuleData( + return new NetworkFabricIPCommunityData( id, name, resourceType, systemData, tags, location, - annotation, - ruleProperties, - provisioningState, - internetGatewayIds?.ToList(), + properties, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. + /// Initializes a new instance of . /// Switch configuration description. + /// ARM Resource ID of the Network Fabric. /// List of IP Community Rules. + /// Details of the last operation performed on the resource. /// Configuration state of the resource. /// Provisioning state of the resource. /// Administrative state of the resource. - /// A new instance for mocking. - public static NetworkFabricIPCommunityData NetworkFabricIPCommunityData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, IEnumerable ipCommunityRules = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + /// A new instance for mocking. + public static IPCommunityProperties IPCommunityProperties(string annotation = null, ResourceIdentifier networkFabricId = null, IEnumerable ipCommunityRules = null, string lastOperationDetails = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) { - tags ??= new Dictionary(); ipCommunityRules ??= new List(); - return new NetworkFabricIPCommunityData( - id, - name, - resourceType, - systemData, - tags, - location, + return new IPCommunityProperties( annotation, + networkFabricId, ipCommunityRules?.ToList(), + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, configurationState, provisioningState, administrativeState, @@ -196,16 +209,11 @@ public static NetworkFabricIPCommunityData NetworkFabricIPCommunityData(Resource /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// List of IP Extended Community Rules. - /// Configuration state of the resource. - /// Provisioning state of the resource. - /// Administrative state of the resource. + /// The IpExtendedCommunity properties. /// A new instance for mocking. - public static NetworkFabricIPExtendedCommunityData NetworkFabricIPExtendedCommunityData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, IEnumerable ipExtendedCommunityRules = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + public static NetworkFabricIPExtendedCommunityData NetworkFabricIPExtendedCommunityData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IPExtendedCommunityProperties properties = null) { tags ??= new Dictionary(); - ipExtendedCommunityRules ??= new List(); return new NetworkFabricIPExtendedCommunityData( id, @@ -214,8 +222,28 @@ public static NetworkFabricIPExtendedCommunityData NetworkFabricIPExtendedCommun systemData, tags, location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// ARM Resource ID of the Network Fabric. + /// List of IP Extended Community Rules. + /// Details of the last operation performed on the resource. + /// Configuration state of the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// A new instance for mocking. + public static IPExtendedCommunityProperties IPExtendedCommunityProperties(string annotation = null, ResourceIdentifier networkFabricId = null, IEnumerable ipExtendedCommunityRules = null, string lastOperationDetails = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + { + ipExtendedCommunityRules ??= new List(); + + return new IPExtendedCommunityProperties( annotation, + networkFabricId, ipExtendedCommunityRules?.ToList(), + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, configurationState, provisioningState, administrativeState, @@ -229,16 +257,11 @@ public static NetworkFabricIPExtendedCommunityData NetworkFabricIPExtendedCommun /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// The list of IP Prefix Rules. - /// Configuration state of the resource. - /// Provisioning state of the resource. - /// Administrative state of the resource. + /// The IP Prefix properties. /// A new instance for mocking. - public static NetworkFabricIPPrefixData NetworkFabricIPPrefixData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, IEnumerable ipPrefixRules = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + public static NetworkFabricIPPrefixData NetworkFabricIPPrefixData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IPPrefixProperties properties = null) { tags ??= new Dictionary(); - ipPrefixRules ??= new List(); return new NetworkFabricIPPrefixData( id, @@ -247,8 +270,28 @@ public static NetworkFabricIPPrefixData NetworkFabricIPPrefixData(ResourceIdenti systemData, tags, location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// ARM Resource ID of the Network Fabric. + /// The list of IP Prefix Rules. + /// Details of the last operation performed on the resource. + /// Configuration state of the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// A new instance for mocking. + public static IPPrefixProperties IPPrefixProperties(string annotation = null, ResourceIdentifier networkFabricId = null, IEnumerable ipPrefixRules = null, string lastOperationDetails = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + { + ipPrefixRules ??= new List(); + + return new IPPrefixProperties( annotation, + networkFabricId, ipPrefixRules?.ToList(), + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, configurationState, provisioningState, administrativeState, @@ -262,15 +305,9 @@ public static NetworkFabricIPPrefixData NetworkFabricIPPrefixData(ResourceIdenti /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// ARM Resource ID of the Network Fabric. - /// Vlan Identifier of the Network Fabric. Example: 501. - /// Maximum transmission unit. Default value is 1500. - /// Configuration state of the resource. - /// Provisioning state of the resource. - /// Administrative state of the resource. + /// The L2IsolationDomain properties. /// A new instance for mocking. - public static NetworkFabricL2IsolationDomainData NetworkFabricL2IsolationDomainData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, ResourceIdentifier networkFabricId = null, int vlanId = default, int? mtu = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + public static NetworkFabricL2IsolationDomainData NetworkFabricL2IsolationDomainData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, L2IsolationDomainProperties properties = null) { tags ??= new Dictionary(); @@ -281,30 +318,38 @@ public static NetworkFabricL2IsolationDomainData NetworkFabricL2IsolationDomainD systemData, tags, location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// ARM Resource ID of the Network Fabric. + /// Vlan Identifier of the Network Fabric. Example: 501. + /// Maximum transmission unit. Default value is 1500. + /// Extended VLAN status, default value is Disabled. + /// ARM Resource ID of the networkToNetworkInterconnectId of the L2 ISD resource. + /// Details of the last operation performed on the resource. + /// Configuration state of the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// A new instance for mocking. + public static L2IsolationDomainProperties L2IsolationDomainProperties(string annotation = null, ResourceIdentifier networkFabricId = null, int vlanId = default, int? mtu = null, ExtendedVlan? extendedVlan = null, ResourceIdentifier networkToNetworkInterconnectId = null, string lastOperationDetails = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + { + return new L2IsolationDomainProperties( annotation, networkFabricId, vlanId, mtu, + extendedVlan, + networkToNetworkInterconnectId, + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, configurationState, provisioningState, administrativeState, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The error object. - /// Gets the configuration state. - /// List of ARM Resource IDs for which the given action applied successfully. - /// List of ARM Resource IDs for which the given action failed to apply. - /// A new instance for mocking. - public static DeviceUpdateCommonPostActionResult DeviceUpdateCommonPostActionResult(ResponseError error = null, NetworkFabricConfigurationState? configurationState = null, IEnumerable successfulDevices = null, IEnumerable failedDevices = null) - { - successfulDevices ??= new List(); - failedDevices ??= new List(); - - return new DeviceUpdateCommonPostActionResult(error, serializedAdditionalRawData: null, configurationState, successfulDevices?.ToList(), failedDevices?.ToList()); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -312,17 +357,9 @@ public static DeviceUpdateCommonPostActionResult DeviceUpdateCommonPostActionRes /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// Advertise Connected Subnets. Ex: "True" | "False". - /// Advertise Static Routes. Ex: "True" | "False". - /// Aggregate route configurations. - /// Connected Subnet RoutePolicy. - /// ARM Resource ID of the Network Fabric. - /// Configuration state of the resource. - /// Provisioning state of the resource. - /// Administrative state of the resource. + /// The L3 Isolation Domain Properties. /// A new instance for mocking. - public static NetworkFabricL3IsolationDomainData NetworkFabricL3IsolationDomainData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, RedistributeConnectedSubnet? redistributeConnectedSubnets = null, RedistributeStaticRoute? redistributeStaticRoutes = null, AggregateRouteConfiguration aggregateRouteConfiguration = null, ConnectedSubnetRoutePolicy connectedSubnetRoutePolicy = null, ResourceIdentifier networkFabricId = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + public static NetworkFabricL3IsolationDomainData NetworkFabricL3IsolationDomainData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, L3IsolationDomainProperties properties = null) { tags ??= new Dictionary(); @@ -333,294 +370,91 @@ public static NetworkFabricL3IsolationDomainData NetworkFabricL3IsolationDomainD systemData, tags, location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Advertise Connected Subnets. Ex: "True" | "False". + /// Advertise Static Routes. Ex: "True" | "False". + /// Aggregate route configurations. + /// Connected Subnet RoutePolicy. + /// ARM Resource ID of the Network Fabric. + /// Static Route - route policy. + /// Unique Route Distinguisher configuration. + /// VRF Limit configuration. + /// Details of the last operation performed on the resource. + /// Configuration state of the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// A new instance for mocking. + public static L3IsolationDomainProperties L3IsolationDomainProperties(string annotation = null, RedistributeConnectedSubnet? redistributeConnectedSubnets = null, RedistributeStaticRoute? redistributeStaticRoutes = null, AggregateRouteConfiguration aggregateRouteConfiguration = null, L3ExportRoutePolicy connectedExportRoutePolicy = null, ResourceIdentifier networkFabricId = null, L3ExportRoutePolicy exportRoutePolicy = null, IEnumerable uniqueRds = null, RoutePrefixLimitProperties routePrefixLimit = null, string lastOperationDetails = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + { + uniqueRds ??= new List(); + + return new L3IsolationDomainProperties( annotation, redistributeConnectedSubnets, redistributeStaticRoutes, aggregateRouteConfiguration, - connectedSubnetRoutePolicy, + connectedExportRoutePolicy != null ? new ConnectedSubnetRoutePolicy(connectedExportRoutePolicy, serializedAdditionalRawData: null) : null, networkFabricId, + exportRoutePolicy != null ? new StaticRoutePolicy(exportRoutePolicy, serializedAdditionalRawData: null) : null, + uniqueRds != null ? new L3UniqueRouteDistinguisherProperties(uniqueRds?.ToList(), serializedAdditionalRawData: null) : null, + routePrefixLimit, + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, configurationState, provisioningState, administrativeState, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// Switch configuration description. - /// Maximum transmission unit. Default value is 1500. - /// List of Connected IPv4 Subnets. - /// List of connected IPv6 Subnets. - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. - /// Import Route Policy either IPv4 or IPv6. - /// Export Route Policy either IPv4 or IPv6. - /// Ingress Acl. ARM resource ID of Access Control Lists. - /// Egress Acl. ARM resource ID of Access Control Lists. - /// To check whether monitoring of internal network is enabled or not. - /// Extension. Example: NoExtension | NPB. - /// Vlan identifier. Example: 1001. - /// BGP configuration properties. - /// Static Route Configuration properties. - /// Configuration state of the resource. - /// Provisioning state of the resource. - /// Administrative state of the resource. - /// A new instance for mocking. - public static NetworkFabricInternalNetworkData NetworkFabricInternalNetworkData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string annotation = null, int? mtu = null, IEnumerable connectedIPv4Subnets = null, IEnumerable connectedIPv6Subnets = null, ResourceIdentifier importRoutePolicyId = null, ResourceIdentifier exportRoutePolicyId = null, ImportRoutePolicy importRoutePolicy = null, ExportRoutePolicy exportRoutePolicy = null, ResourceIdentifier ingressAclId = null, ResourceIdentifier egressAclId = null, IsMonitoringEnabled? isMonitoringEnabled = null, StaticRouteConfigurationExtension? extension = null, int vlanId = default, InternalNetworkBgpConfiguration bgpConfiguration = null, InternalNetworkStaticRouteConfiguration staticRouteConfiguration = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + /// The tags. + /// The location. + /// The NeighborGroup Properties. + /// A new instance for mocking. + public static NetworkFabricNeighborGroupData NetworkFabricNeighborGroupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, NeighborGroupProperties properties = null) { - connectedIPv4Subnets ??= new List(); - connectedIPv6Subnets ??= new List(); + tags ??= new Dictionary(); - return new NetworkFabricInternalNetworkData( + return new NetworkFabricNeighborGroupData( id, name, resourceType, systemData, - annotation, - mtu, - connectedIPv4Subnets?.ToList(), - connectedIPv6Subnets?.ToList(), - importRoutePolicyId, - exportRoutePolicyId, - importRoutePolicy, - exportRoutePolicy, - ingressAclId, - egressAclId, - isMonitoringEnabled, - extension, - vlanId, - bgpConfiguration, - staticRouteConfiguration, - configurationState, - provisioningState, - administrativeState, + tags, + location, + properties, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Switch configuration description. - /// BFD configuration properties. - /// Originate a defaultRoute. Ex: "True" | "False". - /// Allows for routes to be received and processed even if the router detects its own ASN in the AS-Path. 0 is disable, Possible values are 1-10, default is 2. - /// Enable Or Disable state. - /// ASN of Network Fabric. Example: 65048. - /// Peer ASN. Example: 65047. - /// List of BGP IPv4 Listen Range prefixes. - /// List of BGP IPv6 Listen Ranges prefixes. - /// List with stringified IPv4 Neighbor Addresses. - /// List with stringified IPv6 Neighbor Address. - /// A new instance for mocking. - public static InternalNetworkBgpConfiguration InternalNetworkBgpConfiguration(string annotation = null, BfdConfiguration bfdConfiguration = null, NetworkFabricBooleanValue? defaultRouteOriginate = null, int? allowAS = null, AllowASOverride? allowASOverride = null, long? fabricAsn = null, long? peerAsn = null, IEnumerable ipv4ListenRangePrefixes = null, IEnumerable ipv6ListenRangePrefixes = null, IEnumerable ipv4NeighborAddress = null, IEnumerable ipv6NeighborAddress = null) + /// An array of destination IPv4 Addresses or IPv6 Addresses. + /// List of NetworkTap IDs where neighbor group is associated. + /// List of Network Tap Rule IDs where neighbor group is associated. + /// Details of the last operation performed on the resource. + /// The provisioning state of the resource. + /// A new instance for mocking. + public static NeighborGroupProperties NeighborGroupProperties(string annotation = null, NeighborGroupDestination destination = null, IEnumerable networkTapIds = null, IEnumerable networkTapRuleIds = null, string lastOperationDetails = null, NetworkFabricProvisioningState? provisioningState = null) { - ipv4ListenRangePrefixes ??= new List(); - ipv6ListenRangePrefixes ??= new List(); - ipv4NeighborAddress ??= new List(); - ipv6NeighborAddress ??= new List(); + networkTapIds ??= new List(); + networkTapRuleIds ??= new List(); - return new InternalNetworkBgpConfiguration( + return new NeighborGroupProperties( annotation, - serializedAdditionalRawData: null, - bfdConfiguration, - defaultRouteOriginate, - allowAS, - allowASOverride, - fabricAsn, - peerAsn, - ipv4ListenRangePrefixes?.ToList(), - ipv6ListenRangePrefixes?.ToList(), - ipv4NeighborAddress?.ToList(), - ipv6NeighborAddress?.ToList()); - } - - /// Initializes a new instance of . - /// Switch configuration description. - /// BFD configuration properties. - /// Originate a defaultRoute. Ex: "True" | "False". - /// Allows for routes to be received and processed even if the router detects its own ASN in the AS-Path. 0 is disable, Possible values are 1-10, default is 2. - /// Enable Or Disable state. - /// ASN of Network Fabric. Example: 65048. - /// Peer ASN. Example: 65047. - /// List of BGP IPv4 Listen Range prefixes. - /// List of BGP IPv6 Listen Ranges prefixes. - /// List with stringified IPv4 Neighbor Addresses. - /// List with stringified IPv6 Neighbor Address. - /// A new instance for mocking. - public static BgpConfiguration BgpConfiguration(string annotation = null, BfdConfiguration bfdConfiguration = null, NetworkFabricBooleanValue? defaultRouteOriginate = null, int? allowAS = null, AllowASOverride? allowASOverride = null, long? fabricAsn = null, long? peerAsn = null, IEnumerable ipv4ListenRangePrefixes = null, IEnumerable ipv6ListenRangePrefixes = null, IEnumerable ipv4NeighborAddress = null, IEnumerable ipv6NeighborAddress = null) - { - ipv4ListenRangePrefixes ??= new List(); - ipv6ListenRangePrefixes ??= new List(); - ipv4NeighborAddress ??= new List(); - ipv6NeighborAddress ??= new List(); - - return new BgpConfiguration( - annotation, - serializedAdditionalRawData: null, - bfdConfiguration, - defaultRouteOriginate, - allowAS, - allowASOverride, - fabricAsn, - peerAsn, - ipv4ListenRangePrefixes?.ToList(), - ipv6ListenRangePrefixes?.ToList(), - ipv4NeighborAddress?.ToList(), - ipv6NeighborAddress?.ToList()); - } - - /// Initializes a new instance of . - /// Administrative state of the BfdConfiguration. Example: Enabled | Disabled. - /// Interval in milliseconds. Example: 300. - /// Multiplier for the Bfd Configuration. Example: 5. - /// A new instance for mocking. - public static BfdConfiguration BfdConfiguration(BfdAdministrativeState? administrativeState = null, int? intervalInMilliSeconds = null, int? multiplier = null) - { - return new BfdConfiguration(administrativeState, intervalInMilliSeconds, multiplier, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// IP Address. - /// Configuration state of the resource. - /// A new instance for mocking. - public static NeighborAddress NeighborAddress(string address = null, NetworkFabricConfigurationState? configurationState = null) - { - return new NeighborAddress(address, configurationState, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Switch configuration description. - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. - /// Import Route Policy either IPv4 or IPv6. - /// Export Route Policy either IPv4 or IPv6. - /// Gets the networkToNetworkInterconnectId of the resource. - /// Peering option list. - /// option B properties object. - /// option A properties object. - /// Configuration state of the resource. - /// Provisioning state of the resource. - /// Administrative state of the resource. - /// A new instance for mocking. - public static NetworkFabricExternalNetworkData NetworkFabricExternalNetworkData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string annotation = null, ResourceIdentifier importRoutePolicyId = null, ResourceIdentifier exportRoutePolicyId = null, ImportRoutePolicy importRoutePolicy = null, ExportRoutePolicy exportRoutePolicy = null, ResourceIdentifier networkToNetworkInterconnectId = null, PeeringOption peeringOption = default, L3OptionBProperties optionBProperties = null, ExternalNetworkOptionAProperties optionAProperties = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) - { - return new NetworkFabricExternalNetworkData( - id, - name, - resourceType, - systemData, - annotation, - importRoutePolicyId, - exportRoutePolicyId, - importRoutePolicy, - exportRoutePolicy, - networkToNetworkInterconnectId, - peeringOption, - optionBProperties, - optionAProperties, - configurationState, - provisioningState, - administrativeState, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// IPv4 Address Prefix. - /// IPv6 Address Prefix. - /// Secondary IPv4 Address Prefix. - /// Secondary IPv6 Address Prefix. - /// MTU to use for option A peering. - /// Vlan identifier. Example : 501. - /// Fabric ASN number. Example 65001. - /// Peer ASN number.Example : 28. - /// BFD configuration properties. - /// Ingress Acl. ARM resource ID of Access Control Lists. - /// Egress Acl. ARM resource ID of Access Control Lists. - /// A new instance for mocking. - public static ExternalNetworkOptionAProperties ExternalNetworkOptionAProperties(string primaryIPv4Prefix = null, string primaryIPv6Prefix = null, string secondaryIPv4Prefix = null, string secondaryIPv6Prefix = null, int? mtu = null, int? vlanId = null, long? fabricAsn = null, long? peerAsn = null, BfdConfiguration bfdConfiguration = null, ResourceIdentifier ingressAclId = null, ResourceIdentifier egressAclId = null) - { - return new ExternalNetworkOptionAProperties( - primaryIPv4Prefix, - primaryIPv6Prefix, - secondaryIPv4Prefix, - secondaryIPv6Prefix, - serializedAdditionalRawData: null, - mtu, - vlanId, - fabricAsn, - peerAsn, - bfdConfiguration, - ingressAclId, - egressAclId); - } - - /// Initializes a new instance of . - /// IPv4 Address Prefix. - /// IPv6 Address Prefix. - /// Secondary IPv4 Address Prefix. - /// Secondary IPv6 Address Prefix. - /// MTU to use for option A peering. - /// Vlan identifier. Example : 501. - /// Fabric ASN number. Example 65001. - /// Peer ASN number.Example : 28. - /// BFD configuration properties. - /// Ingress Acl. ARM resource ID of Access Control Lists. - /// Egress Acl. ARM resource ID of Access Control Lists. - /// A new instance for mocking. - public static ExternalNetworkPatchOptionAProperties ExternalNetworkPatchOptionAProperties(string primaryIPv4Prefix = null, string primaryIPv6Prefix = null, string secondaryIPv4Prefix = null, string secondaryIPv6Prefix = null, int? mtu = null, int? vlanId = null, long? fabricAsn = null, long? peerAsn = null, BfdConfiguration bfdConfiguration = null, ResourceIdentifier ingressAclId = null, ResourceIdentifier egressAclId = null) - { - return new ExternalNetworkPatchOptionAProperties( - primaryIPv4Prefix, - primaryIPv6Prefix, - secondaryIPv4Prefix, - secondaryIPv6Prefix, - serializedAdditionalRawData: null, - mtu, - vlanId, - fabricAsn, - peerAsn, - bfdConfiguration, - ingressAclId, - egressAclId); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Switch configuration description. - /// An array of destination IPv4 Addresses or IPv6 Addresses. - /// List of NetworkTap IDs where neighbor group is associated. - /// List of Network Tap Rule IDs where neighbor group is associated. - /// The provisioning state of the resource. - /// A new instance for mocking. - public static NetworkFabricNeighborGroupData NetworkFabricNeighborGroupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, NeighborGroupDestination destination = null, IEnumerable networkTapIds = null, IEnumerable networkTapRuleIds = null, NetworkFabricProvisioningState? provisioningState = null) - { - tags ??= new Dictionary(); - networkTapIds ??= new List(); - networkTapRuleIds ??= new List(); - - return new NetworkFabricNeighborGroupData( - id, - name, - resourceType, - systemData, - tags, - location, - annotation, - destination, - networkTapIds?.ToList(), - networkTapRuleIds?.ToList(), - provisioningState, - serializedAdditionalRawData: null); + destination, + networkTapIds?.ToList(), + networkTapRuleIds?.ToList(), + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, + provisioningState, + serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -671,11 +505,13 @@ public static NetworkDeviceSkuData NetworkDeviceSkuData(ResourceIdentifier id = /// Reference to network rack resource id. /// Management IPv4 Address. /// Management IPv6 Address. + /// User configured read-write configuration applied on the network devices. + /// Details of the last operation performed on the resource. /// Configuration state of the resource. /// Provisioning state of the resource. /// Administrative state of the resource. /// A new instance for mocking. - public static NetworkDeviceData NetworkDeviceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, string hostName = null, string serialNumber = null, string version = null, string networkDeviceSku = null, NetworkDeviceRole? networkDeviceRole = null, ResourceIdentifier networkRackId = null, IPAddress managementIPv4Address = null, string managementIPv6Address = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + public static NetworkDeviceData NetworkDeviceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, string hostName = null, string serialNumber = null, string version = null, string networkDeviceSku = null, NetworkDeviceRole? networkDeviceRole = null, ResourceIdentifier networkRackId = null, IPAddress managementIPv4Address = null, string managementIPv6Address = null, string rwDeviceConfig = null, string lastOperationDetails = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) { tags ??= new Dictionary(); @@ -695,44 +531,14 @@ public static NetworkDeviceData NetworkDeviceData(ResourceIdentifier id = null, networkRackId, managementIPv4Address, managementIPv6Address, + rwDeviceConfig, + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, configurationState, provisioningState, administrativeState, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Switch configuration description. - /// Physical Identifier of the network interface. - /// The ARM resource id of the interface or compute server its connected to. - /// The Interface Type. Example: Management/Data. - /// IPv4Address of the interface. - /// IPv6Address of the interface. - /// Provisioning state of the resource. - /// Administrative state of the resource. - /// A new instance for mocking. - public static NetworkDeviceInterfaceData NetworkDeviceInterfaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string annotation = null, string physicalIdentifier = null, string connectedTo = null, NetworkDeviceInterfaceType? interfaceType = null, IPAddress ipv4Address = null, string ipv6Address = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) - { - return new NetworkDeviceInterfaceData( - id, - name, - resourceType, - systemData, - annotation, - physicalIdentifier, - connectedTo, - interfaceType, - ipv4Address, - ipv6Address, - provisioningState, - administrativeState, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -747,15 +553,15 @@ public static NetworkDeviceInterfaceData NetworkDeviceInterfaceData(ResourceIden /// WorkloadServices IP ranges. /// Managed Resource Group configuration properties. /// The NF-ID will be an input parameter used by the NF to link and get associated with the parent NFC Service. - /// A workload management network is required for all the tenant (workload) traffic. This traffic is only dedicated for Tenant workloads which are required to access internet or any other MSFT/Public endpoints. This is used for the backward compatibility. /// A workload management network is required for all the tenant (workload) traffic. This traffic is only dedicated for Tenant workloads which are required to access internet or any other MSFT/Public endpoints. /// List of tenant InternetGateway resource IDs. /// IPv4 Network Fabric Controller Address Space. /// IPv6 Network Fabric Controller Address Space. /// Network Fabric Controller SKU. + /// Details of the last operation performed on the resource. /// Provides you the latest status of the NFC service, whether it is Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on the status of NFC provisioning. /// A new instance for mocking. - public static NetworkFabricControllerData NetworkFabricControllerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, IEnumerable infrastructureExpressRouteConnections = null, IEnumerable workloadExpressRouteConnections = null, NetworkFabricControllerServices infrastructureServices = null, NetworkFabricControllerServices workloadServices = null, ManagedResourceGroupConfiguration managedResourceGroupConfiguration = null, IEnumerable networkFabricIds = null, bool? isWorkloadManagementNetwork = null, IsWorkloadManagementNetworkEnabled? isWorkloadManagementNetworkEnabled = null, IEnumerable tenantInternetGatewayIds = null, string ipv4AddressSpace = null, string ipv6AddressSpace = null, NetworkFabricControllerSKU? nfcSku = null, NetworkFabricProvisioningState? provisioningState = null) + public static NetworkFabricControllerData NetworkFabricControllerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, IEnumerable infrastructureExpressRouteConnections = null, IEnumerable workloadExpressRouteConnections = null, NetworkFabricControllerServices infrastructureServices = null, NetworkFabricControllerServices workloadServices = null, ManagedResourceGroupConfiguration managedResourceGroupConfiguration = null, IEnumerable networkFabricIds = null, IsWorkloadManagementNetworkEnabled? isWorkloadManagementNetworkEnabled = null, IEnumerable tenantInternetGatewayIds = null, string ipv4AddressSpace = null, string ipv6AddressSpace = null, NetworkFabricControllerSKU? nfcSku = null, string lastOperationDetails = null, NetworkFabricProvisioningState? provisioningState = null) { tags ??= new Dictionary(); infrastructureExpressRouteConnections ??= new List(); @@ -777,12 +583,12 @@ public static NetworkFabricControllerData NetworkFabricControllerData(ResourceId workloadServices, managedResourceGroupConfiguration, networkFabricIds?.ToList(), - isWorkloadManagementNetwork, isWorkloadManagementNetworkEnabled, tenantInternetGatewayIds?.ToList(), ipv4AddressSpace, ipv6AddressSpace, nfcSku, + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, provisioningState, serializedAdditionalRawData: null); } @@ -804,23 +610,33 @@ public static NetworkFabricControllerServices NetworkFabricControllerServices(IE /// The name. /// The resourceType. /// The systemData. - /// Type of Network Fabric SKU. + /// The Network Fabric Sku properties. + /// A new instance for mocking. + public static NetworkFabricSkuData NetworkFabricSkuData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NetworkFabricSkuProperties properties = null) + { + return new NetworkFabricSkuData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Type of Network Fabric SKU. /// Maximum number of compute racks available for this Network Fabric SKU. The value of max count racks is 4 for 4 rack SKU and 8 for 8 rack SKU. /// Maximum number of servers available for this Network Fabric SKU. /// List of supported Network Fabric SKU versions. /// URL providing detailed configuration of the fabric SKU. /// Provisioning state of the resource. - /// A new instance for mocking. - public static NetworkFabricSkuData NetworkFabricSkuData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NetworkFabricSkuType? typePropertiesType = null, int? maxComputeRacks = null, int? maximumServerCount = null, IEnumerable supportedVersions = null, string details = null, NetworkFabricProvisioningState? provisioningState = null) + /// A new instance for mocking. + public static NetworkFabricSkuProperties NetworkFabricSkuProperties(NetworkFabricSkuType? skuType = null, int? maxComputeRacks = null, int? maximumServerCount = null, IEnumerable supportedVersions = null, string details = null, NetworkFabricProvisioningState? provisioningState = null) { supportedVersions ??= new List(); - return new NetworkFabricSkuData( - id, - name, - resourceType, - systemData, - typePropertiesType, + return new NetworkFabricSkuProperties( + skuType, maxComputeRacks, maximumServerCount, supportedVersions?.ToList(), @@ -836,10 +652,13 @@ public static NetworkFabricSkuData NetworkFabricSkuData(ResourceIdentifier id = /// The systemData. /// The tags. /// The location. + /// The managed service identities assigned to this resource. /// Switch configuration description. /// Supported Network Fabric SKU.Example: Compute / Aggregate racks. Once the user chooses a particular SKU, only supported racks can be added to the Network Fabric. The SKU determines whether it is a single / multi rack Network Fabric. /// The version of Network Fabric. /// Array of router IDs. + /// Bring your own storage account configurations for Network Fabric. + /// Network Fabric Lock details. /// Azure resource ID for the NetworkFabricController the NetworkFabric belongs. /// Number of compute racks associated to Network Fabric. /// Number of servers.Possible values are from 1-16. @@ -851,17 +670,30 @@ public static NetworkFabricSkuData NetworkFabricSkuData(ResourceIdentifier id = /// List of NetworkRack resource IDs under the Network Fabric. The number of racks allowed depends on the Network Fabric SKU. /// List of L2 Isolation Domain resource IDs under the Network Fabric. /// List of L3 Isolation Domain resource IDs under the Network Fabric. + /// Hardware alert threshold percentage. Possible values are from 20 to 100. + /// Control Plane Access Control List ARM resource IDs. + /// Feature flag status information. + /// Trusted IP Prefixes ARM resource IDs. + /// Unique Route Distinguisher configuration. + /// Number of Storage arrays associated with the Network Fabric. + /// Active commit batch identifiers. + /// Details of the last operation performed on the resource. /// Configuration state of the resource. /// Provides you the latest status of the NFC service, whether it is Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on the status of NFC provisioning. /// Administrative state of the resource. /// A new instance for mocking. - public static NetworkFabricData NetworkFabricData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, string networkFabricSku = null, string fabricVersion = null, IEnumerable routerIds = null, ResourceIdentifier networkFabricControllerId = null, int? rackCount = null, int serverCountPerRack = default, string ipv4Prefix = null, string ipv6Prefix = null, long fabricAsn = default, TerminalServerConfiguration terminalServerConfiguration = null, ManagementNetworkConfigurationProperties managementNetworkConfiguration = null, IEnumerable racks = null, IEnumerable l2IsolationDomains = null, IEnumerable l3IsolationDomains = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + public static NetworkFabricData NetworkFabricData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string annotation = null, string networkFabricSku = null, string fabricVersion = null, IEnumerable routerIds = null, StorageAccountConfiguration storageAccountConfiguration = null, IEnumerable fabricLocks = null, ResourceIdentifier networkFabricControllerId = null, int? rackCount = null, int serverCountPerRack = default, string ipv4Prefix = null, string ipv6Prefix = null, long fabricAsn = default, TerminalServerConfiguration terminalServerConfiguration = null, ManagementNetworkConfigurationProperties managementNetworkConfiguration = null, IEnumerable racks = null, IEnumerable l2IsolationDomains = null, IEnumerable l3IsolationDomains = null, int? hardwareAlertThreshold = null, IEnumerable controlPlaneAcls = null, IEnumerable featureFlags = null, IEnumerable trustedIPPrefixes = null, UniqueRouteDistinguisherProperties uniqueRdConfiguration = null, int? storageArrayCount = null, IEnumerable activeCommitBatches = null, string lastOperationDetails = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) { tags ??= new Dictionary(); routerIds ??= new List(); + fabricLocks ??= new List(); racks ??= new List(); l2IsolationDomains ??= new List(); l3IsolationDomains ??= new List(); + controlPlaneAcls ??= new List(); + featureFlags ??= new List(); + trustedIPPrefixes ??= new List(); + activeCommitBatches ??= new List(); return new NetworkFabricData( id, @@ -870,10 +702,13 @@ public static NetworkFabricData NetworkFabricData(ResourceIdentifier id = null, systemData, tags, location, + identity, annotation, networkFabricSku, fabricVersion, routerIds?.ToList(), + storageAccountConfiguration, + fabricLocks?.ToList(), networkFabricControllerId, rackCount, serverCountPerRack, @@ -885,34 +720,51 @@ public static NetworkFabricData NetworkFabricData(ResourceIdentifier id = null, racks?.ToList(), l2IsolationDomains?.ToList(), l3IsolationDomains?.ToList(), + hardwareAlertThreshold, + controlPlaneAcls?.ToList(), + featureFlags?.ToList(), + trustedIPPrefixes?.ToList(), + uniqueRdConfiguration, + storageArrayCount, + activeCommitBatches?.ToList(), + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, configurationState, provisioningState, administrativeState, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// NetworkFabric Lock State. + /// NetworkFabric Lock Type. + /// A new instance for mocking. + public static FabricLockProperties FabricLockProperties(LockConfigurationState? lockState = null, NetworkFabricLockType? lockType = null) + { + return new FabricLockProperties(lockState, lockType, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Username for the terminal server connection. /// Password for the terminal server connection. /// Serial Number of Terminal server. - /// ARM Resource ID used for the NetworkDevice. /// IPv4 Address Prefix. /// IPv6 Address Prefix. /// Secondary IPv4 Address Prefix. /// Secondary IPv6 Address Prefix. + /// ARM Resource ID used for the NetworkDevice. /// A new instance for mocking. - public static TerminalServerConfiguration TerminalServerConfiguration(string username = null, string password = null, string serialNumber = null, ResourceIdentifier networkDeviceId = null, string primaryIPv4Prefix = null, string primaryIPv6Prefix = null, string secondaryIPv4Prefix = null, string secondaryIPv6Prefix = null) + public static TerminalServerConfiguration TerminalServerConfiguration(string username = null, string password = null, string serialNumber = null, string primaryIPv4Prefix = null, string primaryIPv6Prefix = null, string secondaryIPv4Prefix = null, string secondaryIPv6Prefix = null, ResourceIdentifier networkDeviceId = null) { return new TerminalServerConfiguration( username, password, serialNumber, - serializedAdditionalRawData: null, - networkDeviceId, primaryIPv4Prefix, primaryIPv6Prefix, secondaryIPv4Prefix, - secondaryIPv6Prefix); + secondaryIPv6Prefix, + networkDeviceId, + serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -922,7 +774,7 @@ public static TerminalServerConfiguration TerminalServerConfiguration(string use /// option B properties. /// option A properties. /// A new instance for mocking. - public static VpnConfigurationProperties VpnConfigurationProperties(ResourceIdentifier networkToNetworkInterconnectId = null, NetworkFabricAdministrativeState? administrativeState = null, PeeringOption peeringOption = default, OptionBProperties optionBProperties = null, VpnConfigurationOptionAProperties optionAProperties = null) + public static VpnConfigurationProperties VpnConfigurationProperties(ResourceIdentifier networkToNetworkInterconnectId = null, NetworkFabricAdministrativeState? administrativeState = null, PeeringOption peeringOption = default, VpnOptionBProperties optionBProperties = null, VpnOptionAProperties optionAProperties = null) { return new VpnConfigurationProperties( networkToNetworkInterconnectId, @@ -933,156 +785,128 @@ public static VpnConfigurationProperties VpnConfigurationProperties(ResourceIden serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . + /// Administrative state of the BfdConfiguration. Example: Enabled | Disabled. + /// Interval in milliseconds. Example: 300. + /// Multiplier for the Bfd Configuration. Example: 5. + /// A new instance for mocking. + public static BfdConfiguration BfdConfiguration(BfdAdministrativeState? administrativeState = null, int? intervalInMilliSeconds = null, int? multiplier = null) + { + return new BfdConfiguration(administrativeState, intervalInMilliSeconds, multiplier, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Feature flag name. + /// Feature flag value. + /// A new instance for mocking. + public static FeatureFlagProperties FeatureFlagProperties(string featureFlagName = null, string featureFlagValue = null) + { + return new FeatureFlagProperties(featureFlagName, featureFlagValue, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Unique Route Distinguisher configuration state. Default is Enabled. + /// List of Unique Route Distinguisher addresses. + /// NNI derived unique Route Distinguisher state. Default is Disabled. + /// A new instance for mocking. + public static UniqueRouteDistinguisherProperties UniqueRouteDistinguisherProperties(UniqueRouteDistinguisherConfigurationState? uniqueRdConfigurationState = null, IEnumerable uniqueRds = null, NNIDerivedUniqueRouteDistinguisherConfigurationState? nniDerivedUniqueRdConfigurationState = null) + { + uniqueRds ??= new List(); + + return new UniqueRouteDistinguisherProperties(uniqueRdConfigurationState, uniqueRds?.ToList(), nniDerivedUniqueRdConfigurationState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// Type of NNI used. Example: CE | NPB. - /// Configuration to use NNI for Infrastructure Management. Example: True/False. - /// Based on this option layer3 parameters are mandatory. Example: True/False. - /// Common properties for Layer2 Configuration. - /// Common properties for Layer3Configuration. - /// NPB Static Route Configuration properties. - /// Import Route Policy configuration. - /// Export Route Policy configuration. - /// Egress Acl. ARM resource ID of Access Control Lists. - /// Ingress Acl. ARM resource ID of Access Control Lists. - /// Configuration state of the resource. - /// Provisioning state of the resource. - /// Administrative state of the resource. - /// A new instance for mocking. - public static NetworkToNetworkInterconnectData NetworkToNetworkInterconnectData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NniType? nniType = null, IsManagementType? isManagementType = null, NetworkFabricBooleanValue useOptionB = default, Layer2Configuration layer2Configuration = null, NetworkToNetworkInterconnectOptionBLayer3Configuration optionBLayer3Configuration = null, NpbStaticRouteConfiguration npbStaticRouteConfiguration = null, ImportRoutePolicyInformation importRoutePolicy = null, ExportRoutePolicyInformation exportRoutePolicy = null, ResourceIdentifier egressAclId = null, ResourceIdentifier ingressAclId = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + /// The tags. + /// The location. + /// The NetworkFabric Properties. + /// A new instance for mocking. + public static NetworkMonitorData NetworkMonitorData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, NetworkMonitorProperties properties = null) { - return new NetworkToNetworkInterconnectData( + tags ??= new Dictionary(); + + return new NetworkMonitorData( id, name, resourceType, systemData, - nniType, - isManagementType, - useOptionB, - layer2Configuration, - optionBLayer3Configuration, - npbStaticRouteConfiguration, - importRoutePolicy, - exportRoutePolicy, - egressAclId, - ingressAclId, - configurationState, - provisioningState, - administrativeState, + tags, + location, + properties, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// IPv4 Address Prefix. - /// IPv6 Address Prefix. - /// Secondary IPv4 Address Prefix. - /// Secondary IPv6 Address Prefix. - /// ASN of PE devices for CE/PE connectivity.Example : 28. - /// VLAN for CE/PE Layer 3 connectivity.Example : 501. - /// ASN of CE devices for CE/PE connectivity. - /// A new instance for mocking. - public static NetworkToNetworkInterconnectOptionBLayer3Configuration NetworkToNetworkInterconnectOptionBLayer3Configuration(string primaryIPv4Prefix = null, string primaryIPv6Prefix = null, string secondaryIPv4Prefix = null, string secondaryIPv6Prefix = null, long? peerAsn = null, int? vlanId = null, long? fabricAsn = null) - { - return new NetworkToNetworkInterconnectOptionBLayer3Configuration( - primaryIPv4Prefix, - primaryIPv6Prefix, - secondaryIPv4Prefix, - secondaryIPv6Prefix, - serializedAdditionalRawData: null, - peerAsn, - vlanId, - fabricAsn); - } - - /// Initializes a new instance of . - /// IPv4 Address Prefix. - /// IPv6 Address Prefix. - /// Secondary IPv4 Address Prefix. - /// Secondary IPv6 Address Prefix. - /// ASN of PE devices for CE/PE connectivity.Example : 28. - /// VLAN for CE/PE Layer 3 connectivity.Example : 501. - /// ASN of CE devices for CE/PE connectivity. - /// A new instance for mocking. - public static OptionBLayer3Configuration OptionBLayer3Configuration(string primaryIPv4Prefix = null, string primaryIPv6Prefix = null, string secondaryIPv4Prefix = null, string secondaryIPv6Prefix = null, long? peerAsn = null, int? vlanId = null, long? fabricAsn = null) + /// Initializes a new instance of . + /// Switch configuration description. + /// BMP Configurations for the Network Fabric. + /// Details of the last operation performed on the resource. + /// Configuration state of the resource. + /// Provides you the latest status of the NetworkMonitor resource. + /// Administrative state of the resource. + /// A new instance for mocking. + public static NetworkMonitorProperties NetworkMonitorProperties(string annotation = null, BmpConfigurationProperties bmpConfiguration = null, string lastOperationDetails = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) { - return new OptionBLayer3Configuration( - primaryIPv4Prefix, - primaryIPv6Prefix, - secondaryIPv4Prefix, - secondaryIPv6Prefix, - serializedAdditionalRawData: null, - peerAsn, - vlanId, - fabricAsn); + return new NetworkMonitorProperties( + annotation, + bmpConfiguration, + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, + configurationState, + provisioningState, + administrativeState, + serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// Common properties for Layer2Configuration. - /// Common properties for Layer3Configuration. - /// NPB Static Route Configuration properties. - /// Import Route Policy information. - /// Export Route Policy information. - /// Egress Acl. ARM resource ID of Access Control Lists. - /// Ingress Acl. ARM resource ID of Access Control Lists. - /// A new instance for mocking. - public static NetworkToNetworkInterconnectPatch NetworkToNetworkInterconnectPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, Layer2Configuration layer2Configuration = null, OptionBLayer3Configuration optionBLayer3Configuration = null, NpbStaticRouteConfiguration npbStaticRouteConfiguration = null, ImportRoutePolicyInformation importRoutePolicy = null, ExportRoutePolicyInformation exportRoutePolicy = null, ResourceIdentifier egressAclId = null, ResourceIdentifier ingressAclId = null) + /// The tags. + /// The location. + /// The NetworkPacketBroker properties. + /// A new instance for mocking. + public static NetworkPacketBrokerData NetworkPacketBrokerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, NetworkPacketBrokerProperties properties = null) { - return new NetworkToNetworkInterconnectPatch( + tags ??= new Dictionary(); + + return new NetworkPacketBrokerData( id, name, resourceType, systemData, - layer2Configuration, - optionBLayer3Configuration, - npbStaticRouteConfiguration, - importRoutePolicy, - exportRoutePolicy, - egressAclId, - ingressAclId, + tags, + location, + properties, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. + /// Initializes a new instance of . /// ARM resource ID of the Network Fabric. /// List of ARM resource IDs of Network Devices [NPB]. /// List of network interfaces across NPB devices that are used to mirror source traffic. /// List of network Tap IDs configured on NPB. /// List of neighbor group IDs configured on NPB. + /// Details of the last operation performed on the resource. /// Provisioning state of the resource. - /// A new instance for mocking. - public static NetworkPacketBrokerData NetworkPacketBrokerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ResourceIdentifier networkFabricId = null, IEnumerable networkDeviceIds = null, IEnumerable sourceInterfaceIds = null, IEnumerable networkTapIds = null, IEnumerable neighborGroupIds = null, NetworkFabricProvisioningState? provisioningState = null) + /// A new instance for mocking. + public static NetworkPacketBrokerProperties NetworkPacketBrokerProperties(ResourceIdentifier networkFabricId = null, IEnumerable networkDeviceIds = null, IEnumerable sourceInterfaceIds = null, IEnumerable networkTapIds = null, IEnumerable neighborGroupIds = null, string lastOperationDetails = null, NetworkFabricProvisioningState? provisioningState = null) { - tags ??= new Dictionary(); networkDeviceIds ??= new List(); sourceInterfaceIds ??= new List(); networkTapIds ??= new List(); neighborGroupIds ??= new List(); - return new NetworkPacketBrokerData( - id, - name, - resourceType, - systemData, - tags, - location, + return new NetworkPacketBrokerProperties( networkFabricId, networkDeviceIds?.ToList(), sourceInterfaceIds?.ToList(), networkTapIds?.ToList(), neighborGroupIds?.ToList(), + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, provisioningState, serializedAdditionalRawData: null); } @@ -1094,16 +918,11 @@ public static NetworkPacketBrokerData NetworkPacketBrokerData(ResourceIdentifier /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// Network Rack SKU name. - /// ARM resource ID of the Network Fabric. - /// List of network device ARM resource IDs. - /// Provisioning state of the resource. + /// The NetworkRack properties. /// A new instance for mocking. - public static NetworkRackData NetworkRackData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, NetworkRackType? networkRackType = null, ResourceIdentifier networkFabricId = null, IEnumerable networkDevices = null, NetworkFabricProvisioningState? provisioningState = null) + public static NetworkRackData NetworkRackData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, NetworkRackProperties properties = null) { tags ??= new Dictionary(); - networkDevices ??= new List(); return new NetworkRackData( id, @@ -1112,10 +931,28 @@ public static NetworkRackData NetworkRackData(ResourceIdentifier id = null, stri systemData, tags, location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Network Rack SKU name. + /// ARM resource ID of the Network Fabric. + /// List of network device ARM resource IDs. + /// Details of the last operation performed on the resource. + /// Provisioning state of the resource. + /// A new instance for mocking. + public static NetworkRackProperties NetworkRackProperties(string annotation = null, NetworkRackType? networkRackType = null, ResourceIdentifier networkFabricId = null, IEnumerable networkDevices = null, string lastOperationDetails = null, NetworkFabricProvisioningState? provisioningState = null) + { + networkDevices ??= new List(); + + return new NetworkRackProperties( annotation, networkRackType, networkFabricId, networkDevices?.ToList(), + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, provisioningState, serializedAdditionalRawData: null); } @@ -1127,6 +964,24 @@ public static NetworkRackData NetworkRackData(ResourceIdentifier id = null, stri /// The systemData. /// The tags. /// The location. + /// The NetworkTapRule Properties. + /// A new instance for mocking. + public static NetworkTapRuleData NetworkTapRuleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, NetworkTapRuleProperties properties = null) + { + tags ??= new Dictionary(); + + return new NetworkTapRuleData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . /// Switch configuration description. /// Input method to configure Network Tap Rule. /// Network Tap Rules file URL. @@ -1135,23 +990,18 @@ public static NetworkRackData NetworkRackData(ResourceIdentifier id = null, stri /// The ARM resource Id of the NetworkTap. /// Polling interval in seconds. /// The last sync timestamp. + /// Global network tap rule actions. + /// Details of the last operation performed on the resource. /// Configuration state of the resource. /// Provisioning state of the resource. /// Administrative state of the resource. - /// A new instance for mocking. - public static NetworkTapRuleData NetworkTapRuleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, NetworkFabricConfigurationType? configurationType = null, Uri tapRulesUri = null, IEnumerable matchConfigurations = null, IEnumerable dynamicMatchConfigurations = null, ResourceIdentifier networkTapId = null, PollingIntervalInSecond? pollingIntervalInSeconds = null, DateTimeOffset? lastSyncedOn = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + /// A new instance for mocking. + public static NetworkTapRuleProperties NetworkTapRuleProperties(string annotation = null, NetworkFabricConfigurationType configurationType = default, Uri tapRulesUri = null, IEnumerable matchConfigurations = null, IEnumerable dynamicMatchConfigurations = null, string networkTapId = null, PollingIntervalInSecond? pollingIntervalInSeconds = null, DateTimeOffset? lastSyncedOn = null, GlobalNetworkTapRuleActionProperties globalNetworkTapRuleActions = null, string lastOperationDetails = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) { - tags ??= new Dictionary(); matchConfigurations ??= new List(); dynamicMatchConfigurations ??= new List(); - return new NetworkTapRuleData( - id, - name, - resourceType, - systemData, - tags, - location, + return new NetworkTapRuleProperties( annotation, configurationType, tapRulesUri, @@ -1160,6 +1010,8 @@ public static NetworkTapRuleData NetworkTapRuleData(ResourceIdentifier id = null networkTapId, pollingIntervalInSeconds, lastSyncedOn, + globalNetworkTapRuleActions, + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, configurationState, provisioningState, administrativeState, @@ -1173,19 +1025,11 @@ public static NetworkTapRuleData NetworkTapRuleData(ResourceIdentifier id = null /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// ARM resource ID of the Network Packet Broker. - /// Source Tap Rule Id. ARM Resource ID of the Network Tap Rule. - /// List of destinations to send the filter traffic. - /// Polling type. - /// Gets the configurations state of the resource. - /// Provides you the latest status of the NFC service, whether it is Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on the status of Network Tap provisioning. - /// Administrative state of the resource. Example -Enabled/Disabled. + /// The NetworkTap Properties. /// A new instance for mocking. - public static NetworkTapData NetworkTapData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, ResourceIdentifier networkPacketBrokerId = null, ResourceIdentifier sourceTapRuleId = null, IEnumerable destinations = null, NetworkTapPollingType? pollingType = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + public static NetworkTapData NetworkTapData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, NetworkTapProperties properties = null) { tags ??= new Dictionary(); - destinations ??= new List(); return new NetworkTapData( id, @@ -1194,11 +1038,32 @@ public static NetworkTapData NetworkTapData(ResourceIdentifier id = null, string systemData, tags, location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// ARM resource ID of the Network Packet Broker. + /// Source Tap Rule Id. ARM Resource ID of the Network Tap Rule. + /// List of destinations to send the filter traffic. + /// Polling type. + /// Details of the last operation performed on the resource. + /// Gets the configurations state of the resource. + /// Provides you the latest status of the NFC service, whether it is Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on the status of Network Tap provisioning. + /// Administrative state of the resource. Example -Enabled/Disabled. + /// A new instance for mocking. + public static NetworkTapProperties NetworkTapProperties(string annotation = null, ResourceIdentifier networkPacketBrokerId = null, ResourceIdentifier sourceTapRuleId = null, IEnumerable destinations = null, NetworkTapPollingType? pollingType = null, string lastOperationDetails = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + { + destinations ??= new List(); + + return new NetworkTapProperties( annotation, networkPacketBrokerId, sourceTapRuleId, destinations?.ToList(), pollingType, + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, configurationState, provisioningState, administrativeState, @@ -1212,19 +1077,11 @@ public static NetworkTapData NetworkTapData(ResourceIdentifier id = null, string /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. - /// Route Policy statements. - /// Arm Resource ID of Network Fabric. - /// AddressFamilyType. This parameter decides whether the given ipv4 or ipv6 route policy. - /// Configuration state of the resource. - /// Provisioning state of the resource. - /// Administrative state of the resource. + /// The RoutePolicy properties. /// A new instance for mocking. - public static NetworkFabricRoutePolicyData NetworkFabricRoutePolicyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string annotation = null, CommunityActionType? defaultAction = null, IEnumerable statements = null, ResourceIdentifier networkFabricId = null, AddressFamilyType? addressFamilyType = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + public static NetworkFabricRoutePolicyData NetworkFabricRoutePolicyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, RoutePolicyProperties properties = null) { tags ??= new Dictionary(); - statements ??= new List(); return new NetworkFabricRoutePolicyData( id, @@ -1233,63 +1090,927 @@ public static NetworkFabricRoutePolicyData NetworkFabricRoutePolicyData(Resource systemData, tags, location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + /// Route Policy statements. + /// Arm Resource ID of Network Fabric. + /// AddressFamilyType. This parameter decides whether the given ipv4 or ipv6 route policy. + /// Details of the last operation performed on the resource. + /// Configuration state of the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// A new instance for mocking. + public static RoutePolicyProperties RoutePolicyProperties(string annotation = null, CommunityActionType? defaultAction = null, IEnumerable statements = null, ResourceIdentifier networkFabricId = null, AddressFamilyType? addressFamilyType = null, string lastOperationDetails = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + { + statements ??= new List(); + + return new RoutePolicyProperties( annotation, defaultAction, statements?.ToList(), networkFabricId, addressFamilyType, + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, configurationState, provisioningState, administrativeState, serializedAdditionalRawData: null); } - /// - /// This constructor is added for the backward compatibility. - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static NetworkFabricAccessControlListData NetworkFabricAccessControlListData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, NetworkFabricConfigurationType? configurationType, Uri aclsUri, IEnumerable matchConfigurations, IEnumerable dynamicMatchConfigurations, DateTimeOffset? lastSyncedOn, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState) + /// Initializes a new instance of . + /// The error object. + /// Gets the configuration state. + /// A new instance for mocking. + public static StateUpdateCommonPostActionResult StateUpdateCommonPostActionResult(ResponseError error = null, NetworkFabricConfigurationState? configurationState = null) { - return NetworkFabricAccessControlListData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, annotation: annotation, configurationType: configurationType, aclsUri: aclsUri, defaultAction: default, matchConfigurations: matchConfigurations, dynamicMatchConfigurations: dynamicMatchConfigurations, lastSyncedOn: lastSyncedOn, configurationState: configurationState, provisioningState: provisioningState, administrativeState: administrativeState); + return new StateUpdateCommonPostActionResult(error, configurationState, serializedAdditionalRawData: null); } - /// - /// This constructor is added for the backward compatibility - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static NetworkFabricRoutePolicyData NetworkFabricRoutePolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, IEnumerable statements, ResourceIdentifier networkFabricId, AddressFamilyType? addressFamilyType, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState) + /// Initializes a new instance of . + /// The error object. + /// Gets the configuration state. + /// URL for the details of the response. + /// A new instance for mocking. + public static ValidateConfigurationResult ValidateConfigurationResult(ResponseError error = null, NetworkFabricConfigurationState? configurationState = null, Uri uri = null) + { + return new ValidateConfigurationResult(error, configurationState, uri, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The error object. + /// Gets the configuration state. + /// List of ARM Resource IDs for which the given action applied successfully. + /// List of ARM Resource IDs for which the given action failed to apply. + /// A new instance for mocking. + public static DeviceUpdateCommonPostActionResult DeviceUpdateCommonPostActionResult(ResponseError error = null, NetworkFabricConfigurationState? configurationState = null, IEnumerable successfulDevices = null, IEnumerable failedDevices = null) + { + successfulDevices ??= new List(); + failedDevices ??= new List(); + + return new DeviceUpdateCommonPostActionResult(error, configurationState, successfulDevices?.ToList(), failedDevices?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Switch configuration description. + /// ARM Resource ID of the networkToNetworkInterconnectId of the ExternalNetwork resource. + /// Import Route Policy either IPv4 or IPv6. + /// Export Route Policy either IPv4 or IPv6. + /// Peering option list. + /// option B properties object. + /// option A properties object. + /// Static Route Configuration. + /// Details of the last operation performed on the resource. + /// Configuration state of the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// A new instance for mocking. + public static NetworkFabricExternalNetworkData NetworkFabricExternalNetworkData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string annotation = null, ResourceIdentifier networkToNetworkInterconnectId = null, ImportRoutePolicy importRoutePolicy = null, ExportRoutePolicy exportRoutePolicy = null, PeeringOption peeringOption = default, L3OptionBProperties optionBProperties = null, ExternalNetworkOptionAProperties optionAProperties = null, ExternalNetworkStaticRouteConfiguration staticRouteConfiguration = null, string lastOperationDetails = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + { + return new NetworkFabricExternalNetworkData( + id, + name, + resourceType, + systemData, + annotation, + networkToNetworkInterconnectId, + importRoutePolicy, + exportRoutePolicy, + peeringOption, + optionBProperties, + optionAProperties, + staticRouteConfiguration, + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, + configurationState, + provisioningState, + administrativeState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// IPv4 Address Prefix. + /// IPv6 Address Prefix. + /// Secondary IPv4 Address Prefix. + /// Secondary IPv6 Address Prefix. + /// MTU to use for option A peering. + /// Vlan identifier. Example : 501. + /// Fabric ASN number. Example 65001. + /// Peer ASN number.Example : 28. + /// BFD configuration properties. + /// Ingress Acl. ARM resource ID of Access Control Lists. + /// BMP Monitor Configuration. + /// Egress Acl. ARM resource ID of Access Control Lists. + /// V4OverV6 BGP Session state. + /// V6OverV4 BGP Session state. + /// Native IPv4 prefix limits configuration. + /// Native IPv6 prefix limits configuration. + /// A new instance for mocking. + public static ExternalNetworkOptionAProperties ExternalNetworkOptionAProperties(string primaryIPv4Prefix = null, string primaryIPv6Prefix = null, string secondaryIPv4Prefix = null, string secondaryIPv6Prefix = null, int? mtu = null, int? vlanId = null, long? fabricAsn = null, long? peerAsn = null, BfdConfiguration bfdConfiguration = null, ResourceIdentifier ingressAclId = null, BmpConfigurationState? bmpConfigurationState = null, ResourceIdentifier egressAclId = null, V4OverV6BgpSessionState? v4OverV6BgpSession = null, V6OverV4BgpSessionState? v6OverV4BgpSession = null, IEnumerable nativeIPv4PrefixLimits = null, IEnumerable nativeIPv6PrefixLimits = null) + { + nativeIPv4PrefixLimits ??= new List(); + nativeIPv6PrefixLimits ??= new List(); + + return new ExternalNetworkOptionAProperties( + primaryIPv4Prefix, + primaryIPv6Prefix, + secondaryIPv4Prefix, + secondaryIPv6Prefix, + mtu, + vlanId, + fabricAsn, + peerAsn, + bfdConfiguration, + ingressAclId, + bmpConfigurationState != null ? new ExternalNetworkBmpProperties(bmpConfigurationState, serializedAdditionalRawData: null) : null, + egressAclId, + v4OverV6BgpSession, + v6OverV4BgpSession, + nativeIPv4PrefixLimits != null ? new NativeIPv4PrefixLimitProperties(nativeIPv4PrefixLimits?.ToList(), serializedAdditionalRawData: null) : null, + nativeIPv6PrefixLimits != null ? new NativeIPv6PrefixLimitProperties(nativeIPv6PrefixLimits?.ToList(), serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// IPv4 Address Prefix. + /// IPv6 Address Prefix. + /// Secondary IPv4 Address Prefix. + /// Secondary IPv6 Address Prefix. + /// MTU to use for option A peering. + /// Vlan identifier. Example : 501. + /// Fabric ASN number. Example 65001. + /// Peer ASN number.Example : 28. + /// BFD configuration properties. + /// Ingress Acl. ARM resource ID of Access Control Lists. + /// Egress Acl. ARM resource ID of Access Control Lists. + /// BMP Monitor Configuration. + /// V4OverV6 BGP Session state. + /// V6OverV4 BGP Session state. + /// Native IPv4 prefix limit configuration. + /// Native IPv6 prefix limit configuration. + /// A new instance for mocking. + public static ExternalNetworkPatchOptionAProperties ExternalNetworkPatchOptionAProperties(string primaryIPv4Prefix = null, string primaryIPv6Prefix = null, string secondaryIPv4Prefix = null, string secondaryIPv6Prefix = null, int? mtu = null, int? vlanId = null, long? fabricAsn = null, long? peerAsn = null, BfdPatchConfiguration bfdConfiguration = null, ResourceIdentifier ingressAclId = null, ResourceIdentifier egressAclId = null, BmpConfigurationState? bmpConfigurationState = null, V4OverV6BgpSessionState? v4OverV6BgpSession = null, V6OverV4BgpSessionState? v6OverV4BgpSession = null, IEnumerable nativeIPv4PrefixLimits = null, IEnumerable nativeIPv6PrefixLimits = null) + { + nativeIPv4PrefixLimits ??= new List(); + nativeIPv6PrefixLimits ??= new List(); + + return new ExternalNetworkPatchOptionAProperties( + primaryIPv4Prefix, + primaryIPv6Prefix, + secondaryIPv4Prefix, + secondaryIPv6Prefix, + mtu, + vlanId, + fabricAsn, + peerAsn, + bfdConfiguration, + ingressAclId, + egressAclId, + bmpConfigurationState != null ? new ExternalNetworkBmpPatchProperties(bmpConfigurationState, serializedAdditionalRawData: null) : null, + v4OverV6BgpSession, + v6OverV4BgpSession, + nativeIPv4PrefixLimits != null ? new NativeIPv4PrefixLimitPatchProperties(nativeIPv4PrefixLimits?.ToList(), serializedAdditionalRawData: null) : null, + nativeIPv6PrefixLimits != null ? new NativeIPv6PrefixLimitPatchProperties(nativeIPv6PrefixLimits?.ToList(), serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Administrative state of the BfdConfiguration. Example: Enabled | Disabled. + /// Interval in milliseconds. Example: 300. + /// Multiplier for the Bfd Configuration. Example: 5. + /// A new instance for mocking. + public static BfdPatchConfiguration BfdPatchConfiguration(BfdAdministrativeState? administrativeState = null, int? intervalInMilliSeconds = null, int? multiplier = null) + { + return new BfdPatchConfiguration(administrativeState, intervalInMilliSeconds, multiplier, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Route Type that helps to know which bfd we are updating. + /// Administrative state. + /// The error object. + /// A new instance for mocking. + public static ExternalNetworkBfdAdministrativeStateResult ExternalNetworkBfdAdministrativeStateResult(ExternalNetworkRouteType? routeType = null, BfdAdministrativeState? administrativeState = null, ResponseError error = null) + { + return new ExternalNetworkBfdAdministrativeStateResult(routeType, administrativeState, error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Switch configuration description. + /// Maximum transmission unit. Default value is 1500. + /// List of Connected IPv4 Subnets. + /// List of connected IPv6 Subnets. + /// Import Route Policy either IPv4 or IPv6. + /// Export Route Policy either IPv4 or IPv6. + /// Ingress Acl. ARM resource ID of Access Control Lists. + /// Egress Acl. ARM resource ID of Access Control Lists. + /// To check whether monitoring of internal network is enabled or not. + /// Extension. Example: NoExtension | NPB. + /// Vlan identifier. Example: 1001. + /// BGP configuration properties. + /// Static Route Configuration properties. + /// Native IPv4 Prefix Limit Configuration properties. + /// Native IPv6 Prefix Limit Configuration properties. + /// Details of the last operation performed on the resource. + /// Configuration state of the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// A new instance for mocking. + public static NetworkFabricInternalNetworkData NetworkFabricInternalNetworkData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string annotation = null, int? mtu = null, IEnumerable connectedIPv4Subnets = null, IEnumerable connectedIPv6Subnets = null, ImportRoutePolicy importRoutePolicy = null, ExportRoutePolicy exportRoutePolicy = null, ResourceIdentifier ingressAclId = null, ResourceIdentifier egressAclId = null, IsMonitoringEnabled? isMonitoringEnabled = null, StaticRouteConfigurationExtension? extension = null, int vlanId = default, BgpConfiguration bgpConfiguration = null, StaticRouteConfiguration staticRouteConfiguration = null, IEnumerable nativeIPv4PrefixLimits = null, IEnumerable nativeIPv6PrefixLimits = null, string lastOperationDetails = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + { + connectedIPv4Subnets ??= new List(); + connectedIPv6Subnets ??= new List(); + nativeIPv4PrefixLimits ??= new List(); + nativeIPv6PrefixLimits ??= new List(); + + return new NetworkFabricInternalNetworkData( + id, + name, + resourceType, + systemData, + annotation, + mtu, + connectedIPv4Subnets?.ToList(), + connectedIPv6Subnets?.ToList(), + importRoutePolicy, + exportRoutePolicy, + ingressAclId, + egressAclId, + isMonitoringEnabled, + extension, + vlanId, + bgpConfiguration, + staticRouteConfiguration, + nativeIPv4PrefixLimits != null ? new NativeIPv4PrefixLimitProperties(nativeIPv4PrefixLimits?.ToList(), serializedAdditionalRawData: null) : null, + nativeIPv6PrefixLimits != null ? new NativeIPv6PrefixLimitProperties(nativeIPv6PrefixLimits?.ToList(), serializedAdditionalRawData: null) : null, + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, + configurationState, + provisioningState, + administrativeState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// BFD configuration properties. + /// Originate a defaultRoute. Ex: "True" | "False". + /// Allows for routes to be received and processed even if the router detects its own ASN in the AS-Path. 0 is disable, Possible values are 1-10, default is 2. + /// Enable Or Disable state. + /// ASN of Network Fabric. Example: 65048. + /// Peer ASN. Example: 65047. + /// List of BGP IPv4 Listen Range prefixes. + /// List of BGP IPv6 Listen Ranges prefixes. + /// List with stringified IPv4 Neighbor Addresses. + /// List with stringified IPv6 Neighbor Address. + /// InternalNetwork BMP Configuration. + /// V4 over V6 bgp session. + /// v6 over v4 bgp session. + /// A new instance for mocking. + public static BgpConfiguration BgpConfiguration(string annotation = null, BfdConfiguration bfdConfiguration = null, NetworkFabricBooleanValue? defaultRouteOriginate = null, int? allowAS = null, AllowASOverride? allowASOverride = null, long? fabricAsn = null, long? peerAsn = null, IEnumerable ipv4ListenRangePrefixes = null, IEnumerable ipv6ListenRangePrefixes = null, IEnumerable ipv4NeighborAddress = null, IEnumerable ipv6NeighborAddress = null, InternalNetworkBmpProperties bmpConfiguration = null, V4OverV6BgpSessionState? v4OverV6BgpSession = null, V6OverV4BgpSessionState? v6OverV4BgpSession = null) + { + ipv4ListenRangePrefixes ??= new List(); + ipv6ListenRangePrefixes ??= new List(); + ipv4NeighborAddress ??= new List(); + ipv6NeighborAddress ??= new List(); + + return new BgpConfiguration( + annotation, + bfdConfiguration, + defaultRouteOriginate, + allowAS, + allowASOverride, + fabricAsn, + peerAsn, + ipv4ListenRangePrefixes?.ToList(), + ipv6ListenRangePrefixes?.ToList(), + ipv4NeighborAddress?.ToList(), + ipv6NeighborAddress?.ToList(), + bmpConfiguration, + v4OverV6BgpSession, + v6OverV4BgpSession, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// IP Address. + /// BFD Administrative State for each Neighbor Address. Example: Enabled | Disabled. + /// BGP Administrative State for each Neighbor Address. Example: Enabled | Disabled. + /// Configuration state of the resource. + /// A new instance for mocking. + public static NeighborAddress NeighborAddress(string address = null, BfdAdministrativeState? bfdAdministrativeState = null, BgpAdministrativeState? bgpAdministrativeState = null, NetworkFabricConfigurationState? configurationState = null) + { + return new NeighborAddress(address, bfdAdministrativeState, bgpAdministrativeState, configurationState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Prefix of the Connected Subnet. + /// A new instance for mocking. + public static ConnectedSubnetPatch ConnectedSubnetPatch(string annotation = null, string prefix = null) + { + return new ConnectedSubnetPatch(annotation, prefix, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// BFD configuration properties. + /// Originate a defaultRoute. Ex: "True" | "False". + /// Allows for routes to be received and processed even if the router detects its own ASN in the AS-Path. 0 is disable, Possible values are 1-10, default is 2. + /// Enable Or Disable state. + /// ASN of Network Fabric. Example: 65048. + /// Peer ASN. Example: 65047. + /// List of BGP IPv4 Listen Range prefixes. + /// List of BGP IPv6 Listen Ranges prefixes. + /// List with stringified IPv4 Neighbor Addresses. + /// List with stringified IPv6 Neighbor Address. + /// InternalNetwork BMP Configuration. + /// V4 over V6 bgp session. + /// v6 over v4 bgp session. + /// A new instance for mocking. + public static BgpPatchConfiguration BgpPatchConfiguration(string annotation = null, BfdPatchConfiguration bfdConfiguration = null, NetworkFabricBooleanValue? defaultRouteOriginate = null, int? allowAS = null, AllowASOverride? allowASOverride = null, long? fabricAsn = null, long? peerAsn = null, IEnumerable ipv4ListenRangePrefixes = null, IEnumerable ipv6ListenRangePrefixes = null, IEnumerable ipv4NeighborAddress = null, IEnumerable ipv6NeighborAddress = null, InternalNetworkBmpPatchProperties bmpConfiguration = null, V4OverV6BgpSessionState? v4OverV6BgpSession = null, V6OverV4BgpSessionState? v6OverV4BgpSession = null) + { + ipv4ListenRangePrefixes ??= new List(); + ipv6ListenRangePrefixes ??= new List(); + ipv4NeighborAddress ??= new List(); + ipv6NeighborAddress ??= new List(); + + return new BgpPatchConfiguration( + annotation, + bfdConfiguration, + defaultRouteOriginate, + allowAS, + allowASOverride, + fabricAsn, + peerAsn, + ipv4ListenRangePrefixes?.ToList(), + ipv6ListenRangePrefixes?.ToList(), + ipv4NeighborAddress?.ToList(), + ipv6NeighborAddress?.ToList(), + bmpConfiguration, + v4OverV6BgpSession, + v6OverV4BgpSession, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// IP Address. + /// BFD Administrative State for each Neighbor Address. Example: Enabled | Disabled. + /// BGP Administrative State for each Neighbor Address. Example: Enabled | Disabled. + /// Configuration state of the resource. + /// A new instance for mocking. + public static NeighborAddressPatch NeighborAddressPatch(string address = null, BfdAdministrativeState? bfdAdministrativeState = null, BgpAdministrativeState? bgpAdministrativeState = null, NetworkFabricConfigurationState? configurationState = null) + { + return new NeighborAddressPatch(address, bfdAdministrativeState, bgpAdministrativeState, configurationState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// NeighborAddress administrative status. + /// The error object. + /// A new instance for mocking. + public static InternalNetworkBfdAdministrativeStateResult InternalNetworkBfdAdministrativeStateResult(IEnumerable neighborAddressAdministrativeStatus = null, ResponseError error = null) + { + neighborAddressAdministrativeStatus ??= new List(); + + return new InternalNetworkBfdAdministrativeStateResult(neighborAddressAdministrativeStatus?.ToList(), error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// NeighborAddress - Input should be either All or Specific Ipv4 Address or Specific Ipv6 Address. + /// BFD Administrative state. + /// Error message. + /// A new instance for mocking. + public static NeighborAddressBfdAdministrativeStatus NeighborAddressBfdAdministrativeStatus(string neighborAddress = null, BfdAdministrativeState? administrativeState = null, string error = null) + { + return new NeighborAddressBfdAdministrativeStatus(neighborAddress, administrativeState, error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// NeighborAddress administrative status. + /// The error object. + /// A new instance for mocking. + public static InternalNetworkBgpAdministrativeStateResult InternalNetworkBgpAdministrativeStateResult(IEnumerable neighborAddressAdministrativeStatus = null, ResponseError error = null) + { + neighborAddressAdministrativeStatus ??= new List(); + + return new InternalNetworkBgpAdministrativeStateResult(neighborAddressAdministrativeStatus?.ToList(), error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// NeighborAddress - Input should be either All or Specific Ipv4 Address or Specific Ipv6 Address. + /// BGP Administrative state. + /// Error message. + /// A new instance for mocking. + public static NeighborAddressBgpAdministrativeStatus NeighborAddressBgpAdministrativeStatus(string neighborAddress = null, BgpAdministrativeState? administrativeState = null, string error = null) + { + return new NeighborAddressBgpAdministrativeStatus(neighborAddress, administrativeState, error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Switch configuration description. + /// Physical Identifier of the network interface. + /// The ARM resource id of the interface or compute server its connected to. + /// The Interface Type. Example: Management/Data. + /// IPv4Address of the interface. + /// IPv6Address of the interface. + /// Description of the interface. + /// Additional description of the interface. + /// Details of the last operation performed on the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// A new instance for mocking. + public static NetworkDeviceInterfaceData NetworkDeviceInterfaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string annotation = null, string physicalIdentifier = null, string connectedTo = null, NetworkDeviceInterfaceType? interfaceType = null, IPAddress ipv4Address = null, string ipv6Address = null, string description = null, string additionalDescription = null, string lastOperationDetails = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + { + return new NetworkDeviceInterfaceData( + id, + name, + resourceType, + systemData, + annotation, + physicalIdentifier, + connectedTo, + interfaceType, + ipv4Address, + ipv6Address, + description, + additionalDescription, + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, + provisioningState, + administrativeState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The error object. + /// The end time of the operation. + /// Fully qualified ID for the async operation. + /// Name of the async operation. + /// The additional properties of the operation status result. + /// Fully qualified ID of the resource against which the original async operation was started. + /// The start time of the operation. + /// Operation status. + /// A new instance for mocking. + public static CommonPostActionResponseForDeviceROCommandsOperationStatusResult CommonPostActionResponseForDeviceROCommandsOperationStatusResult(ResponseError error = null, DateTimeOffset? endOn = null, string id = null, string name = null, CommonPostActionResponseForDeviceROCommands properties = null, ResourceIdentifier resourceId = null, DateTimeOffset? startOn = null, string status = null) + { + return new CommonPostActionResponseForDeviceROCommandsOperationStatusResult( + error, + endOn, + id, + name, + properties, + resourceId, + startOn, + status, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the configuration state. + /// Predefined link containing Device RO Command output. + /// Device RO command Response limited to 4000 characters. + /// A new instance for mocking. + public static CommonPostActionResponseForDeviceROCommands CommonPostActionResponseForDeviceROCommands(NetworkFabricConfigurationState? configurationState = null, Uri outputUri = null, string deviceConfigurationPreview = null) + { + return new CommonPostActionResponseForDeviceROCommands(configurationState, outputUri, deviceConfigurationPreview, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The error object. + /// Gets the configuration state. + /// Predefined link containing Device Rw Command output. + /// A new instance for mocking. + public static CommonPostActionResponseForDeviceRWCommands CommonPostActionResponseForDeviceRWCommands(ResponseError error = null, NetworkFabricConfigurationState? configurationState = null, Uri outputUri = null) + { + return new CommonPostActionResponseForDeviceRWCommands(error, configurationState, outputUri, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Storage URL to the diff file. + /// The error object. + /// A new instance for mocking. + public static ArmConfigurationDiffResult ArmConfigurationDiffResult(Uri configurationDiffUri = null, ResponseError error = null) + { + return new ArmConfigurationDiffResult(configurationDiffUri, error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Commit Batch Identifier. + /// Commit Batch State. + /// Commit Batch Details. + /// The error object. + /// A new instance for mocking. + public static CommitBatchStatusResult CommitBatchStatusResult(string commitBatchId = null, CommitBatchState? commitBatchState = null, IEnumerable commitBatchDetailsFailedDevices = null, ResponseError error = null) + { + commitBatchDetailsFailedDevices ??= new List(); + + return new CommitBatchStatusResult(commitBatchId, commitBatchState, commitBatchDetailsFailedDevices != null ? new CommitBatchDetails(commitBatchDetailsFailedDevices?.ToList(), serializedAdditionalRawData: null) : null, error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Commit Batch Identifier. + /// The error object. + /// A new instance for mocking. + public static DiscardCommitBatchResult DiscardCommitBatchResult(string commitBatchId = null, ResponseError error = null) + { + return new DiscardCommitBatchResult(commitBatchId, error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The NetworkToNetworkInterconnect Properties. + /// A new instance for mocking. + public static NetworkToNetworkInterconnectData NetworkToNetworkInterconnectData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NetworkToNetworkInterconnectProperties properties = null) + { + return new NetworkToNetworkInterconnectData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Type of NNI used. Example: CE | NPB. + /// Configuration to use NNI for Infrastructure Management. Example: True/False. + /// Based on this option layer3 parameters are mandatory. Example: True/False. + /// Common properties for Layer2 Configuration. + /// Common properties for Layer3Configuration. + /// NPB Static Route Configuration properties. + /// Static Route Configuration. + /// Import Route Policy information. + /// Export Route Policy information. + /// Egress Acl. ARM resource ID of Access Control Lists. + /// Ingress Acl. ARM resource ID of Access Control Lists. + /// Micro Bidirectional Forwarding Detection (BFD) enabled/disabled state. + /// Conditional Default Route Configuration properties. + /// Details of the last operation performed on the resource. + /// Configuration state of the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// A new instance for mocking. + public static NetworkToNetworkInterconnectProperties NetworkToNetworkInterconnectProperties(NniType? nniType = null, IsManagementType? isManagementType = null, NetworkFabricBooleanValue useOptionB = default, Layer2Configuration layer2Configuration = null, OptionBLayer3Configuration optionBLayer3Configuration = null, NpbStaticRouteConfiguration npbStaticRouteConfiguration = null, NniStaticRouteConfiguration staticRouteConfiguration = null, ImportRoutePolicyInformation importRoutePolicy = null, ExportRoutePolicyInformation exportRoutePolicy = null, ResourceIdentifier egressAclId = null, ResourceIdentifier ingressAclId = null, MicroBfdState? microBfdState = null, ConditionalDefaultRouteProperties conditionalDefaultRouteConfiguration = null, string lastOperationDetails = null, NetworkFabricConfigurationState? configurationState = null, NetworkFabricProvisioningState? provisioningState = null, NetworkFabricAdministrativeState? administrativeState = null) + { + return new NetworkToNetworkInterconnectProperties( + nniType, + isManagementType, + useOptionB, + layer2Configuration, + optionBLayer3Configuration, + npbStaticRouteConfiguration, + staticRouteConfiguration, + importRoutePolicy, + exportRoutePolicy, + egressAclId, + ingressAclId, + microBfdState, + conditionalDefaultRouteConfiguration, + lastOperationDetails != null ? new LastOperationProperties(lastOperationDetails, serializedAdditionalRawData: null) : null, + configurationState, + provisioningState, + administrativeState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// IPv4 Address Prefix. + /// IPv6 Address Prefix. + /// Secondary IPv4 Address Prefix. + /// Secondary IPv6 Address Prefix. + /// ASN of PE devices for CE/PE connectivity.Example : 28. + /// VLAN for CE/PE Layer 3 connectivity.Example : 501. + /// ASN of CE devices for CE/PE connectivity. + /// Provider Edge (PE) Loopback IP Address. + /// BGP Monitoring Protocol (BMP) Configuration. + /// OptionB Layer3 prefix limit configuration. + /// A new instance for mocking. + public static OptionBLayer3Configuration OptionBLayer3Configuration(string primaryIPv4Prefix = null, string primaryIPv6Prefix = null, string secondaryIPv4Prefix = null, string secondaryIPv6Prefix = null, long? peerAsn = null, int? vlanId = null, long? fabricAsn = null, IEnumerable peLoopbackIPAddress = null, BmpConfigurationState? bmpConfigurationState = null, IEnumerable prefixLimits = null) + { + peLoopbackIPAddress ??= new List(); + prefixLimits ??= new List(); + + return new OptionBLayer3Configuration( + primaryIPv4Prefix, + primaryIPv6Prefix, + secondaryIPv4Prefix, + secondaryIPv6Prefix, + peerAsn, + vlanId, + fabricAsn, + peLoopbackIPAddress?.ToList(), + bmpConfigurationState.HasValue ? new NniBmpProperties(bmpConfigurationState.Value, serializedAdditionalRawData: null) : null, + prefixLimits?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Fully qualified resource ID for the resource. E.g. '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'. + /// The type of the resource. E.g. 'Microsoft.Compute/virtualMachines' or 'Microsoft.Storage/storageAccounts'. + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Resource properties. + /// A new instance for mocking. + public static NetworkToNetworkInterconnectPatch NetworkToNetworkInterconnectPatch(ResourceIdentifier id = null, string networkToNetworkInterconnectPatchType = null, SystemData systemData = null, NetworkToNetworkInterconnectPatchProperties properties = null) + { + return new NetworkToNetworkInterconnectPatch(id, networkToNetworkInterconnectPatchType, systemData, properties, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// IPv4 Address Prefix. + /// IPv6 Address Prefix. + /// Secondary IPv4 Address Prefix. + /// Secondary IPv6 Address Prefix. + /// ASN of PE devices for CE/PE connectivity.Example : 28. + /// VLAN for CE/PE Layer 3 connectivity.Example : 501. + /// ASN of CE devices for CE/PE connectivity. + /// Provider Edge (PE) Loopback IP Address. + /// BGP Monitoring Protocol (BMP) Configuration. + /// OptionB Layer3 prefix limit configuration. + /// A new instance for mocking. + public static OptionBLayer3ConfigurationPatchProperties OptionBLayer3ConfigurationPatchProperties(string primaryIPv4Prefix = null, string primaryIPv6Prefix = null, string secondaryIPv4Prefix = null, string secondaryIPv6Prefix = null, long? peerAsn = null, int? vlanId = null, long? fabricAsn = null, IEnumerable peLoopbackIPAddress = null, BmpConfigurationState? bmpConfigurationState = null, IEnumerable prefixLimits = null) + { + peLoopbackIPAddress ??= new List(); + prefixLimits ??= new List(); + + return new OptionBLayer3ConfigurationPatchProperties( + primaryIPv4Prefix, + primaryIPv6Prefix, + secondaryIPv4Prefix, + secondaryIPv6Prefix, + peerAsn, + vlanId, + fabricAsn, + peLoopbackIPAddress?.ToList(), + bmpConfigurationState != null ? new NniBmpPatchProperties(bmpConfigurationState, serializedAdditionalRawData: null) : null, + prefixLimits?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Route Type. Choose either Static or OptionA. + /// State. Select either enable or disable. + /// The error object. + /// A new instance for mocking. + public static NniBfdAdministrativeStateResult NniBfdAdministrativeStateResult(RouteType? routeType = null, BfdAdministrativeState? administrativeState = null, ResponseError error = null) + { + return new NniBfdAdministrativeStateResult(routeType, administrativeState, error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Storage URL to the device configuration file. + /// The error object. + /// A new instance for mocking. + public static ViewDeviceConfigurationResult ViewDeviceConfigurationResult(Uri deviceConfigurationUri = null, ResponseError error = null) + { + return new ViewDeviceConfigurationResult(deviceConfigurationUri, error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Sequence to insert to/delete from existing route. + /// Route policy condition properties. + /// Route policy action properties. + /// A new instance for mocking. + public static RoutePolicyStatementPatchProperties RoutePolicyStatementPatchProperties(string annotation = null, long sequenceNumber = default, StatementConditionPatchProperties condition = null, StatementActionPatchProperties action = null) + { + return new RoutePolicyStatementPatchProperties(annotation, sequenceNumber, condition, action, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Local Preference of the route policy. + /// Action type. Example: Permit | Deny | Continue. + /// IP Community Properties. + /// IP Extended Community Properties. + /// A new instance for mocking. + public static StatementActionPatchProperties StatementActionPatchProperties(long? localPreference = null, RoutePolicyActionType actionType = default, ActionIPCommunityPatchProperties ipCommunityProperties = null, ActionIPExtendedCommunityPatchProperties ipExtendedCommunityProperties = null) + { + return new StatementActionPatchProperties(localPreference, actionType, ipCommunityProperties, ipExtendedCommunityProperties, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Switch configuration description. + /// Input method to configure Access Control List. + /// Access Control List file URL. + /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + /// List of match configurations. + /// List of dynamic match configurations. + /// The last synced timestamp. + /// Configuration state of the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static NetworkFabricAccessControlListData NetworkFabricAccessControlListData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, NetworkFabricConfigurationType? configurationType, Uri aclsUri, CommunityActionType? defaultAction, IEnumerable matchConfigurations, IEnumerable dynamicMatchConfigurations, DateTimeOffset? lastSyncedOn, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState) + { + return NetworkFabricAccessControlListData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, annotation: annotation, configurationType: configurationType, aclsUri: aclsUri, defaultAction: defaultAction, matchConfigurations: matchConfigurations, dynamicMatchConfigurations: dynamicMatchConfigurations, lastSyncedOn: lastSyncedOn, aclType: default, deviceRole: default, globalAccessControlListActionsEnableCount: default, lastOperationDetails: default, configurationState: configurationState, provisioningState: provisioningState, administrativeState: administrativeState); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Switch configuration description. + /// ARM Resource ID of the Internet Gateway Rule. + /// IPv4 Address of Internet Gateway. + /// Port number of Internet Gateway. + /// Gateway Type of the resource. + /// ARM Resource ID of the Network Fabric Controller. + /// Provisioning state of resource. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static NetworkFabricInternetGatewayData NetworkFabricInternetGatewayData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, ResourceIdentifier internetGatewayRuleId, string ipV4Address, int? port, InternetGatewayType typePropertiesType, ResourceIdentifier networkFabricControllerId, NetworkFabricProvisioningState? provisioningState) + { + return NetworkFabricInternetGatewayData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, annotation: annotation, internetGatewayRuleId: internetGatewayRuleId, ipV4Address: ipV4Address, port: port, typePropertiesType: typePropertiesType, internetGatewayType: default, networkFabricControllerId: networkFabricControllerId, lastOperationDetails: default, provisioningState: provisioningState); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// BFD configuration properties. + /// Originate a defaultRoute. Ex: "True" | "False". + /// Allows for routes to be received and processed even if the router detects its own ASN in the AS-Path. 0 is disable, Possible values are 1-10, default is 2. + /// Enable Or Disable state. + /// ASN of Network Fabric. Example: 65048. + /// Peer ASN. Example: 65047. + /// List of BGP IPv4 Listen Range prefixes. + /// List of BGP IPv6 Listen Ranges prefixes. + /// List with stringified IPv4 Neighbor Addresses. + /// List with stringified IPv6 Neighbor Address. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static BgpConfiguration BgpConfiguration(string annotation, BfdConfiguration bfdConfiguration, NetworkFabricBooleanValue? defaultRouteOriginate, int? allowAS, AllowASOverride? allowASOverride, long? fabricAsn, long? peerAsn, IEnumerable ipv4ListenRangePrefixes, IEnumerable ipv6ListenRangePrefixes, IEnumerable ipv4NeighborAddress, IEnumerable ipv6NeighborAddress) + { + return BgpConfiguration(annotation: annotation, bfdConfiguration: bfdConfiguration, defaultRouteOriginate: defaultRouteOriginate, allowAS: allowAS, allowASOverride: allowASOverride, fabricAsn: fabricAsn, peerAsn: peerAsn, ipv4ListenRangePrefixes: ipv4ListenRangePrefixes, ipv6ListenRangePrefixes: ipv6ListenRangePrefixes, ipv4NeighborAddress: ipv4NeighborAddress, ipv6NeighborAddress: ipv6NeighborAddress, bmpConfiguration: default, v4OverV6BgpSession: default, v6OverV4BgpSession: default); + } + + /// Initializes a new instance of . + /// IP Address. + /// Configuration state of the resource. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static NeighborAddress NeighborAddress(string address, NetworkFabricConfigurationState? configurationState) + { + return NeighborAddress(address: address, bfdAdministrativeState: default, bgpAdministrativeState: default, configurationState: configurationState); + } + + /// Initializes a new instance of . + /// IPv4 Address Prefix. + /// IPv6 Address Prefix. + /// Secondary IPv4 Address Prefix. + /// Secondary IPv6 Address Prefix. + /// MTU to use for option A peering. + /// Vlan identifier. Example : 501. + /// Fabric ASN number. Example 65001. + /// Peer ASN number.Example : 28. + /// BFD configuration properties. + /// Ingress Acl. ARM resource ID of Access Control Lists. + /// Egress Acl. ARM resource ID of Access Control Lists. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ExternalNetworkOptionAProperties ExternalNetworkOptionAProperties(string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix, int? mtu, int? vlanId, long? fabricAsn, long? peerAsn, BfdConfiguration bfdConfiguration, ResourceIdentifier ingressAclId, ResourceIdentifier egressAclId) + { + return ExternalNetworkOptionAProperties(primaryIPv4Prefix: primaryIPv4Prefix, primaryIPv6Prefix: primaryIPv6Prefix, secondaryIPv4Prefix: secondaryIPv4Prefix, secondaryIPv6Prefix: secondaryIPv6Prefix, mtu: mtu, vlanId: vlanId, fabricAsn: fabricAsn, peerAsn: peerAsn, bfdConfiguration: bfdConfiguration, ingressAclId: ingressAclId, bmpConfigurationState: default, egressAclId: egressAclId, v4OverV6BgpSession: default, v6OverV4BgpSession: default, nativeIPv4PrefixLimits: default, nativeIPv6PrefixLimits: default); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Switch configuration description. + /// The host name of the device. + /// Serial number of the device. Format of serial Number - Make;Model;HardwareRevisionId;SerialNumber. + /// Current version of the device as defined in SKU. + /// Network Device SKU name. + /// NetworkDeviceRole is the device role: Example: CE | ToR. + /// Reference to network rack resource id. + /// Management IPv4 Address. + /// Management IPv6 Address. + /// Configuration state of the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static NetworkDeviceData NetworkDeviceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, string hostName, string serialNumber, string version, string networkDeviceSku, NetworkDeviceRole? networkDeviceRole, ResourceIdentifier networkRackId, IPAddress managementIPv4Address, string managementIPv6Address, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState) + { + return NetworkDeviceData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, annotation: annotation, hostName: hostName, serialNumber: serialNumber, version: version, networkDeviceSku: networkDeviceSku, networkDeviceRole: networkDeviceRole, networkRackId: networkRackId, managementIPv4Address: managementIPv4Address, managementIPv6Address: managementIPv6Address, rwDeviceConfig: default, lastOperationDetails: default, configurationState: configurationState, provisioningState: provisioningState, administrativeState: administrativeState); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Switch configuration description. + /// Physical Identifier of the network interface. + /// The ARM resource id of the interface or compute server its connected to. + /// The Interface Type. Example: Management/Data. + /// IPv4Address of the interface. + /// IPv6Address of the interface. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static NetworkDeviceInterfaceData NetworkDeviceInterfaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string annotation, string physicalIdentifier, string connectedTo, NetworkDeviceInterfaceType? interfaceType, IPAddress ipv4Address, string ipv6Address, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState) + { + return NetworkDeviceInterfaceData(id: id, name: name, resourceType: resourceType, systemData: systemData, annotation: annotation, physicalIdentifier: physicalIdentifier, connectedTo: connectedTo, interfaceType: interfaceType, ipv4Address: ipv4Address, ipv6Address: ipv6Address, description: default, additionalDescription: default, lastOperationDetails: default, provisioningState: provisioningState, administrativeState: administrativeState); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Switch configuration description. + /// Supported Network Fabric SKU.Example: Compute / Aggregate racks. Once the user chooses a particular SKU, only supported racks can be added to the Network Fabric. The SKU determines whether it is a single / multi rack Network Fabric. + /// The version of Network Fabric. + /// Array of router IDs. + /// Azure resource ID for the NetworkFabricController the NetworkFabric belongs. + /// Number of compute racks associated to Network Fabric. + /// Number of servers.Possible values are from 1-16. + /// IPv4Prefix for Management Network. Example: 10.1.0.0/19. + /// IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. + /// ASN of CE devices for CE/PE connectivity. + /// Network and credentials configuration currently applied to terminal server. + /// Configuration to be used to setup the management network. + /// List of NetworkRack resource IDs under the Network Fabric. The number of racks allowed depends on the Network Fabric SKU. + /// List of L2 Isolation Domain resource IDs under the Network Fabric. + /// List of L3 Isolation Domain resource IDs under the Network Fabric. + /// Configuration state of the resource. + /// Provides you the latest status of the NFC service, whether it is Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on the status of NFC provisioning. + /// Administrative state of the resource. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static NetworkFabricData NetworkFabricData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, string networkFabricSku, string fabricVersion, IEnumerable routerIds, ResourceIdentifier networkFabricControllerId, int? rackCount, int serverCountPerRack, string ipv4Prefix, string ipv6Prefix, long fabricAsn, TerminalServerConfiguration terminalServerConfiguration, ManagementNetworkConfigurationProperties managementNetworkConfiguration, IEnumerable racks, IEnumerable l2IsolationDomains, IEnumerable l3IsolationDomains, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState) + { + return NetworkFabricData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, identity: default, annotation: annotation, networkFabricSku: networkFabricSku, fabricVersion: fabricVersion, routerIds: routerIds, storageAccountConfiguration: default, fabricLocks: default, networkFabricControllerId: networkFabricControllerId, rackCount: rackCount, serverCountPerRack: serverCountPerRack, ipv4Prefix: ipv4Prefix, ipv6Prefix: ipv6Prefix, fabricAsn: fabricAsn, terminalServerConfiguration: terminalServerConfiguration, managementNetworkConfiguration: managementNetworkConfiguration, racks: racks, l2IsolationDomains: l2IsolationDomains, l3IsolationDomains: l3IsolationDomains, hardwareAlertThreshold: default, controlPlaneAcls: default, featureFlags: default, trustedIPPrefixes: default, uniqueRdConfiguration: default, storageArrayCount: default, activeCommitBatches: default, lastOperationDetails: default, configurationState: configurationState, provisioningState: provisioningState, administrativeState: administrativeState); + } + + /// Initializes a new instance of . + /// IPv4 Address Prefix. + /// IPv6 Address Prefix. + /// Secondary IPv4 Address Prefix. + /// Secondary IPv6 Address Prefix. + /// ASN of PE devices for CE/PE connectivity.Example : 28. + /// VLAN for CE/PE Layer 3 connectivity.Example : 501. + /// ASN of CE devices for CE/PE connectivity. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static OptionBLayer3Configuration OptionBLayer3Configuration(string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix, long? peerAsn, int? vlanId, long? fabricAsn) + { + return OptionBLayer3Configuration(primaryIPv4Prefix: primaryIPv4Prefix, primaryIPv6Prefix: primaryIPv6Prefix, secondaryIPv4Prefix: secondaryIPv4Prefix, secondaryIPv6Prefix: secondaryIPv6Prefix, peerAsn: peerAsn, vlanId: vlanId, fabricAsn: fabricAsn, peLoopbackIPAddress: default, bmpConfigurationState: default, prefixLimits: default); + } + + /// + /// This constructor is added for the backward compatibility. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static NetworkFabricAccessControlListData NetworkFabricAccessControlListData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, NetworkFabricConfigurationType? configurationType, Uri aclsUri, IEnumerable matchConfigurations, IEnumerable dynamicMatchConfigurations, DateTimeOffset? lastSyncedOn, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState) { - return NetworkFabricRoutePolicyData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, annotation: annotation, defaultAction: default, statements: statements, networkFabricId: networkFabricId, addressFamilyType: addressFamilyType, configurationState: configurationState, provisioningState: provisioningState, administrativeState: administrativeState); + return NetworkFabricAccessControlListData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, annotation: annotation, configurationType: configurationType, aclsUri: aclsUri, defaultAction: default, matchConfigurations: matchConfigurations, dynamicMatchConfigurations: dynamicMatchConfigurations, lastSyncedOn: lastSyncedOn, aclType: default, deviceRole: default, globalAccessControlListActionsEnableCount: default, lastOperationDetails: default, configurationState: configurationState, provisioningState: provisioningState, administrativeState: administrativeState); } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricExtensions.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricExtensions.cs index 7be477fa1a51..246aabe9113a 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricExtensions.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricExtensions.cs @@ -52,41 +52,41 @@ public static NetworkFabricAccessControlListResource GetNetworkFabricAccessContr } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static NetworkFabricInternetGatewayResource GetNetworkFabricInternetGatewayResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static NetworkFabricInternetGatewayRuleResource GetNetworkFabricInternetGatewayRuleResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableManagedNetworkFabricArmClient(client).GetNetworkFabricInternetGatewayResource(id); + return GetMockableManagedNetworkFabricArmClient(client).GetNetworkFabricInternetGatewayRuleResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static NetworkFabricInternetGatewayRuleResource GetNetworkFabricInternetGatewayRuleResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static NetworkFabricInternetGatewayResource GetNetworkFabricInternetGatewayResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableManagedNetworkFabricArmClient(client).GetNetworkFabricInternetGatewayRuleResource(id); + return GetMockableManagedNetworkFabricArmClient(client).GetNetworkFabricInternetGatewayResource(id); } /// @@ -184,44 +184,6 @@ public static NetworkFabricL3IsolationDomainResource GetNetworkFabricL3Isolation return GetMockableManagedNetworkFabricArmClient(client).GetNetworkFabricL3IsolationDomainResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static NetworkFabricInternalNetworkResource GetNetworkFabricInternalNetworkResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableManagedNetworkFabricArmClient(client).GetNetworkFabricInternalNetworkResource(id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static NetworkFabricExternalNetworkResource GetNetworkFabricExternalNetworkResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableManagedNetworkFabricArmClient(client).GetNetworkFabricExternalNetworkResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -279,25 +241,6 @@ public static NetworkDeviceResource GetNetworkDeviceResource(this ArmClient clie return GetMockableManagedNetworkFabricArmClient(client).GetNetworkDeviceResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static NetworkDeviceInterfaceResource GetNetworkDeviceInterfaceResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableManagedNetworkFabricArmClient(client).GetNetworkDeviceInterfaceResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -356,22 +299,22 @@ public static NetworkFabricResource GetNetworkFabricResource(this ArmClient clie } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static NetworkToNetworkInterconnectResource GetNetworkToNetworkInterconnectResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static NetworkMonitorResource GetNetworkMonitorResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableManagedNetworkFabricArmClient(client).GetNetworkToNetworkInterconnectResource(id); + return GetMockableManagedNetworkFabricArmClient(client).GetNetworkMonitorResource(id); } /// @@ -469,6 +412,82 @@ public static NetworkFabricRoutePolicyResource GetNetworkFabricRoutePolicyResour return GetMockableManagedNetworkFabricArmClient(client).GetNetworkFabricRoutePolicyResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static NetworkFabricExternalNetworkResource GetNetworkFabricExternalNetworkResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableManagedNetworkFabricArmClient(client).GetNetworkFabricExternalNetworkResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static NetworkFabricInternalNetworkResource GetNetworkFabricInternalNetworkResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableManagedNetworkFabricArmClient(client).GetNetworkFabricInternalNetworkResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static NetworkDeviceInterfaceResource GetNetworkDeviceInterfaceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableManagedNetworkFabricArmClient(client).GetNetworkDeviceInterfaceResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static NetworkToNetworkInterconnectResource GetNetworkToNetworkInterconnectResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableManagedNetworkFabricArmClient(client).GetNetworkToNetworkInterconnectResource(id); + } + /// /// Gets a collection of NetworkFabricAccessControlListResources in the ResourceGroupResource. /// @@ -499,7 +518,7 @@ public static NetworkFabricAccessControlListCollection GetNetworkFabricAccessCon /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -537,7 +556,7 @@ public static async Task> GetNe /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -563,189 +582,189 @@ public static Response GetNetworkFabricA } /// - /// Gets a collection of NetworkFabricInternetGatewayResources in the ResourceGroupResource. + /// Gets a collection of NetworkFabricInternetGatewayRuleResources in the ResourceGroupResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of NetworkFabricInternetGatewayResources and their operations over a NetworkFabricInternetGatewayResource. - public static NetworkFabricInternetGatewayCollection GetNetworkFabricInternetGateways(this ResourceGroupResource resourceGroupResource) + /// An object representing collection of NetworkFabricInternetGatewayRuleResources and their operations over a NetworkFabricInternetGatewayRuleResource. + public static NetworkFabricInternetGatewayRuleCollection GetNetworkFabricInternetGatewayRules(this ResourceGroupResource resourceGroupResource) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableManagedNetworkFabricResourceGroupResource(resourceGroupResource).GetNetworkFabricInternetGateways(); + return GetMockableManagedNetworkFabricResourceGroupResource(resourceGroupResource).GetNetworkFabricInternetGatewayRules(); } /// - /// Implements Gateway GET method. + /// Gets an Internet Gateway Rule resource. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName} /// /// /// Operation Id - /// InternetGateways_Get + /// InternetGatewayRules_Get /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// Name of the Internet Gateway. + /// Name of the Internet Gateway rule. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetNetworkFabricInternetGatewayAsync(this ResourceGroupResource resourceGroupResource, string internetGatewayName, CancellationToken cancellationToken = default) + public static async Task> GetNetworkFabricInternetGatewayRuleAsync(this ResourceGroupResource resourceGroupResource, string internetGatewayRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockableManagedNetworkFabricResourceGroupResource(resourceGroupResource).GetNetworkFabricInternetGatewayAsync(internetGatewayName, cancellationToken).ConfigureAwait(false); + return await GetMockableManagedNetworkFabricResourceGroupResource(resourceGroupResource).GetNetworkFabricInternetGatewayRuleAsync(internetGatewayRuleName, cancellationToken).ConfigureAwait(false); } /// - /// Implements Gateway GET method. + /// Gets an Internet Gateway Rule resource. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName} /// /// /// Operation Id - /// InternetGateways_Get + /// InternetGatewayRules_Get /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// Name of the Internet Gateway. + /// Name of the Internet Gateway rule. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetNetworkFabricInternetGateway(this ResourceGroupResource resourceGroupResource, string internetGatewayName, CancellationToken cancellationToken = default) + public static Response GetNetworkFabricInternetGatewayRule(this ResourceGroupResource resourceGroupResource, string internetGatewayRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableManagedNetworkFabricResourceGroupResource(resourceGroupResource).GetNetworkFabricInternetGateway(internetGatewayName, cancellationToken); + return GetMockableManagedNetworkFabricResourceGroupResource(resourceGroupResource).GetNetworkFabricInternetGatewayRule(internetGatewayRuleName, cancellationToken); } /// - /// Gets a collection of NetworkFabricInternetGatewayRuleResources in the ResourceGroupResource. + /// Gets a collection of NetworkFabricInternetGatewayResources in the ResourceGroupResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of NetworkFabricInternetGatewayRuleResources and their operations over a NetworkFabricInternetGatewayRuleResource. - public static NetworkFabricInternetGatewayRuleCollection GetNetworkFabricInternetGatewayRules(this ResourceGroupResource resourceGroupResource) + /// An object representing collection of NetworkFabricInternetGatewayResources and their operations over a NetworkFabricInternetGatewayResource. + public static NetworkFabricInternetGatewayCollection GetNetworkFabricInternetGateways(this ResourceGroupResource resourceGroupResource) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableManagedNetworkFabricResourceGroupResource(resourceGroupResource).GetNetworkFabricInternetGatewayRules(); + return GetMockableManagedNetworkFabricResourceGroupResource(resourceGroupResource).GetNetworkFabricInternetGateways(); } /// - /// Gets an Internet Gateway Rule resource. + /// Implements Gateway GET method. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName} /// /// /// Operation Id - /// InternetGatewayRules_Get + /// InternetGateways_Get /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// Name of the Internet Gateway rule. + /// Name of the Internet Gateway. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetNetworkFabricInternetGatewayRuleAsync(this ResourceGroupResource resourceGroupResource, string internetGatewayRuleName, CancellationToken cancellationToken = default) + public static async Task> GetNetworkFabricInternetGatewayAsync(this ResourceGroupResource resourceGroupResource, string internetGatewayName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockableManagedNetworkFabricResourceGroupResource(resourceGroupResource).GetNetworkFabricInternetGatewayRuleAsync(internetGatewayRuleName, cancellationToken).ConfigureAwait(false); + return await GetMockableManagedNetworkFabricResourceGroupResource(resourceGroupResource).GetNetworkFabricInternetGatewayAsync(internetGatewayName, cancellationToken).ConfigureAwait(false); } /// - /// Gets an Internet Gateway Rule resource. + /// Implements Gateway GET method. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName} /// /// /// Operation Id - /// InternetGatewayRules_Get + /// InternetGateways_Get /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// Name of the Internet Gateway rule. + /// Name of the Internet Gateway. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetNetworkFabricInternetGatewayRule(this ResourceGroupResource resourceGroupResource, string internetGatewayRuleName, CancellationToken cancellationToken = default) + public static Response GetNetworkFabricInternetGateway(this ResourceGroupResource resourceGroupResource, string internetGatewayName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableManagedNetworkFabricResourceGroupResource(resourceGroupResource).GetNetworkFabricInternetGatewayRule(internetGatewayRuleName, cancellationToken); + return GetMockableManagedNetworkFabricResourceGroupResource(resourceGroupResource).GetNetworkFabricInternetGateway(internetGatewayName, cancellationToken); } /// @@ -778,7 +797,7 @@ public static NetworkFabricIPCommunityCollection GetNetworkFabricIPCommunities(t /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -816,7 +835,7 @@ public static async Task> GetNetworkF /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -871,7 +890,7 @@ public static NetworkFabricIPExtendedCommunityCollection GetNetworkFabricIPExten /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -909,7 +928,7 @@ public static async Task> Get /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -964,7 +983,7 @@ public static NetworkFabricIPPrefixCollection GetNetworkFabricIPPrefixes(this Re /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1002,7 +1021,7 @@ public static async Task> GetNetworkFabr /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1057,7 +1076,7 @@ public static NetworkFabricL2IsolationDomainCollection GetNetworkFabricL2Isolati /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1095,7 +1114,7 @@ public static async Task> GetNe /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1150,7 +1169,7 @@ public static NetworkFabricL3IsolationDomainCollection GetNetworkFabricL3Isolati /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1188,7 +1207,7 @@ public static async Task> GetNe /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1243,7 +1262,7 @@ public static NetworkFabricNeighborGroupCollection GetNetworkFabricNeighborGroup /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1281,7 +1300,7 @@ public static async Task> GetNetwor /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1336,7 +1355,7 @@ public static NetworkDeviceCollection GetNetworkDevices(this ResourceGroupResour /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1374,7 +1393,7 @@ public static async Task> GetNetworkDeviceAsync( /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1429,7 +1448,7 @@ public static NetworkFabricControllerCollection GetNetworkFabricControllers(this /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1467,7 +1486,7 @@ public static async Task> GetNetworkFa /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1522,7 +1541,7 @@ public static NetworkFabricCollection GetNetworkFabrics(this ResourceGroupResour /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1560,7 +1579,7 @@ public static async Task> GetNetworkFabricAsync( /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1585,6 +1604,99 @@ public static Response GetNetworkFabric(this ResourceGrou return GetMockableManagedNetworkFabricResourceGroupResource(resourceGroupResource).GetNetworkFabric(networkFabricName, cancellationToken); } + /// + /// Gets a collection of NetworkMonitorResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of NetworkMonitorResources and their operations over a NetworkMonitorResource. + public static NetworkMonitorCollection GetNetworkMonitors(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableManagedNetworkFabricResourceGroupResource(resourceGroupResource).GetNetworkMonitors(); + } + + /// + /// Implements NetworkMonitor GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the Network Monitor. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetNetworkMonitorAsync(this ResourceGroupResource resourceGroupResource, string networkMonitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableManagedNetworkFabricResourceGroupResource(resourceGroupResource).GetNetworkMonitorAsync(networkMonitorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements NetworkMonitor GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the Network Monitor. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetNetworkMonitor(this ResourceGroupResource resourceGroupResource, string networkMonitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableManagedNetworkFabricResourceGroupResource(resourceGroupResource).GetNetworkMonitor(networkMonitorName, cancellationToken); + } + /// /// Gets a collection of NetworkPacketBrokerResources in the ResourceGroupResource. /// @@ -1615,7 +1727,7 @@ public static NetworkPacketBrokerCollection GetNetworkPacketBrokers(this Resourc /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1653,7 +1765,7 @@ public static async Task> GetNetworkPacket /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1708,7 +1820,7 @@ public static NetworkRackCollection GetNetworkRacks(this ResourceGroupResource r /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1746,7 +1858,7 @@ public static async Task> GetNetworkRackAsync(this /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1801,7 +1913,7 @@ public static NetworkTapRuleCollection GetNetworkTapRules(this ResourceGroupReso /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1839,7 +1951,7 @@ public static async Task> GetNetworkTapRuleAsyn /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1894,7 +2006,7 @@ public static NetworkTapCollection GetNetworkTaps(this ResourceGroupResource res /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1932,7 +2044,7 @@ public static async Task> GetNetworkTapAsync(this R /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1987,7 +2099,7 @@ public static NetworkFabricRoutePolicyCollection GetNetworkFabricRoutePolicies(t /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2025,7 +2137,7 @@ public static async Task> GetNetworkF /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2080,7 +2192,7 @@ public static NetworkDeviceSkuCollection GetNetworkDeviceSkus(this SubscriptionR /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2118,7 +2230,7 @@ public static async Task> GetNetworkDeviceSku /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2173,7 +2285,7 @@ public static NetworkFabricSkuCollection GetNetworkFabricSkus(this SubscriptionR /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2211,7 +2323,7 @@ public static async Task> GetNetworkFabricSku /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2249,7 +2361,7 @@ public static Response GetNetworkFabricSku(this Subscr /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2285,7 +2397,7 @@ public static AsyncPageable GetNetworkFa /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2309,147 +2421,147 @@ public static Pageable GetNetworkFabricA } /// - /// Displays Internet Gateways list by subscription GET method. + /// List all Internet Gateway rules in the given subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGateways + /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules /// /// /// Operation Id - /// InternetGateways_ListBySubscription + /// InternetGatewayRules_ListBySubscription /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetNetworkFabricInternetGatewaysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetNetworkFabricInternetGatewayRulesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableManagedNetworkFabricSubscriptionResource(subscriptionResource).GetNetworkFabricInternetGatewaysAsync(cancellationToken); + return GetMockableManagedNetworkFabricSubscriptionResource(subscriptionResource).GetNetworkFabricInternetGatewayRulesAsync(cancellationToken); } /// - /// Displays Internet Gateways list by subscription GET method. + /// List all Internet Gateway rules in the given subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGateways + /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules /// /// /// Operation Id - /// InternetGateways_ListBySubscription + /// InternetGatewayRules_ListBySubscription /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetNetworkFabricInternetGateways(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetNetworkFabricInternetGatewayRules(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableManagedNetworkFabricSubscriptionResource(subscriptionResource).GetNetworkFabricInternetGateways(cancellationToken); + return GetMockableManagedNetworkFabricSubscriptionResource(subscriptionResource).GetNetworkFabricInternetGatewayRules(cancellationToken); } /// - /// List all Internet Gateway rules in the given subscription. + /// Displays Internet Gateways list by subscription GET method. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules + /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGateways /// /// /// Operation Id - /// InternetGatewayRules_ListBySubscription + /// InternetGateways_ListBySubscription /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetNetworkFabricInternetGatewayRulesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetNetworkFabricInternetGatewaysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableManagedNetworkFabricSubscriptionResource(subscriptionResource).GetNetworkFabricInternetGatewayRulesAsync(cancellationToken); + return GetMockableManagedNetworkFabricSubscriptionResource(subscriptionResource).GetNetworkFabricInternetGatewaysAsync(cancellationToken); } /// - /// List all Internet Gateway rules in the given subscription. + /// Displays Internet Gateways list by subscription GET method. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules + /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGateways /// /// /// Operation Id - /// InternetGatewayRules_ListBySubscription + /// InternetGateways_ListBySubscription /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetNetworkFabricInternetGatewayRules(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetNetworkFabricInternetGateways(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableManagedNetworkFabricSubscriptionResource(subscriptionResource).GetNetworkFabricInternetGatewayRules(cancellationToken); + return GetMockableManagedNetworkFabricSubscriptionResource(subscriptionResource).GetNetworkFabricInternetGateways(cancellationToken); } /// @@ -2465,7 +2577,7 @@ public static Pageable GetNetworkFabri /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2501,7 +2613,7 @@ public static AsyncPageable GetNetworkFabricIP /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2537,7 +2649,7 @@ public static Pageable GetNetworkFabricIPCommu /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2573,7 +2685,7 @@ public static AsyncPageable GetNetwork /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2609,7 +2721,7 @@ public static Pageable GetNetworkFabri /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2645,7 +2757,7 @@ public static AsyncPageable GetNetworkFabricIPPre /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2681,7 +2793,7 @@ public static Pageable GetNetworkFabricIPPrefixes /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2717,7 +2829,7 @@ public static AsyncPageable GetNetworkFa /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2753,7 +2865,7 @@ public static Pageable GetNetworkFabricL /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2789,7 +2901,7 @@ public static AsyncPageable GetNetworkFa /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2825,7 +2937,7 @@ public static Pageable GetNetworkFabricL /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2861,7 +2973,7 @@ public static AsyncPageable GetNetworkFabric /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2897,7 +3009,7 @@ public static Pageable GetNetworkFabricNeigh /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2933,7 +3045,7 @@ public static AsyncPageable GetNetworkDevicesAsync(this S /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -2969,7 +3081,7 @@ public static Pageable GetNetworkDevices(this Subscriptio /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -3005,7 +3117,7 @@ public static AsyncPageable GetNetworkFabricCon /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -3041,7 +3153,7 @@ public static Pageable GetNetworkFabricControll /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -3077,7 +3189,7 @@ public static AsyncPageable GetNetworkFabricsAsync(this S /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -3100,6 +3212,78 @@ public static Pageable GetNetworkFabrics(this Subscriptio return GetMockableManagedNetworkFabricSubscriptionResource(subscriptionResource).GetNetworkFabrics(cancellationToken); } + /// + /// Displays NetworkMonitors list by subscription GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkMonitors + /// + /// + /// Operation Id + /// NetworkMonitors_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetNetworkMonitorsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableManagedNetworkFabricSubscriptionResource(subscriptionResource).GetNetworkMonitorsAsync(cancellationToken); + } + + /// + /// Displays NetworkMonitors list by subscription GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkMonitors + /// + /// + /// Operation Id + /// NetworkMonitors_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetNetworkMonitors(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableManagedNetworkFabricSubscriptionResource(subscriptionResource).GetNetworkMonitors(cancellationToken); + } + /// /// Displays Network Packet Brokers list by subscription GET method. /// @@ -3113,7 +3297,7 @@ public static Pageable GetNetworkFabrics(this Subscriptio /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -3149,7 +3333,7 @@ public static AsyncPageable GetNetworkPacketBrokers /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -3185,7 +3369,7 @@ public static Pageable GetNetworkPacketBrokers(this /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -3221,7 +3405,7 @@ public static AsyncPageable GetNetworkRacksAsync(this Subsc /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -3257,7 +3441,7 @@ public static Pageable GetNetworkRacks(this SubscriptionRes /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -3293,7 +3477,7 @@ public static AsyncPageable GetNetworkTapRulesAsync(this /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -3329,7 +3513,7 @@ public static Pageable GetNetworkTapRules(this Subscript /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -3365,7 +3549,7 @@ public static AsyncPageable GetNetworkTapsAsync(this Subscri /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -3401,7 +3585,7 @@ public static Pageable GetNetworkTaps(this SubscriptionResou /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -3437,7 +3621,7 @@ public static AsyncPageable GetNetworkFabricRo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/MockableManagedNetworkFabricArmClient.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/MockableManagedNetworkFabricArmClient.cs index 415a0de7f199..111fe63df983 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/MockableManagedNetworkFabricArmClient.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/MockableManagedNetworkFabricArmClient.cs @@ -46,18 +46,6 @@ public virtual NetworkFabricAccessControlListResource GetNetworkFabricAccessCont return new NetworkFabricAccessControlListResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual NetworkFabricInternetGatewayResource GetNetworkFabricInternetGatewayResource(ResourceIdentifier id) - { - NetworkFabricInternetGatewayResource.ValidateResourceId(id); - return new NetworkFabricInternetGatewayResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -70,6 +58,18 @@ public virtual NetworkFabricInternetGatewayRuleResource GetNetworkFabricInternet return new NetworkFabricInternetGatewayRuleResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual NetworkFabricInternetGatewayResource GetNetworkFabricInternetGatewayResource(ResourceIdentifier id) + { + NetworkFabricInternetGatewayResource.ValidateResourceId(id); + return new NetworkFabricInternetGatewayResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -130,30 +130,6 @@ public virtual NetworkFabricL3IsolationDomainResource GetNetworkFabricL3Isolatio return new NetworkFabricL3IsolationDomainResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual NetworkFabricInternalNetworkResource GetNetworkFabricInternalNetworkResource(ResourceIdentifier id) - { - NetworkFabricInternalNetworkResource.ValidateResourceId(id); - return new NetworkFabricInternalNetworkResource(Client, id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual NetworkFabricExternalNetworkResource GetNetworkFabricExternalNetworkResource(ResourceIdentifier id) - { - NetworkFabricExternalNetworkResource.ValidateResourceId(id); - return new NetworkFabricExternalNetworkResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -190,18 +166,6 @@ public virtual NetworkDeviceResource GetNetworkDeviceResource(ResourceIdentifier return new NetworkDeviceResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual NetworkDeviceInterfaceResource GetNetworkDeviceInterfaceResource(ResourceIdentifier id) - { - NetworkDeviceInterfaceResource.ValidateResourceId(id); - return new NetworkDeviceInterfaceResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -239,15 +203,15 @@ public virtual NetworkFabricResource GetNetworkFabricResource(ResourceIdentifier } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual NetworkToNetworkInterconnectResource GetNetworkToNetworkInterconnectResource(ResourceIdentifier id) + /// Returns a object. + public virtual NetworkMonitorResource GetNetworkMonitorResource(ResourceIdentifier id) { - NetworkToNetworkInterconnectResource.ValidateResourceId(id); - return new NetworkToNetworkInterconnectResource(Client, id); + NetworkMonitorResource.ValidateResourceId(id); + return new NetworkMonitorResource(Client, id); } /// @@ -309,5 +273,53 @@ public virtual NetworkFabricRoutePolicyResource GetNetworkFabricRoutePolicyResou NetworkFabricRoutePolicyResource.ValidateResourceId(id); return new NetworkFabricRoutePolicyResource(Client, id); } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual NetworkFabricExternalNetworkResource GetNetworkFabricExternalNetworkResource(ResourceIdentifier id) + { + NetworkFabricExternalNetworkResource.ValidateResourceId(id); + return new NetworkFabricExternalNetworkResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual NetworkFabricInternalNetworkResource GetNetworkFabricInternalNetworkResource(ResourceIdentifier id) + { + NetworkFabricInternalNetworkResource.ValidateResourceId(id); + return new NetworkFabricInternalNetworkResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual NetworkDeviceInterfaceResource GetNetworkDeviceInterfaceResource(ResourceIdentifier id) + { + NetworkDeviceInterfaceResource.ValidateResourceId(id); + return new NetworkDeviceInterfaceResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual NetworkToNetworkInterconnectResource GetNetworkToNetworkInterconnectResource(ResourceIdentifier id) + { + NetworkToNetworkInterconnectResource.ValidateResourceId(id); + return new NetworkToNetworkInterconnectResource(Client, id); + } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/MockableManagedNetworkFabricResourceGroupResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/MockableManagedNetworkFabricResourceGroupResource.cs index 209389288cba..bb9815a1b44b 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/MockableManagedNetworkFabricResourceGroupResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/MockableManagedNetworkFabricResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual NetworkFabricAccessControlListCollection GetNetworkFabricAccessCo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetN /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -102,142 +102,142 @@ public virtual Response GetNetworkFabric return GetNetworkFabricAccessControlLists().Get(accessControlListName, cancellationToken); } - /// Gets a collection of NetworkFabricInternetGatewayResources in the ResourceGroupResource. - /// An object representing collection of NetworkFabricInternetGatewayResources and their operations over a NetworkFabricInternetGatewayResource. - public virtual NetworkFabricInternetGatewayCollection GetNetworkFabricInternetGateways() + /// Gets a collection of NetworkFabricInternetGatewayRuleResources in the ResourceGroupResource. + /// An object representing collection of NetworkFabricInternetGatewayRuleResources and their operations over a NetworkFabricInternetGatewayRuleResource. + public virtual NetworkFabricInternetGatewayRuleCollection GetNetworkFabricInternetGatewayRules() { - return GetCachedClient(client => new NetworkFabricInternetGatewayCollection(client, Id)); + return GetCachedClient(client => new NetworkFabricInternetGatewayRuleCollection(client, Id)); } /// - /// Implements Gateway GET method. + /// Gets an Internet Gateway Rule resource. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName} /// /// /// Operation Id - /// InternetGateways_Get + /// InternetGatewayRules_Get /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// - /// Name of the Internet Gateway. + /// Name of the Internet Gateway rule. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetNetworkFabricInternetGatewayAsync(string internetGatewayName, CancellationToken cancellationToken = default) + public virtual async Task> GetNetworkFabricInternetGatewayRuleAsync(string internetGatewayRuleName, CancellationToken cancellationToken = default) { - return await GetNetworkFabricInternetGateways().GetAsync(internetGatewayName, cancellationToken).ConfigureAwait(false); + return await GetNetworkFabricInternetGatewayRules().GetAsync(internetGatewayRuleName, cancellationToken).ConfigureAwait(false); } /// - /// Implements Gateway GET method. + /// Gets an Internet Gateway Rule resource. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName} /// /// /// Operation Id - /// InternetGateways_Get + /// InternetGatewayRules_Get /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// - /// Name of the Internet Gateway. + /// Name of the Internet Gateway rule. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetNetworkFabricInternetGateway(string internetGatewayName, CancellationToken cancellationToken = default) + public virtual Response GetNetworkFabricInternetGatewayRule(string internetGatewayRuleName, CancellationToken cancellationToken = default) { - return GetNetworkFabricInternetGateways().Get(internetGatewayName, cancellationToken); + return GetNetworkFabricInternetGatewayRules().Get(internetGatewayRuleName, cancellationToken); } - /// Gets a collection of NetworkFabricInternetGatewayRuleResources in the ResourceGroupResource. - /// An object representing collection of NetworkFabricInternetGatewayRuleResources and their operations over a NetworkFabricInternetGatewayRuleResource. - public virtual NetworkFabricInternetGatewayRuleCollection GetNetworkFabricInternetGatewayRules() + /// Gets a collection of NetworkFabricInternetGatewayResources in the ResourceGroupResource. + /// An object representing collection of NetworkFabricInternetGatewayResources and their operations over a NetworkFabricInternetGatewayResource. + public virtual NetworkFabricInternetGatewayCollection GetNetworkFabricInternetGateways() { - return GetCachedClient(client => new NetworkFabricInternetGatewayRuleCollection(client, Id)); + return GetCachedClient(client => new NetworkFabricInternetGatewayCollection(client, Id)); } /// - /// Gets an Internet Gateway Rule resource. + /// Implements Gateway GET method. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName} /// /// /// Operation Id - /// InternetGatewayRules_Get + /// InternetGateways_Get /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// - /// Name of the Internet Gateway rule. + /// Name of the Internet Gateway. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetNetworkFabricInternetGatewayRuleAsync(string internetGatewayRuleName, CancellationToken cancellationToken = default) + public virtual async Task> GetNetworkFabricInternetGatewayAsync(string internetGatewayName, CancellationToken cancellationToken = default) { - return await GetNetworkFabricInternetGatewayRules().GetAsync(internetGatewayRuleName, cancellationToken).ConfigureAwait(false); + return await GetNetworkFabricInternetGateways().GetAsync(internetGatewayName, cancellationToken).ConfigureAwait(false); } /// - /// Gets an Internet Gateway Rule resource. + /// Implements Gateway GET method. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName} /// /// /// Operation Id - /// InternetGatewayRules_Get + /// InternetGateways_Get /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// - /// Name of the Internet Gateway rule. + /// Name of the Internet Gateway. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetNetworkFabricInternetGatewayRule(string internetGatewayRuleName, CancellationToken cancellationToken = default) + public virtual Response GetNetworkFabricInternetGateway(string internetGatewayName, CancellationToken cancellationToken = default) { - return GetNetworkFabricInternetGatewayRules().Get(internetGatewayRuleName, cancellationToken); + return GetNetworkFabricInternetGateways().Get(internetGatewayName, cancellationToken); } /// Gets a collection of NetworkFabricIPCommunityResources in the ResourceGroupResource. @@ -260,7 +260,7 @@ public virtual NetworkFabricIPCommunityCollection GetNetworkFabricIPCommunities( /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -291,7 +291,7 @@ public virtual async Task> GetNetwork /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -329,7 +329,7 @@ public virtual NetworkFabricIPExtendedCommunityCollection GetNetworkFabricIPExte /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual NetworkFabricIPPrefixCollection GetNetworkFabricIPPrefixes() /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -429,7 +429,7 @@ public virtual async Task> GetNetworkFab /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -467,7 +467,7 @@ public virtual NetworkFabricL2IsolationDomainCollection GetNetworkFabricL2Isolat /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -498,7 +498,7 @@ public virtual async Task> GetN /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -536,7 +536,7 @@ public virtual NetworkFabricL3IsolationDomainCollection GetNetworkFabricL3Isolat /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -567,7 +567,7 @@ public virtual async Task> GetN /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -605,7 +605,7 @@ public virtual NetworkFabricNeighborGroupCollection GetNetworkFabricNeighborGrou /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -636,7 +636,7 @@ public virtual async Task> GetNetwo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -674,7 +674,7 @@ public virtual NetworkDeviceCollection GetNetworkDevices() /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -705,7 +705,7 @@ public virtual async Task> GetNetworkDeviceAsync /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -743,7 +743,7 @@ public virtual NetworkFabricControllerCollection GetNetworkFabricControllers() /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -774,7 +774,7 @@ public virtual async Task> GetNetworkF /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -812,7 +812,7 @@ public virtual NetworkFabricCollection GetNetworkFabrics() /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -843,7 +843,7 @@ public virtual async Task> GetNetworkFabricAsync /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -861,6 +861,75 @@ public virtual Response GetNetworkFabric(string networkFa return GetNetworkFabrics().Get(networkFabricName, cancellationToken); } + /// Gets a collection of NetworkMonitorResources in the ResourceGroupResource. + /// An object representing collection of NetworkMonitorResources and their operations over a NetworkMonitorResource. + public virtual NetworkMonitorCollection GetNetworkMonitors() + { + return GetCachedClient(client => new NetworkMonitorCollection(client, Id)); + } + + /// + /// Implements NetworkMonitor GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Network Monitor. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkMonitorAsync(string networkMonitorName, CancellationToken cancellationToken = default) + { + return await GetNetworkMonitors().GetAsync(networkMonitorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements NetworkMonitor GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Network Monitor. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkMonitor(string networkMonitorName, CancellationToken cancellationToken = default) + { + return GetNetworkMonitors().Get(networkMonitorName, cancellationToken); + } + /// Gets a collection of NetworkPacketBrokerResources in the ResourceGroupResource. /// An object representing collection of NetworkPacketBrokerResources and their operations over a NetworkPacketBrokerResource. public virtual NetworkPacketBrokerCollection GetNetworkPacketBrokers() @@ -881,7 +950,7 @@ public virtual NetworkPacketBrokerCollection GetNetworkPacketBrokers() /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -912,7 +981,7 @@ public virtual async Task> GetNetworkPacke /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -950,7 +1019,7 @@ public virtual NetworkRackCollection GetNetworkRacks() /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -981,7 +1050,7 @@ public virtual async Task> GetNetworkRackAsync(str /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1019,7 +1088,7 @@ public virtual NetworkTapRuleCollection GetNetworkTapRules() /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1050,7 +1119,7 @@ public virtual async Task> GetNetworkTapRuleAsy /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1088,7 +1157,7 @@ public virtual NetworkTapCollection GetNetworkTaps() /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1119,7 +1188,7 @@ public virtual async Task> GetNetworkTapAsync(strin /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1157,7 +1226,7 @@ public virtual NetworkFabricRoutePolicyCollection GetNetworkFabricRoutePolicies( /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1188,7 +1257,7 @@ public virtual async Task> GetNetwork /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/MockableManagedNetworkFabricSubscriptionResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/MockableManagedNetworkFabricSubscriptionResource.cs index 66a9da444fcc..c29db0c6f1b3 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/MockableManagedNetworkFabricSubscriptionResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/MockableManagedNetworkFabricSubscriptionResource.cs @@ -19,10 +19,10 @@ public partial class MockableManagedNetworkFabricSubscriptionResource : ArmResou { private ClientDiagnostics _networkFabricAccessControlListAccessControlListsClientDiagnostics; private AccessControlListsRestOperations _networkFabricAccessControlListAccessControlListsRestClient; - private ClientDiagnostics _networkFabricInternetGatewayInternetGatewaysClientDiagnostics; - private InternetGatewaysRestOperations _networkFabricInternetGatewayInternetGatewaysRestClient; private ClientDiagnostics _networkFabricInternetGatewayRuleInternetGatewayRulesClientDiagnostics; private InternetGatewayRulesRestOperations _networkFabricInternetGatewayRuleInternetGatewayRulesRestClient; + private ClientDiagnostics _networkFabricInternetGatewayInternetGatewaysClientDiagnostics; + private InternetGatewaysRestOperations _networkFabricInternetGatewayInternetGatewaysRestClient; private ClientDiagnostics _networkFabricIPCommunityIPCommunitiesClientDiagnostics; private IpCommunitiesRestOperations _networkFabricIPCommunityIPCommunitiesRestClient; private ClientDiagnostics _networkFabricIPExtendedCommunityIPExtendedCommunitiesClientDiagnostics; @@ -41,6 +41,8 @@ public partial class MockableManagedNetworkFabricSubscriptionResource : ArmResou private NetworkFabricControllersRestOperations _networkFabricControllerRestClient; private ClientDiagnostics _networkFabricClientDiagnostics; private NetworkFabricsRestOperations _networkFabricRestClient; + private ClientDiagnostics _networkMonitorClientDiagnostics; + private NetworkMonitorsRestOperations _networkMonitorRestClient; private ClientDiagnostics _networkPacketBrokerClientDiagnostics; private NetworkPacketBrokersRestOperations _networkPacketBrokerRestClient; private ClientDiagnostics _networkRackClientDiagnostics; @@ -66,10 +68,10 @@ internal MockableManagedNetworkFabricSubscriptionResource(ArmClient client, Reso private ClientDiagnostics NetworkFabricAccessControlListAccessControlListsClientDiagnostics => _networkFabricAccessControlListAccessControlListsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ManagedNetworkFabric", NetworkFabricAccessControlListResource.ResourceType.Namespace, Diagnostics); private AccessControlListsRestOperations NetworkFabricAccessControlListAccessControlListsRestClient => _networkFabricAccessControlListAccessControlListsRestClient ??= new AccessControlListsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(NetworkFabricAccessControlListResource.ResourceType)); - private ClientDiagnostics NetworkFabricInternetGatewayInternetGatewaysClientDiagnostics => _networkFabricInternetGatewayInternetGatewaysClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ManagedNetworkFabric", NetworkFabricInternetGatewayResource.ResourceType.Namespace, Diagnostics); - private InternetGatewaysRestOperations NetworkFabricInternetGatewayInternetGatewaysRestClient => _networkFabricInternetGatewayInternetGatewaysRestClient ??= new InternetGatewaysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(NetworkFabricInternetGatewayResource.ResourceType)); private ClientDiagnostics NetworkFabricInternetGatewayRuleInternetGatewayRulesClientDiagnostics => _networkFabricInternetGatewayRuleInternetGatewayRulesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ManagedNetworkFabric", NetworkFabricInternetGatewayRuleResource.ResourceType.Namespace, Diagnostics); private InternetGatewayRulesRestOperations NetworkFabricInternetGatewayRuleInternetGatewayRulesRestClient => _networkFabricInternetGatewayRuleInternetGatewayRulesRestClient ??= new InternetGatewayRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(NetworkFabricInternetGatewayRuleResource.ResourceType)); + private ClientDiagnostics NetworkFabricInternetGatewayInternetGatewaysClientDiagnostics => _networkFabricInternetGatewayInternetGatewaysClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ManagedNetworkFabric", NetworkFabricInternetGatewayResource.ResourceType.Namespace, Diagnostics); + private InternetGatewaysRestOperations NetworkFabricInternetGatewayInternetGatewaysRestClient => _networkFabricInternetGatewayInternetGatewaysRestClient ??= new InternetGatewaysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(NetworkFabricInternetGatewayResource.ResourceType)); private ClientDiagnostics NetworkFabricIPCommunityIpCommunitiesClientDiagnostics => _networkFabricIPCommunityIPCommunitiesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ManagedNetworkFabric", NetworkFabricIPCommunityResource.ResourceType.Namespace, Diagnostics); private IpCommunitiesRestOperations NetworkFabricIPCommunityIpCommunitiesRestClient => _networkFabricIPCommunityIPCommunitiesRestClient ??= new IpCommunitiesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(NetworkFabricIPCommunityResource.ResourceType)); private ClientDiagnostics NetworkFabricIPExtendedCommunityIpExtendedCommunitiesClientDiagnostics => _networkFabricIPExtendedCommunityIPExtendedCommunitiesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ManagedNetworkFabric", NetworkFabricIPExtendedCommunityResource.ResourceType.Namespace, Diagnostics); @@ -88,6 +90,8 @@ internal MockableManagedNetworkFabricSubscriptionResource(ArmClient client, Reso private NetworkFabricControllersRestOperations NetworkFabricControllerRestClient => _networkFabricControllerRestClient ??= new NetworkFabricControllersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(NetworkFabricControllerResource.ResourceType)); private ClientDiagnostics NetworkFabricClientDiagnostics => _networkFabricClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ManagedNetworkFabric", NetworkFabricResource.ResourceType.Namespace, Diagnostics); private NetworkFabricsRestOperations NetworkFabricRestClient => _networkFabricRestClient ??= new NetworkFabricsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(NetworkFabricResource.ResourceType)); + private ClientDiagnostics NetworkMonitorClientDiagnostics => _networkMonitorClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ManagedNetworkFabric", NetworkMonitorResource.ResourceType.Namespace, Diagnostics); + private NetworkMonitorsRestOperations NetworkMonitorRestClient => _networkMonitorRestClient ??= new NetworkMonitorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(NetworkMonitorResource.ResourceType)); private ClientDiagnostics NetworkPacketBrokerClientDiagnostics => _networkPacketBrokerClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ManagedNetworkFabric", NetworkPacketBrokerResource.ResourceType.Namespace, Diagnostics); private NetworkPacketBrokersRestOperations NetworkPacketBrokerRestClient => _networkPacketBrokerRestClient ??= new NetworkPacketBrokersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(NetworkPacketBrokerResource.ResourceType)); private ClientDiagnostics NetworkRackClientDiagnostics => _networkRackClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ManagedNetworkFabric", NetworkRackResource.ResourceType.Namespace, Diagnostics); @@ -125,7 +129,7 @@ public virtual NetworkDeviceSkuCollection GetNetworkDeviceSkus() /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -156,7 +160,7 @@ public virtual async Task> GetNetworkDeviceSk /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -194,7 +198,7 @@ public virtual NetworkFabricSkuCollection GetNetworkFabricSkus() /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -225,7 +229,7 @@ public virtual async Task> GetNetworkFabricSk /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -256,7 +260,7 @@ public virtual Response GetNetworkFabricSku(string net /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -286,7 +290,7 @@ public virtual AsyncPageable GetNetworkF /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -304,123 +308,123 @@ public virtual Pageable GetNetworkFabric } /// - /// Displays Internet Gateways list by subscription GET method. + /// List all Internet Gateway rules in the given subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGateways + /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules /// /// /// Operation Id - /// InternetGateways_ListBySubscription + /// InternetGatewayRules_ListBySubscription /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetNetworkFabricInternetGatewaysAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetNetworkFabricInternetGatewayRulesAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricInternetGatewayInternetGatewaysRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricInternetGatewayInternetGatewaysRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricInternetGatewayResource(Client, NetworkFabricInternetGatewayData.DeserializeNetworkFabricInternetGatewayData(e)), NetworkFabricInternetGatewayInternetGatewaysClientDiagnostics, Pipeline, "MockableManagedNetworkFabricSubscriptionResource.GetNetworkFabricInternetGateways", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricInternetGatewayRuleInternetGatewayRulesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricInternetGatewayRuleInternetGatewayRulesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricInternetGatewayRuleResource(Client, NetworkFabricInternetGatewayRuleData.DeserializeNetworkFabricInternetGatewayRuleData(e)), NetworkFabricInternetGatewayRuleInternetGatewayRulesClientDiagnostics, Pipeline, "MockableManagedNetworkFabricSubscriptionResource.GetNetworkFabricInternetGatewayRules", "value", "nextLink", cancellationToken); } /// - /// Displays Internet Gateways list by subscription GET method. + /// List all Internet Gateway rules in the given subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGateways + /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules /// /// /// Operation Id - /// InternetGateways_ListBySubscription + /// InternetGatewayRules_ListBySubscription /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetNetworkFabricInternetGateways(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetNetworkFabricInternetGatewayRules(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricInternetGatewayInternetGatewaysRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricInternetGatewayInternetGatewaysRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricInternetGatewayResource(Client, NetworkFabricInternetGatewayData.DeserializeNetworkFabricInternetGatewayData(e)), NetworkFabricInternetGatewayInternetGatewaysClientDiagnostics, Pipeline, "MockableManagedNetworkFabricSubscriptionResource.GetNetworkFabricInternetGateways", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricInternetGatewayRuleInternetGatewayRulesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricInternetGatewayRuleInternetGatewayRulesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricInternetGatewayRuleResource(Client, NetworkFabricInternetGatewayRuleData.DeserializeNetworkFabricInternetGatewayRuleData(e)), NetworkFabricInternetGatewayRuleInternetGatewayRulesClientDiagnostics, Pipeline, "MockableManagedNetworkFabricSubscriptionResource.GetNetworkFabricInternetGatewayRules", "value", "nextLink", cancellationToken); } /// - /// List all Internet Gateway rules in the given subscription. + /// Displays Internet Gateways list by subscription GET method. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules + /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGateways /// /// /// Operation Id - /// InternetGatewayRules_ListBySubscription + /// InternetGateways_ListBySubscription /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetNetworkFabricInternetGatewayRulesAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetNetworkFabricInternetGatewaysAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricInternetGatewayRuleInternetGatewayRulesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricInternetGatewayRuleInternetGatewayRulesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricInternetGatewayRuleResource(Client, NetworkFabricInternetGatewayRuleData.DeserializeNetworkFabricInternetGatewayRuleData(e)), NetworkFabricInternetGatewayRuleInternetGatewayRulesClientDiagnostics, Pipeline, "MockableManagedNetworkFabricSubscriptionResource.GetNetworkFabricInternetGatewayRules", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricInternetGatewayInternetGatewaysRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricInternetGatewayInternetGatewaysRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricInternetGatewayResource(Client, NetworkFabricInternetGatewayData.DeserializeNetworkFabricInternetGatewayData(e)), NetworkFabricInternetGatewayInternetGatewaysClientDiagnostics, Pipeline, "MockableManagedNetworkFabricSubscriptionResource.GetNetworkFabricInternetGateways", "value", "nextLink", cancellationToken); } /// - /// List all Internet Gateway rules in the given subscription. + /// Displays Internet Gateways list by subscription GET method. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules + /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGateways /// /// /// Operation Id - /// InternetGatewayRules_ListBySubscription + /// InternetGateways_ListBySubscription /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetNetworkFabricInternetGatewayRules(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetNetworkFabricInternetGateways(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricInternetGatewayRuleInternetGatewayRulesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricInternetGatewayRuleInternetGatewayRulesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricInternetGatewayRuleResource(Client, NetworkFabricInternetGatewayRuleData.DeserializeNetworkFabricInternetGatewayRuleData(e)), NetworkFabricInternetGatewayRuleInternetGatewayRulesClientDiagnostics, Pipeline, "MockableManagedNetworkFabricSubscriptionResource.GetNetworkFabricInternetGatewayRules", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricInternetGatewayInternetGatewaysRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricInternetGatewayInternetGatewaysRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricInternetGatewayResource(Client, NetworkFabricInternetGatewayData.DeserializeNetworkFabricInternetGatewayData(e)), NetworkFabricInternetGatewayInternetGatewaysClientDiagnostics, Pipeline, "MockableManagedNetworkFabricSubscriptionResource.GetNetworkFabricInternetGateways", "value", "nextLink", cancellationToken); } /// @@ -436,7 +440,7 @@ public virtual Pageable GetNetworkFabr /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -466,7 +470,7 @@ public virtual AsyncPageable GetNetworkFabricI /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -496,7 +500,7 @@ public virtual Pageable GetNetworkFabricIPComm /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -526,7 +530,7 @@ public virtual AsyncPageable GetNetwor /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -556,7 +560,7 @@ public virtual Pageable GetNetworkFabr /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -586,7 +590,7 @@ public virtual AsyncPageable GetNetworkFabricIPPr /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -616,7 +620,7 @@ public virtual Pageable GetNetworkFabricIPPrefixe /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -646,7 +650,7 @@ public virtual AsyncPageable GetNetworkF /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -676,7 +680,7 @@ public virtual Pageable GetNetworkFabric /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -706,7 +710,7 @@ public virtual AsyncPageable GetNetworkF /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -736,7 +740,7 @@ public virtual Pageable GetNetworkFabric /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -766,7 +770,7 @@ public virtual AsyncPageable GetNetworkFabri /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -796,7 +800,7 @@ public virtual Pageable GetNetworkFabricNeig /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -826,7 +830,7 @@ public virtual AsyncPageable GetNetworkDevicesAsync(Cance /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -856,7 +860,7 @@ public virtual Pageable GetNetworkDevices(CancellationTok /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -886,7 +890,7 @@ public virtual AsyncPageable GetNetworkFabricCo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -916,7 +920,7 @@ public virtual Pageable GetNetworkFabricControl /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -946,7 +950,7 @@ public virtual AsyncPageable GetNetworkFabricsAsync(Cance /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -963,6 +967,66 @@ public virtual Pageable GetNetworkFabrics(CancellationTok return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricResource(Client, NetworkFabricData.DeserializeNetworkFabricData(e)), NetworkFabricClientDiagnostics, Pipeline, "MockableManagedNetworkFabricSubscriptionResource.GetNetworkFabrics", "value", "nextLink", cancellationToken); } + /// + /// Displays NetworkMonitors list by subscription GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkMonitors + /// + /// + /// Operation Id + /// NetworkMonitors_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetNetworkMonitorsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkMonitorRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkMonitorRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkMonitorResource(Client, NetworkMonitorData.DeserializeNetworkMonitorData(e)), NetworkMonitorClientDiagnostics, Pipeline, "MockableManagedNetworkFabricSubscriptionResource.GetNetworkMonitors", "value", "nextLink", cancellationToken); + } + + /// + /// Displays NetworkMonitors list by subscription GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkMonitors + /// + /// + /// Operation Id + /// NetworkMonitors_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetNetworkMonitors(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkMonitorRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkMonitorRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkMonitorResource(Client, NetworkMonitorData.DeserializeNetworkMonitorData(e)), NetworkMonitorClientDiagnostics, Pipeline, "MockableManagedNetworkFabricSubscriptionResource.GetNetworkMonitors", "value", "nextLink", cancellationToken); + } + /// /// Displays Network Packet Brokers list by subscription GET method. /// @@ -976,7 +1040,7 @@ public virtual Pageable GetNetworkFabrics(CancellationTok /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1006,7 +1070,7 @@ public virtual AsyncPageable GetNetworkPacketBroker /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1036,7 +1100,7 @@ public virtual Pageable GetNetworkPacketBrokers(Can /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1066,7 +1130,7 @@ public virtual AsyncPageable GetNetworkRacksAsync(Cancellat /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1096,7 +1160,7 @@ public virtual Pageable GetNetworkRacks(CancellationToken c /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1126,7 +1190,7 @@ public virtual AsyncPageable GetNetworkTapRulesAsync(Can /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1156,7 +1220,7 @@ public virtual Pageable GetNetworkTapRules(CancellationT /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1186,7 +1250,7 @@ public virtual AsyncPageable GetNetworkTapsAsync(Cancellatio /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1216,7 +1280,7 @@ public virtual Pageable GetNetworkTaps(CancellationToken can /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1246,7 +1310,7 @@ public virtual AsyncPageable GetNetworkFabricR /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/ArmConfigurationDiffResultOperationSource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/ArmConfigurationDiffResultOperationSource.cs new file mode 100644 index 000000000000..14c993f0422a --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/ArmConfigurationDiffResultOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.ManagedNetworkFabric.Models; + +namespace Azure.ResourceManager.ManagedNetworkFabric +{ + internal class ArmConfigurationDiffResultOperationSource : IOperationSource + { + ArmConfigurationDiffResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return ArmConfigurationDiffResult.DeserializeArmConfigurationDiffResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return ArmConfigurationDiffResult.DeserializeArmConfigurationDiffResult(document.RootElement); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/CommitBatchStatusResultOperationSource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/CommitBatchStatusResultOperationSource.cs new file mode 100644 index 000000000000..850c4f236f09 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/CommitBatchStatusResultOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.ManagedNetworkFabric.Models; + +namespace Azure.ResourceManager.ManagedNetworkFabric +{ + internal class CommitBatchStatusResultOperationSource : IOperationSource + { + CommitBatchStatusResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return CommitBatchStatusResult.DeserializeCommitBatchStatusResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return CommitBatchStatusResult.DeserializeCommitBatchStatusResult(document.RootElement); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/CommonPostActionResponseForDeviceROCommandsOperationStatusResultOperationSource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/CommonPostActionResponseForDeviceROCommandsOperationStatusResultOperationSource.cs new file mode 100644 index 000000000000..47d0e457babd --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/CommonPostActionResponseForDeviceROCommandsOperationStatusResultOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.ManagedNetworkFabric.Models; + +namespace Azure.ResourceManager.ManagedNetworkFabric +{ + internal class CommonPostActionResponseForDeviceROCommandsOperationStatusResultOperationSource : IOperationSource + { + CommonPostActionResponseForDeviceROCommandsOperationStatusResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return CommonPostActionResponseForDeviceROCommandsOperationStatusResult.DeserializeCommonPostActionResponseForDeviceROCommandsOperationStatusResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return CommonPostActionResponseForDeviceROCommandsOperationStatusResult.DeserializeCommonPostActionResponseForDeviceROCommandsOperationStatusResult(document.RootElement); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/CommonPostActionResponseForDeviceRWCommandsOperationSource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/CommonPostActionResponseForDeviceRWCommandsOperationSource.cs new file mode 100644 index 000000000000..7138e8169b4f --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/CommonPostActionResponseForDeviceRWCommandsOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.ManagedNetworkFabric.Models; + +namespace Azure.ResourceManager.ManagedNetworkFabric +{ + internal class CommonPostActionResponseForDeviceRWCommandsOperationSource : IOperationSource + { + CommonPostActionResponseForDeviceRWCommands IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return CommonPostActionResponseForDeviceRWCommands.DeserializeCommonPostActionResponseForDeviceRWCommands(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return CommonPostActionResponseForDeviceRWCommands.DeserializeCommonPostActionResponseForDeviceRWCommands(document.RootElement); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/DiscardCommitBatchResultOperationSource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/DiscardCommitBatchResultOperationSource.cs new file mode 100644 index 000000000000..04be07f62a80 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/DiscardCommitBatchResultOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.ManagedNetworkFabric.Models; + +namespace Azure.ResourceManager.ManagedNetworkFabric +{ + internal class DiscardCommitBatchResultOperationSource : IOperationSource + { + DiscardCommitBatchResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return DiscardCommitBatchResult.DeserializeDiscardCommitBatchResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return DiscardCommitBatchResult.DeserializeDiscardCommitBatchResult(document.RootElement); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/ExternalNetworkBfdAdministrativeStateResultOperationSource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/ExternalNetworkBfdAdministrativeStateResultOperationSource.cs new file mode 100644 index 000000000000..95244752cd86 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/ExternalNetworkBfdAdministrativeStateResultOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.ManagedNetworkFabric.Models; + +namespace Azure.ResourceManager.ManagedNetworkFabric +{ + internal class ExternalNetworkBfdAdministrativeStateResultOperationSource : IOperationSource + { + ExternalNetworkBfdAdministrativeStateResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return ExternalNetworkBfdAdministrativeStateResult.DeserializeExternalNetworkBfdAdministrativeStateResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return ExternalNetworkBfdAdministrativeStateResult.DeserializeExternalNetworkBfdAdministrativeStateResult(document.RootElement); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/InternalNetworkBfdAdministrativeStateResultOperationSource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/InternalNetworkBfdAdministrativeStateResultOperationSource.cs new file mode 100644 index 000000000000..97c5d25f627a --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/InternalNetworkBfdAdministrativeStateResultOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.ManagedNetworkFabric.Models; + +namespace Azure.ResourceManager.ManagedNetworkFabric +{ + internal class InternalNetworkBfdAdministrativeStateResultOperationSource : IOperationSource + { + InternalNetworkBfdAdministrativeStateResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return InternalNetworkBfdAdministrativeStateResult.DeserializeInternalNetworkBfdAdministrativeStateResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return InternalNetworkBfdAdministrativeStateResult.DeserializeInternalNetworkBfdAdministrativeStateResult(document.RootElement); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/InternalNetworkBgpAdministrativeStateResultOperationSource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/InternalNetworkBgpAdministrativeStateResultOperationSource.cs new file mode 100644 index 000000000000..b77074693044 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/InternalNetworkBgpAdministrativeStateResultOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.ManagedNetworkFabric.Models; + +namespace Azure.ResourceManager.ManagedNetworkFabric +{ + internal class InternalNetworkBgpAdministrativeStateResultOperationSource : IOperationSource + { + InternalNetworkBgpAdministrativeStateResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return InternalNetworkBgpAdministrativeStateResult.DeserializeInternalNetworkBgpAdministrativeStateResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return InternalNetworkBgpAdministrativeStateResult.DeserializeInternalNetworkBgpAdministrativeStateResult(document.RootElement); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/NetworkMonitorOperationSource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/NetworkMonitorOperationSource.cs new file mode 100644 index 000000000000..b037088ce0c0 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/NetworkMonitorOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric +{ + internal class NetworkMonitorOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal NetworkMonitorOperationSource(ArmClient client) + { + _client = client; + } + + NetworkMonitorResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerManagedNetworkFabricContext.Default); + return new NetworkMonitorResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerManagedNetworkFabricContext.Default); + return await Task.FromResult(new NetworkMonitorResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/NniBfdAdministrativeStateResultOperationSource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/NniBfdAdministrativeStateResultOperationSource.cs new file mode 100644 index 000000000000..7f36346dd7c8 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/NniBfdAdministrativeStateResultOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.ManagedNetworkFabric.Models; + +namespace Azure.ResourceManager.ManagedNetworkFabric +{ + internal class NniBfdAdministrativeStateResultOperationSource : IOperationSource + { + NniBfdAdministrativeStateResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return NniBfdAdministrativeStateResult.DeserializeNniBfdAdministrativeStateResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return NniBfdAdministrativeStateResult.DeserializeNniBfdAdministrativeStateResult(document.RootElement); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/ViewDeviceConfigurationResultOperationSource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/ViewDeviceConfigurationResultOperationSource.cs new file mode 100644 index 000000000000..91ed0875bd0a --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/LongRunningOperation/ViewDeviceConfigurationResultOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.ManagedNetworkFabric.Models; + +namespace Azure.ResourceManager.ManagedNetworkFabric +{ + internal class ViewDeviceConfigurationResultOperationSource : IOperationSource + { + ViewDeviceConfigurationResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return ViewDeviceConfigurationResult.DeserializeViewDeviceConfigurationResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return ViewDeviceConfigurationResult.DeserializeViewDeviceConfigurationResult(document.RootElement); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListAction.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListAction.Serialization.cs index e6c38262b393..93e52f836018 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListAction.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListAction.Serialization.cs @@ -44,6 +44,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("counterName"u8); writer.WriteStringValue(CounterName); } + if (Optional.IsDefined(RemarkComment)) + { + writer.WritePropertyName("remarkComment"u8); + writer.WriteStringValue(RemarkComment); + } + if (Optional.IsDefined(PoliceRateConfiguration)) + { + writer.WritePropertyName("policeRateConfiguration"u8); + writer.WriteObjectValue(PoliceRateConfiguration, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -83,6 +93,8 @@ internal static AccessControlListAction DeserializeAccessControlListAction(JsonE } AclActionType? type = default; string counterName = default; + string remarkComment = default; + PoliceRateConfigurationProperties policeRateConfiguration = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -101,13 +113,27 @@ internal static AccessControlListAction DeserializeAccessControlListAction(JsonE counterName = property.Value.GetString(); continue; } + if (property.NameEquals("remarkComment"u8)) + { + remarkComment = property.Value.GetString(); + continue; + } + if (property.NameEquals("policeRateConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + policeRateConfiguration = PoliceRateConfigurationProperties.DeserializePoliceRateConfigurationProperties(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new AccessControlListAction(type, counterName, serializedAdditionalRawData); + return new AccessControlListAction(type, counterName, remarkComment, policeRateConfiguration, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListAction.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListAction.cs index 1357c0217779..677599f9b22a 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListAction.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListAction.cs @@ -53,11 +53,15 @@ public AccessControlListAction() /// Initializes a new instance of . /// Type of actions that can be performed. /// Name of the counter block to get match count information. + /// Remark comment. + /// Police rate configuration. /// Keeps track of any properties unknown to the library. - internal AccessControlListAction(AclActionType? aclActionType, string counterName, IDictionary serializedAdditionalRawData) + internal AccessControlListAction(AclActionType? aclActionType, string counterName, string remarkComment, PoliceRateConfigurationProperties policeRateConfiguration, IDictionary serializedAdditionalRawData) { AclActionType = aclActionType; CounterName = counterName; + RemarkComment = remarkComment; + PoliceRateConfiguration = policeRateConfiguration; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -65,5 +69,9 @@ internal AccessControlListAction(AclActionType? aclActionType, string counterNam public AclActionType? AclActionType { get; set; } /// Name of the counter block to get match count information. public string CounterName { get; set; } + /// Remark comment. + public string RemarkComment { get; set; } + /// Police rate configuration. + public PoliceRateConfigurationProperties PoliceRateConfiguration { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListActionPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListActionPatch.Serialization.cs new file mode 100644 index 000000000000..96d653ac3a26 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListActionPatch.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class AccessControlListActionPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccessControlListActionPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AclActionType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(AclActionType.Value.ToString()); + } + if (Optional.IsDefined(CounterName)) + { + writer.WritePropertyName("counterName"u8); + writer.WriteStringValue(CounterName); + } + if (Optional.IsDefined(RemarkComment)) + { + writer.WritePropertyName("remarkComment"u8); + writer.WriteStringValue(RemarkComment); + } + if (Optional.IsDefined(PoliceRateConfiguration)) + { + writer.WritePropertyName("policeRateConfiguration"u8); + writer.WriteObjectValue(PoliceRateConfiguration, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AccessControlListActionPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccessControlListActionPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccessControlListActionPatch(document.RootElement, options); + } + + internal static AccessControlListActionPatch DeserializeAccessControlListActionPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AclActionType? type = default; + string counterName = default; + string remarkComment = default; + PoliceRateConfigurationProperties policeRateConfiguration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new AclActionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("counterName"u8)) + { + counterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("remarkComment"u8)) + { + remarkComment = property.Value.GetString(); + continue; + } + if (property.NameEquals("policeRateConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + policeRateConfiguration = PoliceRateConfigurationProperties.DeserializePoliceRateConfigurationProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccessControlListActionPatch(type, counterName, remarkComment, policeRateConfiguration, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(AccessControlListActionPatch)} does not support writing '{options.Format}' format."); + } + } + + AccessControlListActionPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAccessControlListActionPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccessControlListActionPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListActionPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListActionPatch.cs new file mode 100644 index 000000000000..38b0e23f4ec3 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListActionPatch.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Action that need to be performed. + public partial class AccessControlListActionPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AccessControlListActionPatch() + { + } + + /// Initializes a new instance of . + /// Type of actions that can be performed. + /// Name of the counter block to get match count information. + /// Remark comment. + /// Police rate configuration. + /// Keeps track of any properties unknown to the library. + internal AccessControlListActionPatch(AclActionType? aclActionType, string counterName, string remarkComment, PoliceRateConfigurationProperties policeRateConfiguration, IDictionary serializedAdditionalRawData) + { + AclActionType = aclActionType; + CounterName = counterName; + RemarkComment = remarkComment; + PoliceRateConfiguration = policeRateConfiguration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Type of actions that can be performed. + public AclActionType? AclActionType { get; set; } + /// Name of the counter block to get match count information. + public string CounterName { get; set; } + /// Remark comment. + public string RemarkComment { get; set; } + /// Police rate configuration. + public PoliceRateConfigurationProperties PoliceRateConfiguration { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchCondition.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchCondition.Serialization.cs index 63c28e91c109..3ac54cb808f6 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchCondition.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchCondition.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,7 +34,26 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(AccessControlListMatchCondition)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(ProtocolTypes)) + { + writer.WritePropertyName("protocolTypes"u8); + writer.WriteStartArray(); + foreach (var item in ProtocolTypes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(VlanMatchCondition)) + { + writer.WritePropertyName("vlanMatchCondition"u8); + writer.WriteObjectValue(VlanMatchCondition, options); + } + if (Optional.IsDefined(IPCondition)) + { + writer.WritePropertyName("ipCondition"u8); + writer.WriteObjectValue(IPCondition, options); + } if (Optional.IsCollectionDefined(EtherTypes)) { writer.WritePropertyName("etherTypes"u8); @@ -85,11 +104,41 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + if (Optional.IsCollectionDefined(ProtocolNeighbors)) + { + writer.WritePropertyName("protocolNeighbors"u8); + writer.WriteStartArray(); + foreach (var item in ProtocolNeighbors) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(PortCondition)) { writer.WritePropertyName("portCondition"u8); writer.WriteObjectValue(PortCondition, options); } + if (Optional.IsDefined(IcmpConfiguration)) + { + writer.WritePropertyName("icmpConfiguration"u8); + writer.WriteObjectValue(IcmpConfiguration, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } AccessControlListMatchCondition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -112,19 +161,53 @@ internal static AccessControlListMatchCondition DeserializeAccessControlListMatc { return null; } + IList protocolTypes = default; + VlanMatchCondition vlanMatchCondition = default; + IPMatchCondition ipCondition = default; IList etherTypes = default; IList fragments = default; IList ipLengths = default; IList ttlValues = default; IList dscpMarkings = default; + IList protocolNeighbors = default; AccessControlListPortCondition portCondition = default; - IList protocolTypes = default; - VlanMatchCondition vlanMatchCondition = default; - IPMatchCondition ipCondition = default; + IcmpConfigurationProperties icmpConfiguration = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("protocolTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + protocolTypes = array; + continue; + } + if (property.NameEquals("vlanMatchCondition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vlanMatchCondition = VlanMatchCondition.DeserializeVlanMatchCondition(property.Value, options); + continue; + } + if (property.NameEquals("ipCondition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ipCondition = IPMatchCondition.DeserializeIPMatchCondition(property.Value, options); + continue; + } if (property.NameEquals("etherTypes"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -195,16 +278,7 @@ internal static AccessControlListMatchCondition DeserializeAccessControlListMatc dscpMarkings = array; continue; } - if (property.NameEquals("portCondition"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - portCondition = AccessControlListPortCondition.DeserializeAccessControlListPortCondition(property.Value, options); - continue; - } - if (property.NameEquals("protocolTypes"u8)) + if (property.NameEquals("protocolNeighbors"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { @@ -215,25 +289,25 @@ internal static AccessControlListMatchCondition DeserializeAccessControlListMatc { array.Add(item.GetString()); } - protocolTypes = array; + protocolNeighbors = array; continue; } - if (property.NameEquals("vlanMatchCondition"u8)) + if (property.NameEquals("portCondition"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - vlanMatchCondition = VlanMatchCondition.DeserializeVlanMatchCondition(property.Value, options); + portCondition = AccessControlListPortCondition.DeserializeAccessControlListPortCondition(property.Value, options); continue; } - if (property.NameEquals("ipCondition"u8)) + if (property.NameEquals("icmpConfiguration"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - ipCondition = IPMatchCondition.DeserializeIPMatchCondition(property.Value, options); + icmpConfiguration = IcmpConfigurationProperties.DeserializeIcmpConfigurationProperties(property.Value, options); continue; } if (options.Format != "W") @@ -246,13 +320,15 @@ internal static AccessControlListMatchCondition DeserializeAccessControlListMatc protocolTypes ?? new ChangeTrackingList(), vlanMatchCondition, ipCondition, - serializedAdditionalRawData, etherTypes ?? new ChangeTrackingList(), fragments ?? new ChangeTrackingList(), ipLengths ?? new ChangeTrackingList(), ttlValues ?? new ChangeTrackingList(), dscpMarkings ?? new ChangeTrackingList(), - portCondition); + protocolNeighbors ?? new ChangeTrackingList(), + portCondition, + icmpConfiguration, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchCondition.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchCondition.cs index 7b426dd2eec6..0d156f3f034a 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchCondition.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchCondition.cs @@ -11,39 +11,87 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// Defines the match condition that is supported to filter the traffic. - public partial class AccessControlListMatchCondition : CommonMatchConditions + public partial class AccessControlListMatchCondition { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public AccessControlListMatchCondition() { + ProtocolTypes = new ChangeTrackingList(); EtherTypes = new ChangeTrackingList(); Fragments = new ChangeTrackingList(); IPLengths = new ChangeTrackingList(); TtlValues = new ChangeTrackingList(); DscpMarkings = new ChangeTrackingList(); + ProtocolNeighbors = new ChangeTrackingList(); } /// Initializes a new instance of . /// List of the protocols that need to be matched. /// Vlan match condition that needs to be matched. /// IP condition that needs to be matched. - /// Keeps track of any properties unknown to the library. /// List of ether type values that need to be matched. /// List of IP fragment packets that need to be matched. /// List of IP Lengths that need to be matched. /// List of TTL [Time To Live] values that need to be matched. /// List of DSCP Markings that need to be matched. + /// Protocol neighbors that need to be matched. /// Defines the port condition that needs to be matched. - internal AccessControlListMatchCondition(IList protocolTypes, VlanMatchCondition vlanMatchCondition, IPMatchCondition ipCondition, IDictionary serializedAdditionalRawData, IList etherTypes, IList fragments, IList ipLengths, IList ttlValues, IList dscpMarkings, AccessControlListPortCondition portCondition) : base(protocolTypes, vlanMatchCondition, ipCondition, serializedAdditionalRawData) + /// Internet Control Message Protocol (ICMP) configuration. + /// Keeps track of any properties unknown to the library. + internal AccessControlListMatchCondition(IList protocolTypes, VlanMatchCondition vlanMatchCondition, IPMatchCondition ipCondition, IList etherTypes, IList fragments, IList ipLengths, IList ttlValues, IList dscpMarkings, IList protocolNeighbors, AccessControlListPortCondition portCondition, IcmpConfigurationProperties icmpConfiguration, IDictionary serializedAdditionalRawData) { + ProtocolTypes = protocolTypes; + VlanMatchCondition = vlanMatchCondition; + IPCondition = ipCondition; EtherTypes = etherTypes; Fragments = fragments; IPLengths = ipLengths; TtlValues = ttlValues; DscpMarkings = dscpMarkings; + ProtocolNeighbors = protocolNeighbors; PortCondition = portCondition; + IcmpConfiguration = icmpConfiguration; + _serializedAdditionalRawData = serializedAdditionalRawData; } + /// List of the protocols that need to be matched. + public IList ProtocolTypes { get; } + /// Vlan match condition that needs to be matched. + public VlanMatchCondition VlanMatchCondition { get; set; } + /// IP condition that needs to be matched. + public IPMatchCondition IPCondition { get; set; } /// List of ether type values that need to be matched. public IList EtherTypes { get; } /// List of IP fragment packets that need to be matched. @@ -54,7 +102,21 @@ internal AccessControlListMatchCondition(IList protocolTypes, VlanMatchC public IList TtlValues { get; } /// List of DSCP Markings that need to be matched. public IList DscpMarkings { get; } + /// Protocol neighbors that need to be matched. + public IList ProtocolNeighbors { get; } /// Defines the port condition that needs to be matched. public AccessControlListPortCondition PortCondition { get; set; } + /// Internet Control Message Protocol (ICMP) configuration. + internal IcmpConfigurationProperties IcmpConfiguration { get; set; } + /// Internet Control Message Protocol (ICMP) types. + public IList IcmpTypes + { + get + { + if (IcmpConfiguration is null) + IcmpConfiguration = new IcmpConfigurationProperties(); + return IcmpConfiguration.IcmpTypes; + } + } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchConditionPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchConditionPatch.Serialization.cs new file mode 100644 index 000000000000..4e660d44883c --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchConditionPatch.Serialization.cs @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class AccessControlListMatchConditionPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccessControlListMatchConditionPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(ProtocolTypes)) + { + writer.WritePropertyName("protocolTypes"u8); + writer.WriteStartArray(); + foreach (var item in ProtocolTypes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(VlanMatchCondition)) + { + writer.WritePropertyName("vlanMatchCondition"u8); + writer.WriteObjectValue(VlanMatchCondition, options); + } + if (Optional.IsDefined(IPCondition)) + { + writer.WritePropertyName("ipCondition"u8); + writer.WriteObjectValue(IPCondition, options); + } + if (Optional.IsCollectionDefined(EtherTypes)) + { + writer.WritePropertyName("etherTypes"u8); + writer.WriteStartArray(); + foreach (var item in EtherTypes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Fragments)) + { + writer.WritePropertyName("fragments"u8); + writer.WriteStartArray(); + foreach (var item in Fragments) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(IPLengths)) + { + writer.WritePropertyName("ipLengths"u8); + writer.WriteStartArray(); + foreach (var item in IPLengths) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(TtlValues)) + { + writer.WritePropertyName("ttlValues"u8); + writer.WriteStartArray(); + foreach (var item in TtlValues) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(DscpMarkings)) + { + writer.WritePropertyName("dscpMarkings"u8); + writer.WriteStartArray(); + foreach (var item in DscpMarkings) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PortCondition)) + { + writer.WritePropertyName("portCondition"u8); + writer.WriteObjectValue(PortCondition, options); + } + if (Optional.IsCollectionDefined(ProtocolNeighbors)) + { + writer.WritePropertyName("protocolNeighbors"u8); + writer.WriteStartArray(); + foreach (var item in ProtocolNeighbors) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(IcmpConfiguration)) + { + writer.WritePropertyName("icmpConfiguration"u8); + writer.WriteObjectValue(IcmpConfiguration, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AccessControlListMatchConditionPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccessControlListMatchConditionPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccessControlListMatchConditionPatch(document.RootElement, options); + } + + internal static AccessControlListMatchConditionPatch DeserializeAccessControlListMatchConditionPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList protocolTypes = default; + VlanMatchConditionPatch vlanMatchCondition = default; + IPMatchConditionPatch ipCondition = default; + IList etherTypes = default; + IList fragments = default; + IList ipLengths = default; + IList ttlValues = default; + IList dscpMarkings = default; + AccessControlListPortConditionPatch portCondition = default; + IList protocolNeighbors = default; + IcmpConfigurationPatchProperties icmpConfiguration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("protocolTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + protocolTypes = array; + continue; + } + if (property.NameEquals("vlanMatchCondition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vlanMatchCondition = VlanMatchConditionPatch.DeserializeVlanMatchConditionPatch(property.Value, options); + continue; + } + if (property.NameEquals("ipCondition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ipCondition = IPMatchConditionPatch.DeserializeIPMatchConditionPatch(property.Value, options); + continue; + } + if (property.NameEquals("etherTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + etherTypes = array; + continue; + } + if (property.NameEquals("fragments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + fragments = array; + continue; + } + if (property.NameEquals("ipLengths"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipLengths = array; + continue; + } + if (property.NameEquals("ttlValues"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ttlValues = array; + continue; + } + if (property.NameEquals("dscpMarkings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dscpMarkings = array; + continue; + } + if (property.NameEquals("portCondition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + portCondition = AccessControlListPortConditionPatch.DeserializeAccessControlListPortConditionPatch(property.Value, options); + continue; + } + if (property.NameEquals("protocolNeighbors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + protocolNeighbors = array; + continue; + } + if (property.NameEquals("icmpConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + icmpConfiguration = IcmpConfigurationPatchProperties.DeserializeIcmpConfigurationPatchProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccessControlListMatchConditionPatch( + protocolTypes ?? new ChangeTrackingList(), + vlanMatchCondition, + ipCondition, + etherTypes ?? new ChangeTrackingList(), + fragments ?? new ChangeTrackingList(), + ipLengths ?? new ChangeTrackingList(), + ttlValues ?? new ChangeTrackingList(), + dscpMarkings ?? new ChangeTrackingList(), + portCondition, + protocolNeighbors ?? new ChangeTrackingList(), + icmpConfiguration, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(AccessControlListMatchConditionPatch)} does not support writing '{options.Format}' format."); + } + } + + AccessControlListMatchConditionPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAccessControlListMatchConditionPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccessControlListMatchConditionPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchConditionPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchConditionPatch.cs new file mode 100644 index 000000000000..829395b751d3 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchConditionPatch.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Defines the match condition that is supported to filter the traffic. + public partial class AccessControlListMatchConditionPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AccessControlListMatchConditionPatch() + { + ProtocolTypes = new ChangeTrackingList(); + EtherTypes = new ChangeTrackingList(); + Fragments = new ChangeTrackingList(); + IPLengths = new ChangeTrackingList(); + TtlValues = new ChangeTrackingList(); + DscpMarkings = new ChangeTrackingList(); + ProtocolNeighbors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of the protocols that need to be matched. + /// Vlan match condition that needs to be matched. + /// IP condition that needs to be matched. + /// List of ether type values that need to be matched. + /// List of IP fragment packets that need to be matched. + /// List of IP Lengths that need to be matched. + /// List of TTL [Time To Live] values that need to be matched. + /// List of DSCP Markings that need to be matched. + /// Defines the port condition that needs to be matched. + /// Protocol neighbors that need to be matched. + /// Internet Control Message Protocol (ICMP) configuration. + /// Keeps track of any properties unknown to the library. + internal AccessControlListMatchConditionPatch(IList protocolTypes, VlanMatchConditionPatch vlanMatchCondition, IPMatchConditionPatch ipCondition, IList etherTypes, IList fragments, IList ipLengths, IList ttlValues, IList dscpMarkings, AccessControlListPortConditionPatch portCondition, IList protocolNeighbors, IcmpConfigurationPatchProperties icmpConfiguration, IDictionary serializedAdditionalRawData) + { + ProtocolTypes = protocolTypes; + VlanMatchCondition = vlanMatchCondition; + IPCondition = ipCondition; + EtherTypes = etherTypes; + Fragments = fragments; + IPLengths = ipLengths; + TtlValues = ttlValues; + DscpMarkings = dscpMarkings; + PortCondition = portCondition; + ProtocolNeighbors = protocolNeighbors; + IcmpConfiguration = icmpConfiguration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of the protocols that need to be matched. + public IList ProtocolTypes { get; } + /// Vlan match condition that needs to be matched. + public VlanMatchConditionPatch VlanMatchCondition { get; set; } + /// IP condition that needs to be matched. + public IPMatchConditionPatch IPCondition { get; set; } + /// List of ether type values that need to be matched. + public IList EtherTypes { get; } + /// List of IP fragment packets that need to be matched. + public IList Fragments { get; } + /// List of IP Lengths that need to be matched. + public IList IPLengths { get; } + /// List of TTL [Time To Live] values that need to be matched. + public IList TtlValues { get; } + /// List of DSCP Markings that need to be matched. + public IList DscpMarkings { get; } + /// Defines the port condition that needs to be matched. + public AccessControlListPortConditionPatch PortCondition { get; set; } + /// Protocol neighbors that need to be matched. + public IList ProtocolNeighbors { get; } + /// Internet Control Message Protocol (ICMP) configuration. + internal IcmpConfigurationPatchProperties IcmpConfiguration { get; set; } + /// Internet Control Message Protocol (ICMP) types. + public IList IcmpTypes + { + get + { + if (IcmpConfiguration is null) + IcmpConfiguration = new IcmpConfigurationPatchProperties(); + return IcmpConfiguration.IcmpTypes; + } + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchConfigurationPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchConfigurationPatch.Serialization.cs new file mode 100644 index 000000000000..968af5ccbdda --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchConfigurationPatch.Serialization.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class AccessControlListMatchConfigurationPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccessControlListMatchConfigurationPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MatchConfigurationName)) + { + writer.WritePropertyName("matchConfigurationName"u8); + writer.WriteStringValue(MatchConfigurationName); + } + if (Optional.IsDefined(SequenceNumber)) + { + writer.WritePropertyName("sequenceNumber"u8); + writer.WriteNumberValue(SequenceNumber.Value); + } + if (Optional.IsDefined(IPAddressType)) + { + writer.WritePropertyName("ipAddressType"u8); + writer.WriteStringValue(IPAddressType.Value.ToString()); + } + if (Optional.IsCollectionDefined(MatchConditions)) + { + writer.WritePropertyName("matchConditions"u8); + writer.WriteStartArray(); + foreach (var item in MatchConditions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Actions)) + { + writer.WritePropertyName("actions"u8); + writer.WriteStartArray(); + foreach (var item in Actions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AccessControlListMatchConfigurationPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccessControlListMatchConfigurationPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccessControlListMatchConfigurationPatch(document.RootElement, options); + } + + internal static AccessControlListMatchConfigurationPatch DeserializeAccessControlListMatchConfigurationPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string matchConfigurationName = default; + long? sequenceNumber = default; + NetworkFabricIPAddressType? ipAddressType = default; + IList matchConditions = default; + IList actions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("matchConfigurationName"u8)) + { + matchConfigurationName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sequenceNumber"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sequenceNumber = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("ipAddressType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ipAddressType = new NetworkFabricIPAddressType(property.Value.GetString()); + continue; + } + if (property.NameEquals("matchConditions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AccessControlListMatchConditionPatch.DeserializeAccessControlListMatchConditionPatch(item, options)); + } + matchConditions = array; + continue; + } + if (property.NameEquals("actions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AccessControlListActionPatch.DeserializeAccessControlListActionPatch(item, options)); + } + actions = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccessControlListMatchConfigurationPatch( + matchConfigurationName, + sequenceNumber, + ipAddressType, + matchConditions ?? new ChangeTrackingList(), + actions ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(AccessControlListMatchConfigurationPatch)} does not support writing '{options.Format}' format."); + } + } + + AccessControlListMatchConfigurationPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAccessControlListMatchConfigurationPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccessControlListMatchConfigurationPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchConfigurationPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchConfigurationPatch.cs new file mode 100644 index 000000000000..ea254f5c1b74 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListMatchConfigurationPatch.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Defines the match configuration that are supported to filter the traffic. + public partial class AccessControlListMatchConfigurationPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AccessControlListMatchConfigurationPatch() + { + MatchConditions = new ChangeTrackingList(); + Actions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The name of the match configuration. + /// Sequence Number of the match configuration. + /// Type of IP Address. IPv4 or IPv6. + /// List of the match conditions. + /// List of actions that need to be performed for the matched conditions. + /// Keeps track of any properties unknown to the library. + internal AccessControlListMatchConfigurationPatch(string matchConfigurationName, long? sequenceNumber, NetworkFabricIPAddressType? ipAddressType, IList matchConditions, IList actions, IDictionary serializedAdditionalRawData) + { + MatchConfigurationName = matchConfigurationName; + SequenceNumber = sequenceNumber; + IPAddressType = ipAddressType; + MatchConditions = matchConditions; + Actions = actions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the match configuration. + public string MatchConfigurationName { get; set; } + /// Sequence Number of the match configuration. + public long? SequenceNumber { get; set; } + /// Type of IP Address. IPv4 or IPv6. + public NetworkFabricIPAddressType? IPAddressType { get; set; } + /// List of the match conditions. + public IList MatchConditions { get; } + /// List of actions that need to be performed for the matched conditions. + public IList Actions { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPatchProperties.Serialization.cs new file mode 100644 index 000000000000..823980912e14 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPatchProperties.Serialization.cs @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class AccessControlListPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccessControlListPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ConfigurationType)) + { + writer.WritePropertyName("configurationType"u8); + writer.WriteStringValue(ConfigurationType.Value.ToString()); + } + if (Optional.IsDefined(AclsUri)) + { + writer.WritePropertyName("aclsUrl"u8); + writer.WriteStringValue(AclsUri.AbsoluteUri); + } + if (Optional.IsDefined(DefaultAction)) + { + writer.WritePropertyName("defaultAction"u8); + writer.WriteStringValue(DefaultAction.Value.ToString()); + } + if (Optional.IsCollectionDefined(MatchConfigurations)) + { + writer.WritePropertyName("matchConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in MatchConfigurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(DynamicMatchConfigurations)) + { + writer.WritePropertyName("dynamicMatchConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in DynamicMatchConfigurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AclType)) + { + writer.WritePropertyName("aclType"u8); + writer.WriteStringValue(AclType.Value.ToString()); + } + if (Optional.IsDefined(DeviceRole)) + { + writer.WritePropertyName("deviceRole"u8); + writer.WriteStringValue(DeviceRole.Value.ToString()); + } + if (Optional.IsDefined(GlobalAccessControlListActions)) + { + writer.WritePropertyName("globalAccessControlListActions"u8); + writer.WriteObjectValue(GlobalAccessControlListActions, options); + } + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AccessControlListPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccessControlListPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccessControlListPatchProperties(document.RootElement, options); + } + + internal static AccessControlListPatchProperties DeserializeAccessControlListPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NetworkFabricConfigurationType? configurationType = default; + Uri aclsUrl = default; + CommunityActionType? defaultAction = default; + IList matchConfigurations = default; + IList dynamicMatchConfigurations = default; + AclType? aclType = default; + DeviceRole? deviceRole = default; + GlobalAccessControlListActionPatchProperties globalAccessControlListActions = default; + string annotation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("configurationType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configurationType = new NetworkFabricConfigurationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("aclsUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + aclsUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("defaultAction"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultAction = new CommunityActionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("matchConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AccessControlListMatchConfigurationPatch.DeserializeAccessControlListMatchConfigurationPatch(item, options)); + } + matchConfigurations = array; + continue; + } + if (property.NameEquals("dynamicMatchConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CommonDynamicMatchConfigurationPatch.DeserializeCommonDynamicMatchConfigurationPatch(item, options)); + } + dynamicMatchConfigurations = array; + continue; + } + if (property.NameEquals("aclType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + aclType = new AclType(property.Value.GetString()); + continue; + } + if (property.NameEquals("deviceRole"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deviceRole = new DeviceRole(property.Value.GetString()); + continue; + } + if (property.NameEquals("globalAccessControlListActions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + globalAccessControlListActions = GlobalAccessControlListActionPatchProperties.DeserializeGlobalAccessControlListActionPatchProperties(property.Value, options); + continue; + } + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccessControlListPatchProperties( + configurationType, + aclsUrl, + defaultAction, + matchConfigurations ?? new ChangeTrackingList(), + dynamicMatchConfigurations ?? new ChangeTrackingList(), + aclType, + deviceRole, + globalAccessControlListActions, + annotation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(AccessControlListPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + AccessControlListPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAccessControlListPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccessControlListPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPatchProperties.cs new file mode 100644 index 000000000000..af396bdc17dc --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPatchProperties.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Access Control Lists patch properties. + public partial class AccessControlListPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AccessControlListPatchProperties() + { + MatchConfigurations = new ChangeTrackingList(); + DynamicMatchConfigurations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Input method to configure Access Control List. + /// Access Control List file URL. + /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + /// List of match configurations. + /// List of dynamic match configurations. + /// Access Control List (ACL) Type. + /// Device Role. + /// Global Access Control List (ACL) actions. + /// Switch configuration description. + /// Keeps track of any properties unknown to the library. + internal AccessControlListPatchProperties(NetworkFabricConfigurationType? configurationType, Uri aclsUri, CommunityActionType? defaultAction, IList matchConfigurations, IList dynamicMatchConfigurations, AclType? aclType, DeviceRole? deviceRole, GlobalAccessControlListActionPatchProperties globalAccessControlListActions, string annotation, IDictionary serializedAdditionalRawData) + { + ConfigurationType = configurationType; + AclsUri = aclsUri; + DefaultAction = defaultAction; + MatchConfigurations = matchConfigurations; + DynamicMatchConfigurations = dynamicMatchConfigurations; + AclType = aclType; + DeviceRole = deviceRole; + GlobalAccessControlListActions = globalAccessControlListActions; + Annotation = annotation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Input method to configure Access Control List. + public NetworkFabricConfigurationType? ConfigurationType { get; set; } + /// Access Control List file URL. + public Uri AclsUri { get; set; } + /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + public CommunityActionType? DefaultAction { get; set; } + /// List of match configurations. + public IList MatchConfigurations { get; } + /// List of dynamic match configurations. + public IList DynamicMatchConfigurations { get; } + /// Access Control List (ACL) Type. + public AclType? AclType { get; set; } + /// Device Role. + public DeviceRole? DeviceRole { get; set; } + /// Global Access Control List (ACL) actions. + internal GlobalAccessControlListActionPatchProperties GlobalAccessControlListActions { get; set; } + /// Configuration to enable or disable ACL action count. + public NetworkFabricBooleanValue? GlobalAccessControlListActionsEnableCount + { + get => GlobalAccessControlListActions is null ? default : GlobalAccessControlListActions.EnableCount; + set + { + if (GlobalAccessControlListActions is null) + GlobalAccessControlListActions = new GlobalAccessControlListActionPatchProperties(); + GlobalAccessControlListActions.EnableCount = value; + } + } + + /// Switch configuration description. + public string Annotation { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPortCondition.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPortCondition.Serialization.cs index 8a45335dfab0..c9018ed36fa4 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPortCondition.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPortCondition.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,7 +34,33 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(AccessControlListPortCondition)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(PortType)) + { + writer.WritePropertyName("portType"u8); + writer.WriteStringValue(PortType.Value.ToString()); + } + writer.WritePropertyName("layer4Protocol"u8); + writer.WriteStringValue(Layer4Protocol.ToString()); + if (Optional.IsCollectionDefined(Ports)) + { + writer.WritePropertyName("ports"u8); + writer.WriteStartArray(); + foreach (var item in Ports) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(PortGroupNames)) + { + writer.WritePropertyName("portGroupNames"u8); + writer.WriteStartArray(); + foreach (var item in PortGroupNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsCollectionDefined(Flags)) { writer.WritePropertyName("flags"u8); @@ -45,6 +71,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } AccessControlListPortCondition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -67,29 +108,15 @@ internal static AccessControlListPortCondition DeserializeAccessControlListPortC { return null; } - IList flags = default; NetworkFabricPortType? portType = default; Layer4Protocol layer4Protocol = default; IList ports = default; IList portGroupNames = default; + IList flags = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("flags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - flags = array; - continue; - } if (property.NameEquals("portType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -132,6 +159,20 @@ internal static AccessControlListPortCondition DeserializeAccessControlListPortC portGroupNames = array; continue; } + if (property.NameEquals("flags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + flags = array; + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -143,8 +184,8 @@ internal static AccessControlListPortCondition DeserializeAccessControlListPortC layer4Protocol, ports ?? new ChangeTrackingList(), portGroupNames ?? new ChangeTrackingList(), - serializedAdditionalRawData, - flags ?? new ChangeTrackingList()); + flags ?? new ChangeTrackingList(), + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPortCondition.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPortCondition.cs index e361bb065548..e245e68a580f 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPortCondition.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPortCondition.cs @@ -11,12 +11,47 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// Defines the port condition that needs to be matched. - public partial class AccessControlListPortCondition : NetworkFabricPortCondition + public partial class AccessControlListPortCondition { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . /// Layer4 protocol type that needs to be matched. - public AccessControlListPortCondition(Layer4Protocol layer4Protocol) : base(layer4Protocol) + public AccessControlListPortCondition(Layer4Protocol layer4Protocol) { + Layer4Protocol = layer4Protocol; + Ports = new ChangeTrackingList(); + PortGroupNames = new ChangeTrackingList(); Flags = new ChangeTrackingList(); } @@ -25,11 +60,16 @@ public AccessControlListPortCondition(Layer4Protocol layer4Protocol) : base(laye /// Layer4 protocol type that needs to be matched. /// List of the Ports that need to be matched. /// List of the port Group Names that need to be matched. + /// List of protocol flags that need to be matched. Example: established | initial | <List-of-TCP-flags>. List of eligible TCP Flags are ack, fin, not-ack, not-fin, not-psh, not-rst, not-syn, not-urg, psh, rst, syn, urg. /// Keeps track of any properties unknown to the library. - /// List of protocol flags that need to be matched. - internal AccessControlListPortCondition(NetworkFabricPortType? portType, Layer4Protocol layer4Protocol, IList ports, IList portGroupNames, IDictionary serializedAdditionalRawData, IList flags) : base(portType, layer4Protocol, ports, portGroupNames, serializedAdditionalRawData) + internal AccessControlListPortCondition(NetworkFabricPortType? portType, Layer4Protocol layer4Protocol, IList ports, IList portGroupNames, IList flags, IDictionary serializedAdditionalRawData) { + PortType = portType; + Layer4Protocol = layer4Protocol; + Ports = ports; + PortGroupNames = portGroupNames; Flags = flags; + _serializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. @@ -37,7 +77,15 @@ internal AccessControlListPortCondition() { } - /// List of protocol flags that need to be matched. + /// Port type that needs to be matched. + public NetworkFabricPortType? PortType { get; set; } + /// Layer4 protocol type that needs to be matched. + public Layer4Protocol Layer4Protocol { get; set; } + /// List of the Ports that need to be matched. + public IList Ports { get; } + /// List of the port Group Names that need to be matched. + public IList PortGroupNames { get; } + /// List of protocol flags that need to be matched. Example: established | initial | <List-of-TCP-flags>. List of eligible TCP Flags are ack, fin, not-ack, not-fin, not-psh, not-rst, not-syn, not-urg, psh, rst, syn, urg. public IList Flags { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPortConditionPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPortConditionPatch.Serialization.cs new file mode 100644 index 000000000000..061cbacf1896 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPortConditionPatch.Serialization.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class AccessControlListPortConditionPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccessControlListPortConditionPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(PortType)) + { + writer.WritePropertyName("portType"u8); + writer.WriteStringValue(PortType.Value.ToString()); + } + if (Optional.IsDefined(Layer4Protocol)) + { + writer.WritePropertyName("layer4Protocol"u8); + writer.WriteStringValue(Layer4Protocol.Value.ToString()); + } + if (Optional.IsCollectionDefined(Ports)) + { + writer.WritePropertyName("ports"u8); + writer.WriteStartArray(); + foreach (var item in Ports) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(PortGroupNames)) + { + writer.WritePropertyName("portGroupNames"u8); + writer.WriteStartArray(); + foreach (var item in PortGroupNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Flags)) + { + writer.WritePropertyName("flags"u8); + writer.WriteStartArray(); + foreach (var item in Flags) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AccessControlListPortConditionPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccessControlListPortConditionPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccessControlListPortConditionPatch(document.RootElement, options); + } + + internal static AccessControlListPortConditionPatch DeserializeAccessControlListPortConditionPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NetworkFabricPortType? portType = default; + Layer4Protocol? layer4Protocol = default; + IList ports = default; + IList portGroupNames = default; + IList flags = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("portType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + portType = new NetworkFabricPortType(property.Value.GetString()); + continue; + } + if (property.NameEquals("layer4Protocol"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + layer4Protocol = new Layer4Protocol(property.Value.GetString()); + continue; + } + if (property.NameEquals("ports"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ports = array; + continue; + } + if (property.NameEquals("portGroupNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + portGroupNames = array; + continue; + } + if (property.NameEquals("flags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + flags = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccessControlListPortConditionPatch( + portType, + layer4Protocol, + ports ?? new ChangeTrackingList(), + portGroupNames ?? new ChangeTrackingList(), + flags ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(AccessControlListPortConditionPatch)} does not support writing '{options.Format}' format."); + } + } + + AccessControlListPortConditionPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAccessControlListPortConditionPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccessControlListPortConditionPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPortConditionPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPortConditionPatch.cs new file mode 100644 index 000000000000..8479b9fac9ff --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListPortConditionPatch.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Defines the port condition that needs to be matched. + public partial class AccessControlListPortConditionPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AccessControlListPortConditionPatch() + { + Ports = new ChangeTrackingList(); + PortGroupNames = new ChangeTrackingList(); + Flags = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Port type that needs to be matched. + /// Layer4 protocol type that needs to be matched. + /// List of the Ports that need to be matched. + /// List of the port Group Names that need to be matched. + /// List of protocol flags that need to be matched. Example: established | initial | <List-of-TCP-flags>. List of eligible TCP Flags are ack, fin, not-ack, not-fin, not-psh, not-rst, not-syn, not-urg, psh, rst, syn, urg. + /// Keeps track of any properties unknown to the library. + internal AccessControlListPortConditionPatch(NetworkFabricPortType? portType, Layer4Protocol? layer4Protocol, IList ports, IList portGroupNames, IList flags, IDictionary serializedAdditionalRawData) + { + PortType = portType; + Layer4Protocol = layer4Protocol; + Ports = ports; + PortGroupNames = portGroupNames; + Flags = flags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Port type that needs to be matched. + public NetworkFabricPortType? PortType { get; set; } + /// Layer4 protocol type that needs to be matched. + public Layer4Protocol? Layer4Protocol { get; set; } + /// List of the Ports that need to be matched. + public IList Ports { get; } + /// List of the port Group Names that need to be matched. + public IList PortGroupNames { get; } + /// List of protocol flags that need to be matched. Example: established | initial | <List-of-TCP-flags>. List of eligible TCP Flags are ack, fin, not-ack, not-fin, not-psh, not-rst, not-syn, not-urg, psh, rst, syn, urg. + public IList Flags { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePoliciesListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListResult.Serialization.cs similarity index 66% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePoliciesListResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListResult.Serialization.cs index adcafe2cfb43..926f121af484 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePoliciesListResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class RoutePoliciesListResult : IUtf8JsonSerializable, IJsonModel + internal partial class AccessControlListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(RoutePoliciesListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AccessControlListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - RoutePoliciesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AccessControlListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(RoutePoliciesListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AccessControlListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRoutePoliciesListResult(document.RootElement, options); + return DeserializeAccessControlListResult(document.RootElement, options); } - internal static RoutePoliciesListResult DeserializeRoutePoliciesListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static AccessControlListResult DeserializeAccessControlListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,29 +83,29 @@ internal static RoutePoliciesListResult DeserializeRoutePoliciesListResult(JsonE { return null; } - IReadOnlyList value = default; - string nextLink = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(NetworkFabricRoutePolicyData.DeserializeNetworkFabricRoutePolicyData(item, options)); + array.Add(NetworkFabricAccessControlListData.DeserializeNetworkFabricAccessControlListData(item, options)); } value = array; continue; } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +114,38 @@ internal static RoutePoliciesListResult DeserializeRoutePoliciesListResult(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new RoutePoliciesListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new AccessControlListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(RoutePoliciesListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AccessControlListResult)} does not support writing '{options.Format}' format."); } } - RoutePoliciesListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AccessControlListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeRoutePoliciesListResult(document.RootElement, options); + return DeserializeAccessControlListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(RoutePoliciesListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AccessControlListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListResult.cs new file mode 100644 index 000000000000..be1cdce9c46b --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a AccessControlList list operation. + internal partial class AccessControlListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The AccessControlList items on this page. + /// is null. + internal AccessControlListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AccessControlList items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AccessControlListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AccessControlListResult() + { + } + + /// The AccessControlList items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AclActionType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AclActionType.cs index b8da5b7d4f86..7191ac179229 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AclActionType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AclActionType.cs @@ -25,13 +25,19 @@ public AclActionType(string value) private const string DropValue = "Drop"; private const string CountValue = "Count"; private const string LogValue = "Log"; + private const string RemarkValue = "Remark"; + private const string PoliceRateValue = "PoliceRate"; - /// Drop. + /// AclActionType Drop. public static AclActionType Drop { get; } = new AclActionType(DropValue); - /// Count. + /// AclActionType Count. public static AclActionType Count { get; } = new AclActionType(CountValue); - /// Log. + /// AclActionType Log. public static AclActionType Log { get; } = new AclActionType(LogValue); + /// AclActionType Remark. + public static AclActionType Remark { get; } = new AclActionType(RemarkValue); + /// AclActionType PoliceRate. + public static AclActionType PoliceRate { get; } = new AclActionType(PoliceRateValue); /// Determines if two values are the same. public static bool operator ==(AclActionType left, AclActionType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AclType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AclType.cs new file mode 100644 index 000000000000..1515e92f3649 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AclType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Access Control List (ACL) Type. + public readonly partial struct AclType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AclType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CpValue = "ControlPlaneTrafficPolicy"; + private const string TenantValue = "Tenant"; + private const string ManagementValue = "Management"; + + /// AclType Control Plane Traffic Policy. + public static AclType Cp { get; } = new AclType(CpValue); + /// AclType Tenant. + public static AclType Tenant { get; } = new AclType(TenantValue); + /// AclType Management. + public static AclType Management { get; } = new AclType(ManagementValue); + /// Determines if two values are the same. + public static bool operator ==(AclType left, AclType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AclType left, AclType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AclType(string value) => new AclType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AclType other && Equals(other); + /// + public bool Equals(AclType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPCommunityPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPCommunityPatchProperties.Serialization.cs new file mode 100644 index 000000000000..46658ec2c241 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPCommunityPatchProperties.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class ActionIPCommunityPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionIPCommunityPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Add)) + { + writer.WritePropertyName("add"u8); + writer.WriteObjectValue(Add, options); + } + if (Optional.IsDefined(Delete)) + { + writer.WritePropertyName("delete"u8); + writer.WriteObjectValue(Delete, options); + } + if (Optional.IsDefined(Set)) + { + writer.WritePropertyName("set"u8); + writer.WriteObjectValue(Set, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ActionIPCommunityPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionIPCommunityPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeActionIPCommunityPatchProperties(document.RootElement, options); + } + + internal static ActionIPCommunityPatchProperties DeserializeActionIPCommunityPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IPCommunityIdList @add = default; + IPCommunityIdList delete = default; + IPCommunityIdList @set = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("add"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @add = IPCommunityIdList.DeserializeIPCommunityIdList(property.Value, options); + continue; + } + if (property.NameEquals("delete"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + delete = IPCommunityIdList.DeserializeIPCommunityIdList(property.Value, options); + continue; + } + if (property.NameEquals("set"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @set = IPCommunityIdList.DeserializeIPCommunityIdList(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ActionIPCommunityPatchProperties(@add, delete, @set, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(ActionIPCommunityPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + ActionIPCommunityPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeActionIPCommunityPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ActionIPCommunityPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityAddOperationProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPCommunityPatchProperties.cs similarity index 57% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityAddOperationProperties.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPCommunityPatchProperties.cs index 062b22d547ac..2d928f940d29 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityAddOperationProperties.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPCommunityPatchProperties.cs @@ -11,8 +11,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// IP Community add operation properties. - public partial class IPCommunityAddOperationProperties + /// IP Community Properties. + public partial class ActionIPCommunityPatchProperties { /// /// Keeps track of any properties unknown to the library. @@ -44,19 +44,23 @@ public partial class IPCommunityAddOperationProperties /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public IPCommunityAddOperationProperties() + /// Initializes a new instance of . + public ActionIPCommunityPatchProperties() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// List of IP Community IDs. + /// List of IP Community IDs. + /// List of IP Community IDs. /// Keeps track of any properties unknown to the library. - internal IPCommunityAddOperationProperties(IPCommunityIdList @add, IDictionary serializedAdditionalRawData) + internal ActionIPCommunityPatchProperties(IPCommunityIdList @add, IPCommunityIdList delete, IPCommunityIdList @set, IDictionary serializedAdditionalRawData) { Add = @add; + Delete = delete; + Set = @set; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -72,5 +76,31 @@ public IList AddIPCommunityIds return Add.IPCommunityIds; } } + + /// List of IP Community IDs. + internal IPCommunityIdList Delete { get; set; } + /// List of IP Community resource IDs. + public IList DeleteIPCommunityIds + { + get + { + if (Delete is null) + Delete = new IPCommunityIdList(); + return Delete.IPCommunityIds; + } + } + + /// List of IP Community IDs. + internal IPCommunityIdList Set { get; set; } + /// List of IP Community resource IDs. + public IList SetIPCommunityIds + { + get + { + if (Set is null) + Set = new IPCommunityIdList(); + return Set.IPCommunityIds; + } + } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPCommunityProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPCommunityProperties.Serialization.cs index cdefb2366d9a..fc683f894897 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPCommunityProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPCommunityProperties.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,7 +34,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(ActionIPCommunityProperties)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Add)) + { + writer.WritePropertyName("add"u8); + writer.WriteObjectValue(Add, options); + } if (Optional.IsDefined(Delete)) { writer.WritePropertyName("delete"u8); @@ -45,6 +49,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("set"u8); writer.WriteObjectValue(Set, options); } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } ActionIPCommunityProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -67,38 +86,38 @@ internal static ActionIPCommunityProperties DeserializeActionIPCommunityProperti { return null; } + IPCommunityIdList @add = default; IPCommunityIdList delete = default; IPCommunityIdList @set = default; - IPCommunityIdList @add = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("delete"u8)) + if (property.NameEquals("add"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - delete = IPCommunityIdList.DeserializeIPCommunityIdList(property.Value, options); + @add = IPCommunityIdList.DeserializeIPCommunityIdList(property.Value, options); continue; } - if (property.NameEquals("set"u8)) + if (property.NameEquals("delete"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - @set = IPCommunityIdList.DeserializeIPCommunityIdList(property.Value, options); + delete = IPCommunityIdList.DeserializeIPCommunityIdList(property.Value, options); continue; } - if (property.NameEquals("add"u8)) + if (property.NameEquals("set"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - @add = IPCommunityIdList.DeserializeIPCommunityIdList(property.Value, options); + @set = IPCommunityIdList.DeserializeIPCommunityIdList(property.Value, options); continue; } if (options.Format != "W") @@ -107,7 +126,7 @@ internal static ActionIPCommunityProperties DeserializeActionIPCommunityProperti } } serializedAdditionalRawData = rawDataDictionary; - return new ActionIPCommunityProperties(@add, serializedAdditionalRawData, delete, @set); + return new ActionIPCommunityProperties(@add, delete, @set, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPCommunityProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPCommunityProperties.cs index bbd28e1f074c..9c7b32fddeb9 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPCommunityProperties.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPCommunityProperties.cs @@ -12,8 +12,40 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// IP Community Properties. - public partial class ActionIPCommunityProperties : IPCommunityAddOperationProperties + public partial class ActionIPCommunityProperties { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public ActionIPCommunityProperties() { @@ -21,13 +53,28 @@ public ActionIPCommunityProperties() /// Initializes a new instance of . /// List of IP Community IDs. - /// Keeps track of any properties unknown to the library. /// List of IP Community IDs. /// List of IP Community IDs. - internal ActionIPCommunityProperties(IPCommunityIdList @add, IDictionary serializedAdditionalRawData, IPCommunityIdList delete, IPCommunityIdList @set) : base(@add, serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ActionIPCommunityProperties(IPCommunityIdList @add, IPCommunityIdList delete, IPCommunityIdList @set, IDictionary serializedAdditionalRawData) { + Add = @add; Delete = delete; Set = @set; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of IP Community IDs. + internal IPCommunityIdList Add { get; set; } + /// List of IP Community resource IDs. + public IList AddIPCommunityIds + { + get + { + if (Add is null) + Add = new IPCommunityIdList(); + return Add.IPCommunityIds; + } } /// List of IP Community IDs. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPExtendedCommunityPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPExtendedCommunityPatchProperties.Serialization.cs new file mode 100644 index 000000000000..bfc401138bbd --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPExtendedCommunityPatchProperties.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class ActionIPExtendedCommunityPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionIPExtendedCommunityPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Add)) + { + writer.WritePropertyName("add"u8); + writer.WriteObjectValue(Add, options); + } + if (Optional.IsDefined(Delete)) + { + writer.WritePropertyName("delete"u8); + writer.WriteObjectValue(Delete, options); + } + if (Optional.IsDefined(Set)) + { + writer.WritePropertyName("set"u8); + writer.WriteObjectValue(Set, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ActionIPExtendedCommunityPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionIPExtendedCommunityPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeActionIPExtendedCommunityPatchProperties(document.RootElement, options); + } + + internal static ActionIPExtendedCommunityPatchProperties DeserializeActionIPExtendedCommunityPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IPExtendedCommunityIdList @add = default; + IPExtendedCommunityIdList delete = default; + IPExtendedCommunityIdList @set = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("add"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @add = IPExtendedCommunityIdList.DeserializeIPExtendedCommunityIdList(property.Value, options); + continue; + } + if (property.NameEquals("delete"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + delete = IPExtendedCommunityIdList.DeserializeIPExtendedCommunityIdList(property.Value, options); + continue; + } + if (property.NameEquals("set"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @set = IPExtendedCommunityIdList.DeserializeIPExtendedCommunityIdList(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ActionIPExtendedCommunityPatchProperties(@add, delete, @set, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(ActionIPExtendedCommunityPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + ActionIPExtendedCommunityPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeActionIPExtendedCommunityPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ActionIPExtendedCommunityPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityAddOperationProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPExtendedCommunityPatchProperties.cs similarity index 55% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityAddOperationProperties.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPExtendedCommunityPatchProperties.cs index dec9277dbdea..47ad7d9d6029 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityAddOperationProperties.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPExtendedCommunityPatchProperties.cs @@ -11,8 +11,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// IP Extended Community add operation properties. - public partial class IPExtendedCommunityAddOperationProperties + /// IP Extended Community Properties. + public partial class ActionIPExtendedCommunityPatchProperties { /// /// Keeps track of any properties unknown to the library. @@ -44,19 +44,23 @@ public partial class IPExtendedCommunityAddOperationProperties /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public IPExtendedCommunityAddOperationProperties() + /// Initializes a new instance of . + public ActionIPExtendedCommunityPatchProperties() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// List of IP Extended Community IDs. + /// List of IP Extended Community IDs. + /// List of IP Extended Community IDs. /// Keeps track of any properties unknown to the library. - internal IPExtendedCommunityAddOperationProperties(IPExtendedCommunityIdList @add, IDictionary serializedAdditionalRawData) + internal ActionIPExtendedCommunityPatchProperties(IPExtendedCommunityIdList @add, IPExtendedCommunityIdList delete, IPExtendedCommunityIdList @set, IDictionary serializedAdditionalRawData) { Add = @add; + Delete = delete; + Set = @set; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -72,5 +76,31 @@ public IList AddIPExtendedCommunityIds return Add.IPExtendedCommunityIds; } } + + /// List of IP Extended Community IDs. + internal IPExtendedCommunityIdList Delete { get; set; } + /// List of IP Extended Community resource IDs. + public IList DeleteIPExtendedCommunityIds + { + get + { + if (Delete is null) + Delete = new IPExtendedCommunityIdList(); + return Delete.IPExtendedCommunityIds; + } + } + + /// List of IP Extended Community IDs. + internal IPExtendedCommunityIdList Set { get; set; } + /// List of IP Extended Community resource IDs. + public IList SetIPExtendedCommunityIds + { + get + { + if (Set is null) + Set = new IPExtendedCommunityIdList(); + return Set.IPExtendedCommunityIds; + } + } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPExtendedCommunityProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPExtendedCommunityProperties.Serialization.cs index 4412180ffa71..ec2ca6345360 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPExtendedCommunityProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPExtendedCommunityProperties.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,7 +34,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(ActionIPExtendedCommunityProperties)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Add)) + { + writer.WritePropertyName("add"u8); + writer.WriteObjectValue(Add, options); + } if (Optional.IsDefined(Delete)) { writer.WritePropertyName("delete"u8); @@ -45,6 +49,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("set"u8); writer.WriteObjectValue(Set, options); } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } ActionIPExtendedCommunityProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -67,38 +86,38 @@ internal static ActionIPExtendedCommunityProperties DeserializeActionIPExtendedC { return null; } + IPExtendedCommunityIdList @add = default; IPExtendedCommunityIdList delete = default; IPExtendedCommunityIdList @set = default; - IPExtendedCommunityIdList @add = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("delete"u8)) + if (property.NameEquals("add"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - delete = IPExtendedCommunityIdList.DeserializeIPExtendedCommunityIdList(property.Value, options); + @add = IPExtendedCommunityIdList.DeserializeIPExtendedCommunityIdList(property.Value, options); continue; } - if (property.NameEquals("set"u8)) + if (property.NameEquals("delete"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - @set = IPExtendedCommunityIdList.DeserializeIPExtendedCommunityIdList(property.Value, options); + delete = IPExtendedCommunityIdList.DeserializeIPExtendedCommunityIdList(property.Value, options); continue; } - if (property.NameEquals("add"u8)) + if (property.NameEquals("set"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - @add = IPExtendedCommunityIdList.DeserializeIPExtendedCommunityIdList(property.Value, options); + @set = IPExtendedCommunityIdList.DeserializeIPExtendedCommunityIdList(property.Value, options); continue; } if (options.Format != "W") @@ -107,7 +126,7 @@ internal static ActionIPExtendedCommunityProperties DeserializeActionIPExtendedC } } serializedAdditionalRawData = rawDataDictionary; - return new ActionIPExtendedCommunityProperties(@add, serializedAdditionalRawData, delete, @set); + return new ActionIPExtendedCommunityProperties(@add, delete, @set, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPExtendedCommunityProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPExtendedCommunityProperties.cs index dba02dace869..54183495c1ca 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPExtendedCommunityProperties.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ActionIPExtendedCommunityProperties.cs @@ -12,8 +12,40 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// IP Extended Community Properties. - public partial class ActionIPExtendedCommunityProperties : IPExtendedCommunityAddOperationProperties + public partial class ActionIPExtendedCommunityProperties { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public ActionIPExtendedCommunityProperties() { @@ -21,13 +53,28 @@ public ActionIPExtendedCommunityProperties() /// Initializes a new instance of . /// List of IP Extended Community IDs. - /// Keeps track of any properties unknown to the library. /// List of IP Extended Community IDs. /// List of IP Extended Community IDs. - internal ActionIPExtendedCommunityProperties(IPExtendedCommunityIdList @add, IDictionary serializedAdditionalRawData, IPExtendedCommunityIdList delete, IPExtendedCommunityIdList @set) : base(@add, serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ActionIPExtendedCommunityProperties(IPExtendedCommunityIdList @add, IPExtendedCommunityIdList delete, IPExtendedCommunityIdList @set, IDictionary serializedAdditionalRawData) { + Add = @add; Delete = delete; Set = @set; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of IP Extended Community IDs. + internal IPExtendedCommunityIdList Add { get; set; } + /// List of IP Extended Community resource IDs. + public IList AddIPExtendedCommunityIds + { + get + { + if (Add is null) + Add = new IPExtendedCommunityIdList(); + return Add.IPExtendedCommunityIds; + } } /// List of IP Extended Community IDs. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AddressFamilyType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AddressFamilyType.cs index 822225a21fb5..cd3f46692ccb 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AddressFamilyType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AddressFamilyType.cs @@ -25,9 +25,9 @@ public AddressFamilyType(string value) private const string IPv4Value = "IPv4"; private const string IPv6Value = "IPv6"; - /// IPv4. + /// AddressType-IPv4. public static AddressFamilyType IPv4 { get; } = new AddressFamilyType(IPv4Value); - /// IPv6. + /// AddressType-IPv6. public static AddressFamilyType IPv6 { get; } = new AddressFamilyType(IPv6Value); /// Determines if two values are the same. public static bool operator ==(AddressFamilyType left, AddressFamilyType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AdministrativeEnableState.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AdministrativeEnableState.cs index 8a5f3487705e..01f7cbd8879f 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AdministrativeEnableState.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AdministrativeEnableState.cs @@ -24,11 +24,14 @@ public AdministrativeEnableState(string value) private const string EnableValue = "Enable"; private const string DisableValue = "Disable"; + private const string UnderMaintenanceValue = "UnderMaintenance"; - /// Enable. + /// AdministrativeState Enable. public static AdministrativeEnableState Enable { get; } = new AdministrativeEnableState(EnableValue); - /// Disable. + /// AdministrativeState Disable. public static AdministrativeEnableState Disable { get; } = new AdministrativeEnableState(DisableValue); + /// AdministrativeState UnderMaintenance. + public static AdministrativeEnableState UnderMaintenance { get; } = new AdministrativeEnableState(UnderMaintenanceValue); /// Determines if two values are the same. public static bool operator ==(AdministrativeEnableState left, AdministrativeEnableState right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AggregateRoutePatchConfiguration.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AggregateRoutePatchConfiguration.Serialization.cs new file mode 100644 index 000000000000..530594358c33 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AggregateRoutePatchConfiguration.Serialization.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class AggregateRoutePatchConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AggregateRoutePatchConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(IPv4Routes)) + { + writer.WritePropertyName("ipv4Routes"u8); + writer.WriteStartArray(); + foreach (var item in IPv4Routes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(IPv6Routes)) + { + writer.WritePropertyName("ipv6Routes"u8); + writer.WriteStartArray(); + foreach (var item in IPv6Routes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AggregateRoutePatchConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AggregateRoutePatchConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAggregateRoutePatchConfiguration(document.RootElement, options); + } + + internal static AggregateRoutePatchConfiguration DeserializeAggregateRoutePatchConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList ipv4Routes = default; + IList ipv6Routes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipv4Routes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AggregateRoute.DeserializeAggregateRoute(item, options)); + } + ipv4Routes = array; + continue; + } + if (property.NameEquals("ipv6Routes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AggregateRoute.DeserializeAggregateRoute(item, options)); + } + ipv6Routes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AggregateRoutePatchConfiguration(ipv4Routes ?? new ChangeTrackingList(), ipv6Routes ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(AggregateRoutePatchConfiguration)} does not support writing '{options.Format}' format."); + } + } + + AggregateRoutePatchConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAggregateRoutePatchConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AggregateRoutePatchConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AggregateRoutePatchConfiguration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AggregateRoutePatchConfiguration.cs new file mode 100644 index 000000000000..02423aec282f --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AggregateRoutePatchConfiguration.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// List of IPv4 and IPv6 aggregate routes. + public partial class AggregateRoutePatchConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AggregateRoutePatchConfiguration() + { + IPv4Routes = new ChangeTrackingList(); + IPv6Routes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of IPv4 Route prefixes. + /// List of Ipv6Routes prefixes. + /// Keeps track of any properties unknown to the library. + internal AggregateRoutePatchConfiguration(IList ipv4Routes, IList ipv6Routes, IDictionary serializedAdditionalRawData) + { + IPv4Routes = ipv4Routes; + IPv6Routes = ipv6Routes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of IPv4 Route prefixes. + public IList IPv4Routes { get; } + /// List of Ipv6Routes prefixes. + public IList IPv6Routes { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AllowASOverride.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AllowASOverride.cs index 848b17582076..d91d4d6690f0 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AllowASOverride.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AllowASOverride.cs @@ -25,9 +25,9 @@ public AllowASOverride(string value) private const string EnableValue = "Enable"; private const string DisableValue = "Disable"; - /// Enable. + /// AllowASOverride-Enable. public static AllowASOverride Enable { get; } = new AllowASOverride(EnableValue); - /// Disable. + /// AllowASOverride-Disable. public static AllowASOverride Disable { get; } = new AllowASOverride(DisableValue); /// Determines if two values are the same. public static bool operator ==(AllowASOverride left, AllowASOverride right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ArmConfigurationDiffResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ArmConfigurationDiffResult.Serialization.cs new file mode 100644 index 000000000000..0e0d27a7cf0a --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ArmConfigurationDiffResult.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class ArmConfigurationDiffResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArmConfigurationDiffResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ConfigurationDiffUri)) + { + writer.WritePropertyName("configurationDiffUrl"u8); + writer.WriteStringValue(ConfigurationDiffUri.AbsoluteUri); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + ((IJsonModel)Error).Write(writer, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ArmConfigurationDiffResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArmConfigurationDiffResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeArmConfigurationDiffResult(document.RootElement, options); + } + + internal static ArmConfigurationDiffResult DeserializeArmConfigurationDiffResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri configurationDiffUrl = default; + ResponseError error = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("configurationDiffUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configurationDiffUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerManagedNetworkFabricContext.Default); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ArmConfigurationDiffResult(configurationDiffUrl, error, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(ArmConfigurationDiffResult)} does not support writing '{options.Format}' format."); + } + } + + ArmConfigurationDiffResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeArmConfigurationDiffResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ArmConfigurationDiffResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListsResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ArmConfigurationDiffResult.cs similarity index 66% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListsResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ArmConfigurationDiffResult.cs index daf06dea5050..5063f0e77627 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListsResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ArmConfigurationDiffResult.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of Access Control Lists. - internal partial class AccessControlListsResult + /// Arm Configuration Diff Response. + public partial class ArmConfigurationDiffResult { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,25 @@ internal partial class AccessControlListsResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal AccessControlListsResult() + /// Initializes a new instance of . + internal ArmConfigurationDiffResult() { - Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of Access Control List resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// Storage URL to the diff file. + /// The error object. /// Keeps track of any properties unknown to the library. - internal AccessControlListsResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ArmConfigurationDiffResult(Uri configurationDiffUri, ResponseError error, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + ConfigurationDiffUri = configurationDiffUri; + Error = error; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of Access Control List resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// Storage URL to the diff file. + public Uri ConfigurationDiffUri { get; } + /// The error object. + public ResponseError Error { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AzureResourceManagerManagedNetworkFabricContext.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AzureResourceManagerManagedNetworkFabricContext.cs index 25c3bde57aaf..19938e845ccd 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AzureResourceManagerManagedNetworkFabricContext.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AzureResourceManagerManagedNetworkFabricContext.cs @@ -16,84 +16,168 @@ namespace Azure.ResourceManager.ManagedNetworkFabric /// For more information see 'https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/System.ClientModel/src/docs/ModelReaderWriterContext.md' /// [ModelReaderWriterBuildable(typeof(AccessControlListAction))] + [ModelReaderWriterBuildable(typeof(AccessControlListActionPatch))] [ModelReaderWriterBuildable(typeof(AccessControlListMatchCondition))] + [ModelReaderWriterBuildable(typeof(AccessControlListMatchConditionPatch))] [ModelReaderWriterBuildable(typeof(AccessControlListMatchConfiguration))] + [ModelReaderWriterBuildable(typeof(AccessControlListMatchConfigurationPatch))] + [ModelReaderWriterBuildable(typeof(AccessControlListPatchProperties))] [ModelReaderWriterBuildable(typeof(AccessControlListPortCondition))] - [ModelReaderWriterBuildable(typeof(AccessControlListsResult))] + [ModelReaderWriterBuildable(typeof(AccessControlListPortConditionPatch))] + [ModelReaderWriterBuildable(typeof(AccessControlListResult))] + [ModelReaderWriterBuildable(typeof(ActionIPCommunityPatchProperties))] [ModelReaderWriterBuildable(typeof(ActionIPCommunityProperties))] + [ModelReaderWriterBuildable(typeof(ActionIPExtendedCommunityPatchProperties))] [ModelReaderWriterBuildable(typeof(ActionIPExtendedCommunityProperties))] [ModelReaderWriterBuildable(typeof(AggregateRoute))] [ModelReaderWriterBuildable(typeof(AggregateRouteConfiguration))] - [ModelReaderWriterBuildable(typeof(AnnotationResourceProperties))] + [ModelReaderWriterBuildable(typeof(AggregateRoutePatchConfiguration))] + [ModelReaderWriterBuildable(typeof(ArmConfigurationDiffResult))] [ModelReaderWriterBuildable(typeof(BfdConfiguration))] + [ModelReaderWriterBuildable(typeof(BfdPatchConfiguration))] [ModelReaderWriterBuildable(typeof(BgpConfiguration))] + [ModelReaderWriterBuildable(typeof(BgpPatchConfiguration))] + [ModelReaderWriterBuildable(typeof(BitRate))] + [ModelReaderWriterBuildable(typeof(BmpConfigurationPatchProperties))] + [ModelReaderWriterBuildable(typeof(BmpConfigurationProperties))] + [ModelReaderWriterBuildable(typeof(BurstSize))] + [ModelReaderWriterBuildable(typeof(CommitBatchDetails))] + [ModelReaderWriterBuildable(typeof(CommitBatchStatusContent))] + [ModelReaderWriterBuildable(typeof(CommitBatchStatusResult))] [ModelReaderWriterBuildable(typeof(CommonDynamicMatchConfiguration))] - [ModelReaderWriterBuildable(typeof(CommonMatchConditions))] + [ModelReaderWriterBuildable(typeof(CommonDynamicMatchConfigurationPatch))] + [ModelReaderWriterBuildable(typeof(CommonPostActionResponseForDeviceROCommands))] + [ModelReaderWriterBuildable(typeof(CommonPostActionResponseForDeviceROCommandsOperationStatusResult))] + [ModelReaderWriterBuildable(typeof(CommonPostActionResponseForDeviceRWCommands))] + [ModelReaderWriterBuildable(typeof(ConditionalDefaultRouteProperties))] [ModelReaderWriterBuildable(typeof(ConnectedSubnet))] + [ModelReaderWriterBuildable(typeof(ConnectedSubnetPatch))] [ModelReaderWriterBuildable(typeof(ConnectedSubnetRoutePolicy))] + [ModelReaderWriterBuildable(typeof(ConnectedSubnetRoutePolicyPatch))] + [ModelReaderWriterBuildable(typeof(DestinationPatchProperties))] + [ModelReaderWriterBuildable(typeof(DeviceRoCommand))] + [ModelReaderWriterBuildable(typeof(DeviceRwCommand))] [ModelReaderWriterBuildable(typeof(DeviceUpdateCommonPostActionResult))] + [ModelReaderWriterBuildable(typeof(DiscardCommitBatchContent))] + [ModelReaderWriterBuildable(typeof(DiscardCommitBatchResult))] [ModelReaderWriterBuildable(typeof(ExportRoutePolicy))] [ModelReaderWriterBuildable(typeof(ExportRoutePolicyInformation))] + [ModelReaderWriterBuildable(typeof(ExportRoutePolicyInformationPatch))] + [ModelReaderWriterBuildable(typeof(ExportRoutePolicyPatch))] [ModelReaderWriterBuildable(typeof(ExpressRouteConnectionInformation))] + [ModelReaderWriterBuildable(typeof(ExternalNetworkBfdAdministrativeStateContent))] + [ModelReaderWriterBuildable(typeof(ExternalNetworkBfdAdministrativeStateResult))] + [ModelReaderWriterBuildable(typeof(ExternalNetworkBmpPatchProperties))] + [ModelReaderWriterBuildable(typeof(ExternalNetworkBmpProperties))] + [ModelReaderWriterBuildable(typeof(ExternalNetworkListResult))] [ModelReaderWriterBuildable(typeof(ExternalNetworkOptionAProperties))] [ModelReaderWriterBuildable(typeof(ExternalNetworkPatchOptionAProperties))] - [ModelReaderWriterBuildable(typeof(ExternalNetworksList))] + [ModelReaderWriterBuildable(typeof(ExternalNetworkPatchProperties))] + [ModelReaderWriterBuildable(typeof(ExternalNetworkStaticRouteConfiguration))] + [ModelReaderWriterBuildable(typeof(ExternalNetworkStaticRoutePatchConfiguration))] + [ModelReaderWriterBuildable(typeof(FabricLockProperties))] + [ModelReaderWriterBuildable(typeof(FeatureFlagProperties))] + [ModelReaderWriterBuildable(typeof(GlobalAccessControlListActionPatchProperties))] + [ModelReaderWriterBuildable(typeof(GlobalAccessControlListActionProperties))] + [ModelReaderWriterBuildable(typeof(GlobalNetworkTapRuleActionPatchProperties))] + [ModelReaderWriterBuildable(typeof(GlobalNetworkTapRuleActionProperties))] + [ModelReaderWriterBuildable(typeof(HeaderAddressProperties))] + [ModelReaderWriterBuildable(typeof(IcmpConfigurationPatchProperties))] + [ModelReaderWriterBuildable(typeof(IcmpConfigurationProperties))] + [ModelReaderWriterBuildable(typeof(IdentitySelector))] + [ModelReaderWriterBuildable(typeof(IdentitySelectorPatch))] [ModelReaderWriterBuildable(typeof(ImportRoutePolicy))] [ModelReaderWriterBuildable(typeof(ImportRoutePolicyInformation))] - [ModelReaderWriterBuildable(typeof(InternalNetworkBgpConfiguration))] - [ModelReaderWriterBuildable(typeof(InternalNetworksList))] - [ModelReaderWriterBuildable(typeof(InternalNetworkStaticRouteConfiguration))] + [ModelReaderWriterBuildable(typeof(ImportRoutePolicyInformationPatch))] + [ModelReaderWriterBuildable(typeof(ImportRoutePolicyPatch))] + [ModelReaderWriterBuildable(typeof(InternalNetworkBfdAdministrativeStateContent))] + [ModelReaderWriterBuildable(typeof(InternalNetworkBfdAdministrativeStateResult))] + [ModelReaderWriterBuildable(typeof(InternalNetworkBgpAdministrativeStateContent))] + [ModelReaderWriterBuildable(typeof(InternalNetworkBgpAdministrativeStateResult))] + [ModelReaderWriterBuildable(typeof(InternalNetworkBmpPatchProperties))] + [ModelReaderWriterBuildable(typeof(InternalNetworkBmpProperties))] + [ModelReaderWriterBuildable(typeof(InternalNetworkListResult))] + [ModelReaderWriterBuildable(typeof(InternalNetworkPatchProperties))] + [ModelReaderWriterBuildable(typeof(InternetGatewayListResult))] + [ModelReaderWriterBuildable(typeof(InternetGatewayPatchProperties))] + [ModelReaderWriterBuildable(typeof(InternetGatewayRuleListResult))] + [ModelReaderWriterBuildable(typeof(InternetGatewayRuleProperties))] [ModelReaderWriterBuildable(typeof(InternetGatewayRules))] - [ModelReaderWriterBuildable(typeof(InternetGatewayRulesListResult))] - [ModelReaderWriterBuildable(typeof(InternetGatewaysListResult))] - [ModelReaderWriterBuildable(typeof(IPCommunitiesListResult))] - [ModelReaderWriterBuildable(typeof(IPCommunityAddOperationProperties))] [ModelReaderWriterBuildable(typeof(IPCommunityIdList))] + [ModelReaderWriterBuildable(typeof(IPCommunityListResult))] + [ModelReaderWriterBuildable(typeof(IPCommunityPatchableProperties))] + [ModelReaderWriterBuildable(typeof(IPCommunityProperties))] [ModelReaderWriterBuildable(typeof(IPCommunityRule))] - [ModelReaderWriterBuildable(typeof(IPExtendedCommunityAddOperationProperties))] [ModelReaderWriterBuildable(typeof(IPExtendedCommunityIdList))] [ModelReaderWriterBuildable(typeof(IPExtendedCommunityListResult))] + [ModelReaderWriterBuildable(typeof(IPExtendedCommunityPatchProperties))] + [ModelReaderWriterBuildable(typeof(IPExtendedCommunityProperties))] [ModelReaderWriterBuildable(typeof(IPExtendedCommunityRule))] + [ModelReaderWriterBuildable(typeof(IPGroupPatchProperties))] [ModelReaderWriterBuildable(typeof(IPMatchCondition))] - [ModelReaderWriterBuildable(typeof(IPPrefixesListResult))] + [ModelReaderWriterBuildable(typeof(IPMatchConditionPatch))] + [ModelReaderWriterBuildable(typeof(IPPrefixListResult))] + [ModelReaderWriterBuildable(typeof(IPPrefixPatchProperties))] + [ModelReaderWriterBuildable(typeof(IPPrefixProperties))] [ModelReaderWriterBuildable(typeof(IPPrefixRule))] + [ModelReaderWriterBuildable(typeof(IsolationDomainPatchProperties))] [ModelReaderWriterBuildable(typeof(IsolationDomainProperties))] - [ModelReaderWriterBuildable(typeof(L2IsolationDomainsListResult))] + [ModelReaderWriterBuildable(typeof(L2IsolationDomainListResult))] + [ModelReaderWriterBuildable(typeof(L2IsolationDomainPatchProperties))] + [ModelReaderWriterBuildable(typeof(L2IsolationDomainProperties))] [ModelReaderWriterBuildable(typeof(L3ExportRoutePolicy))] - [ModelReaderWriterBuildable(typeof(L3IsolationDomainsListResult))] + [ModelReaderWriterBuildable(typeof(L3ExportRoutePolicyPatch))] + [ModelReaderWriterBuildable(typeof(L3IsolationDomainListResult))] + [ModelReaderWriterBuildable(typeof(L3IsolationDomainPatchProperties))] + [ModelReaderWriterBuildable(typeof(L3IsolationDomainProperties))] + [ModelReaderWriterBuildable(typeof(L3OptionBPatchProperties))] [ModelReaderWriterBuildable(typeof(L3OptionBProperties))] + [ModelReaderWriterBuildable(typeof(L3UniqueRouteDistinguisherProperties))] + [ModelReaderWriterBuildable(typeof(LastOperationProperties))] [ModelReaderWriterBuildable(typeof(Layer2Configuration))] - [ModelReaderWriterBuildable(typeof(Layer3IPPrefixProperties))] + [ModelReaderWriterBuildable(typeof(Layer2ConfigurationPatch))] [ModelReaderWriterBuildable(typeof(ManagedResourceGroupConfiguration))] - [ModelReaderWriterBuildable(typeof(ManagementNetworkConfigurationPatchableProperties))] + [ModelReaderWriterBuildable(typeof(ManagedServiceIdentity))] + [ModelReaderWriterBuildable(typeof(ManagedServiceIdentityPatch))] [ModelReaderWriterBuildable(typeof(ManagementNetworkConfigurationProperties))] + [ModelReaderWriterBuildable(typeof(ManagementNetworkPatchConfiguration))] [ModelReaderWriterBuildable(typeof(MatchConfigurationIPGroupProperties))] + [ModelReaderWriterBuildable(typeof(NativeIPv4PrefixLimitPatchProperties))] + [ModelReaderWriterBuildable(typeof(NativeIPv4PrefixLimitProperties))] + [ModelReaderWriterBuildable(typeof(NativeIPv6PrefixLimitPatchProperties))] + [ModelReaderWriterBuildable(typeof(NativeIPv6PrefixLimitProperties))] [ModelReaderWriterBuildable(typeof(NeighborAddress))] + [ModelReaderWriterBuildable(typeof(NeighborAddressBfdAdministrativeStatus))] + [ModelReaderWriterBuildable(typeof(NeighborAddressBgpAdministrativeStatus))] + [ModelReaderWriterBuildable(typeof(NeighborAddressPatch))] [ModelReaderWriterBuildable(typeof(NeighborGroupDestination))] - [ModelReaderWriterBuildable(typeof(NeighborGroupsListResult))] + [ModelReaderWriterBuildable(typeof(NeighborGroupDestinationPatch))] + [ModelReaderWriterBuildable(typeof(NeighborGroupListResult))] + [ModelReaderWriterBuildable(typeof(NeighborGroupPatchProperties))] + [ModelReaderWriterBuildable(typeof(NeighborGroupProperties))] [ModelReaderWriterBuildable(typeof(NetworkDeviceData))] [ModelReaderWriterBuildable(typeof(NetworkDeviceInterfaceData))] [ModelReaderWriterBuildable(typeof(NetworkDeviceInterfacePatch))] [ModelReaderWriterBuildable(typeof(NetworkDeviceInterfaceProperties))] [ModelReaderWriterBuildable(typeof(NetworkDeviceInterfaceResource))] - [ModelReaderWriterBuildable(typeof(NetworkDeviceInterfacesList))] + [ModelReaderWriterBuildable(typeof(NetworkDeviceListResult))] [ModelReaderWriterBuildable(typeof(NetworkDevicePatch))] + [ModelReaderWriterBuildable(typeof(NetworkDevicePatchParametersProperties))] [ModelReaderWriterBuildable(typeof(NetworkDeviceRebootContent))] [ModelReaderWriterBuildable(typeof(NetworkDeviceResource))] [ModelReaderWriterBuildable(typeof(NetworkDeviceSkuData))] + [ModelReaderWriterBuildable(typeof(NetworkDeviceSkuListResult))] [ModelReaderWriterBuildable(typeof(NetworkDeviceSkuResource))] - [ModelReaderWriterBuildable(typeof(NetworkDeviceSkusListResult))] - [ModelReaderWriterBuildable(typeof(NetworkDevicesListResult))] [ModelReaderWriterBuildable(typeof(NetworkFabricAccessControlListData))] [ModelReaderWriterBuildable(typeof(NetworkFabricAccessControlListPatch))] [ModelReaderWriterBuildable(typeof(NetworkFabricAccessControlListResource))] [ModelReaderWriterBuildable(typeof(NetworkFabricControllerData))] + [ModelReaderWriterBuildable(typeof(NetworkFabricControllerListResult))] [ModelReaderWriterBuildable(typeof(NetworkFabricControllerPatch))] + [ModelReaderWriterBuildable(typeof(NetworkFabricControllerPatchProperties))] [ModelReaderWriterBuildable(typeof(NetworkFabricControllerResource))] [ModelReaderWriterBuildable(typeof(NetworkFabricControllerServices))] - [ModelReaderWriterBuildable(typeof(NetworkFabricControllersListResult))] [ModelReaderWriterBuildable(typeof(NetworkFabricData))] - [ModelReaderWriterBuildable(typeof(NetworkFabricErrorResult))] [ModelReaderWriterBuildable(typeof(NetworkFabricExternalNetworkData))] [ModelReaderWriterBuildable(typeof(NetworkFabricExternalNetworkPatch))] [ModelReaderWriterBuildable(typeof(NetworkFabricExternalNetworkResource))] @@ -121,78 +205,133 @@ namespace Azure.ResourceManager.ManagedNetworkFabric [ModelReaderWriterBuildable(typeof(NetworkFabricL3IsolationDomainData))] [ModelReaderWriterBuildable(typeof(NetworkFabricL3IsolationDomainPatch))] [ModelReaderWriterBuildable(typeof(NetworkFabricL3IsolationDomainResource))] + [ModelReaderWriterBuildable(typeof(NetworkFabricListResult))] + [ModelReaderWriterBuildable(typeof(NetworkFabricLockContent))] [ModelReaderWriterBuildable(typeof(NetworkFabricNeighborGroupData))] [ModelReaderWriterBuildable(typeof(NetworkFabricNeighborGroupPatch))] [ModelReaderWriterBuildable(typeof(NetworkFabricNeighborGroupResource))] [ModelReaderWriterBuildable(typeof(NetworkFabricPatch))] - [ModelReaderWriterBuildable(typeof(NetworkFabricPatchablePropertiesTerminalServerConfiguration))] + [ModelReaderWriterBuildable(typeof(NetworkFabricPatchProperties))] [ModelReaderWriterBuildable(typeof(NetworkFabricPortCondition))] [ModelReaderWriterBuildable(typeof(NetworkFabricResource))] [ModelReaderWriterBuildable(typeof(NetworkFabricRoutePolicyData))] [ModelReaderWriterBuildable(typeof(NetworkFabricRoutePolicyPatch))] [ModelReaderWriterBuildable(typeof(NetworkFabricRoutePolicyResource))] [ModelReaderWriterBuildable(typeof(NetworkFabricSkuData))] + [ModelReaderWriterBuildable(typeof(NetworkFabricSkuListResult))] + [ModelReaderWriterBuildable(typeof(NetworkFabricSkuProperties))] [ModelReaderWriterBuildable(typeof(NetworkFabricSkuResource))] - [ModelReaderWriterBuildable(typeof(NetworkFabricSkusListResult))] - [ModelReaderWriterBuildable(typeof(NetworkFabricsListResult))] [ModelReaderWriterBuildable(typeof(NetworkFabricUpdateVersionContent))] + [ModelReaderWriterBuildable(typeof(NetworkInterfaceListResult))] + [ModelReaderWriterBuildable(typeof(NetworkInterfacePatchProperties))] + [ModelReaderWriterBuildable(typeof(NetworkMonitorData))] + [ModelReaderWriterBuildable(typeof(NetworkMonitorListResult))] + [ModelReaderWriterBuildable(typeof(NetworkMonitorPatch))] + [ModelReaderWriterBuildable(typeof(NetworkMonitorPatchProperties))] + [ModelReaderWriterBuildable(typeof(NetworkMonitorProperties))] + [ModelReaderWriterBuildable(typeof(NetworkMonitorResource))] [ModelReaderWriterBuildable(typeof(NetworkPacketBrokerData))] + [ModelReaderWriterBuildable(typeof(NetworkPacketBrokerListResult))] [ModelReaderWriterBuildable(typeof(NetworkPacketBrokerPatch))] + [ModelReaderWriterBuildable(typeof(NetworkPacketBrokerProperties))] [ModelReaderWriterBuildable(typeof(NetworkPacketBrokerResource))] - [ModelReaderWriterBuildable(typeof(NetworkPacketBrokersListResult))] [ModelReaderWriterBuildable(typeof(NetworkRackData))] + [ModelReaderWriterBuildable(typeof(NetworkRackListResult))] [ModelReaderWriterBuildable(typeof(NetworkRackPatch))] + [ModelReaderWriterBuildable(typeof(NetworkRackProperties))] [ModelReaderWriterBuildable(typeof(NetworkRackResource))] - [ModelReaderWriterBuildable(typeof(NetworkRacksListResult))] [ModelReaderWriterBuildable(typeof(NetworkTapData))] [ModelReaderWriterBuildable(typeof(NetworkTapDestinationProperties))] + [ModelReaderWriterBuildable(typeof(NetworkTapListResult))] [ModelReaderWriterBuildable(typeof(NetworkTapPatch))] - [ModelReaderWriterBuildable(typeof(NetworkTapPatchableParametersDestinationsItem))] - [ModelReaderWriterBuildable(typeof(NetworkTapPropertiesDestinationsItem))] + [ModelReaderWriterBuildable(typeof(NetworkTapPatchProperties))] + [ModelReaderWriterBuildable(typeof(NetworkTapProperties))] [ModelReaderWriterBuildable(typeof(NetworkTapResource))] [ModelReaderWriterBuildable(typeof(NetworkTapRuleAction))] + [ModelReaderWriterBuildable(typeof(NetworkTapRuleActionPatch))] [ModelReaderWriterBuildable(typeof(NetworkTapRuleData))] + [ModelReaderWriterBuildable(typeof(NetworkTapRuleListResult))] [ModelReaderWriterBuildable(typeof(NetworkTapRuleMatchCondition))] + [ModelReaderWriterBuildable(typeof(NetworkTapRuleMatchConditionPatch))] [ModelReaderWriterBuildable(typeof(NetworkTapRuleMatchConfiguration))] + [ModelReaderWriterBuildable(typeof(NetworkTapRuleMatchConfigurationPatch))] [ModelReaderWriterBuildable(typeof(NetworkTapRulePatch))] + [ModelReaderWriterBuildable(typeof(NetworkTapRulePatchProperties))] + [ModelReaderWriterBuildable(typeof(NetworkTapRuleProperties))] [ModelReaderWriterBuildable(typeof(NetworkTapRuleResource))] - [ModelReaderWriterBuildable(typeof(NetworkTapRulesListResult))] - [ModelReaderWriterBuildable(typeof(NetworkTapsListResult))] [ModelReaderWriterBuildable(typeof(NetworkToNetworkInterconnectData))] - [ModelReaderWriterBuildable(typeof(NetworkToNetworkInterconnectOptionBLayer3Configuration))] + [ModelReaderWriterBuildable(typeof(NetworkToNetworkInterconnectListResult))] [ModelReaderWriterBuildable(typeof(NetworkToNetworkInterconnectPatch))] + [ModelReaderWriterBuildable(typeof(NetworkToNetworkInterconnectPatchProperties))] + [ModelReaderWriterBuildable(typeof(NetworkToNetworkInterconnectProperties))] [ModelReaderWriterBuildable(typeof(NetworkToNetworkInterconnectResource))] - [ModelReaderWriterBuildable(typeof(NetworkToNetworkInterconnectsList))] + [ModelReaderWriterBuildable(typeof(NniBfdAdministrativeStateContent))] + [ModelReaderWriterBuildable(typeof(NniBfdAdministrativeStateResult))] + [ModelReaderWriterBuildable(typeof(NniBmpPatchProperties))] + [ModelReaderWriterBuildable(typeof(NniBmpProperties))] + [ModelReaderWriterBuildable(typeof(NniStaticRouteConfiguration))] + [ModelReaderWriterBuildable(typeof(NniStaticRoutePatchConfiguration))] [ModelReaderWriterBuildable(typeof(NpbStaticRouteConfiguration))] - [ModelReaderWriterBuildable(typeof(OptionAProperties))] + [ModelReaderWriterBuildable(typeof(NpbStaticRouteConfigurationPatch))] [ModelReaderWriterBuildable(typeof(OptionBLayer3Configuration))] - [ModelReaderWriterBuildable(typeof(OptionBProperties))] + [ModelReaderWriterBuildable(typeof(OptionBLayer3ConfigurationPatchProperties))] + [ModelReaderWriterBuildable(typeof(OptionBLayer3PrefixLimitPatchProperties))] + [ModelReaderWriterBuildable(typeof(OptionBLayer3PrefixLimitProperties))] + [ModelReaderWriterBuildable(typeof(PoliceRateConfigurationProperties))] + [ModelReaderWriterBuildable(typeof(PortConditionPatch))] + [ModelReaderWriterBuildable(typeof(PortGroupPatchProperties))] [ModelReaderWriterBuildable(typeof(PortGroupProperties))] + [ModelReaderWriterBuildable(typeof(PrefixLimitPatchProperties))] + [ModelReaderWriterBuildable(typeof(PrefixLimitProperties))] [ModelReaderWriterBuildable(typeof(ResponseError))] - [ModelReaderWriterBuildable(typeof(RoutePoliciesListResult))] + [ModelReaderWriterBuildable(typeof(RoutePolicyListResult))] + [ModelReaderWriterBuildable(typeof(RoutePolicyPatchableProperties))] + [ModelReaderWriterBuildable(typeof(RoutePolicyProperties))] + [ModelReaderWriterBuildable(typeof(RoutePolicyStatementPatchProperties))] [ModelReaderWriterBuildable(typeof(RoutePolicyStatementProperties))] + [ModelReaderWriterBuildable(typeof(RoutePrefixLimitPatchProperties))] + [ModelReaderWriterBuildable(typeof(RoutePrefixLimitProperties))] [ModelReaderWriterBuildable(typeof(RouteTargetInformation))] + [ModelReaderWriterBuildable(typeof(RouteTargetPatchInformation))] + [ModelReaderWriterBuildable(typeof(StatementActionPatchProperties))] [ModelReaderWriterBuildable(typeof(StatementActionProperties))] + [ModelReaderWriterBuildable(typeof(StatementConditionPatchProperties))] [ModelReaderWriterBuildable(typeof(StatementConditionProperties))] [ModelReaderWriterBuildable(typeof(StateUpdateCommonPostActionResult))] [ModelReaderWriterBuildable(typeof(StaticRouteConfiguration))] + [ModelReaderWriterBuildable(typeof(StaticRoutePatchConfiguration))] + [ModelReaderWriterBuildable(typeof(StaticRoutePatchProperties))] + [ModelReaderWriterBuildable(typeof(StaticRoutePolicy))] + [ModelReaderWriterBuildable(typeof(StaticRoutePolicyPatch))] [ModelReaderWriterBuildable(typeof(StaticRouteProperties))] + [ModelReaderWriterBuildable(typeof(StationConnectionPatchProperties))] + [ModelReaderWriterBuildable(typeof(StationConnectionProperties))] + [ModelReaderWriterBuildable(typeof(StorageAccountConfiguration))] + [ModelReaderWriterBuildable(typeof(StorageAccountPatchConfiguration))] [ModelReaderWriterBuildable(typeof(SupportedConnectorProperties))] [ModelReaderWriterBuildable(typeof(SupportedVersionProperties))] [ModelReaderWriterBuildable(typeof(SystemData))] [ModelReaderWriterBuildable(typeof(TerminalServerConfiguration))] - [ModelReaderWriterBuildable(typeof(TerminalServerPatchableProperties))] + [ModelReaderWriterBuildable(typeof(TerminalServerPatchConfiguration))] + [ModelReaderWriterBuildable(typeof(UniqueRouteDistinguisherPatchProperties))] + [ModelReaderWriterBuildable(typeof(UniqueRouteDistinguisherProperties))] [ModelReaderWriterBuildable(typeof(UpdateAdministrativeStateContent))] - [ModelReaderWriterBuildable(typeof(UpdateAdministrativeStateOnResources))] [ModelReaderWriterBuildable(typeof(UpdateDeviceAdministrativeStateContent))] + [ModelReaderWriterBuildable(typeof(UpgradeNetworkFabricProperties))] + [ModelReaderWriterBuildable(typeof(UserAssignedIdentity))] [ModelReaderWriterBuildable(typeof(ValidateConfigurationContent))] [ModelReaderWriterBuildable(typeof(ValidateConfigurationResult))] + [ModelReaderWriterBuildable(typeof(ViewDeviceConfigurationResult))] + [ModelReaderWriterBuildable(typeof(VlanGroupPatchProperties))] [ModelReaderWriterBuildable(typeof(VlanGroupProperties))] [ModelReaderWriterBuildable(typeof(VlanMatchCondition))] - [ModelReaderWriterBuildable(typeof(VpnConfigurationOptionAProperties))] - [ModelReaderWriterBuildable(typeof(VpnConfigurationPatchableOptionAProperties))] + [ModelReaderWriterBuildable(typeof(VlanMatchConditionPatch))] [ModelReaderWriterBuildable(typeof(VpnConfigurationPatchableProperties))] [ModelReaderWriterBuildable(typeof(VpnConfigurationProperties))] + [ModelReaderWriterBuildable(typeof(VpnOptionAPatchProperties))] + [ModelReaderWriterBuildable(typeof(VpnOptionAProperties))] + [ModelReaderWriterBuildable(typeof(VpnOptionBPatchProperties))] + [ModelReaderWriterBuildable(typeof(VpnOptionBProperties))] public partial class AzureResourceManagerManagedNetworkFabricContext : ModelReaderWriterContext { } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BfdAdministrativeState.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BfdAdministrativeState.cs index ab5af8bf1d59..b4f011ee16d7 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BfdAdministrativeState.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BfdAdministrativeState.cs @@ -27,13 +27,13 @@ public BfdAdministrativeState(string value) private const string MatValue = "MAT"; private const string RmaValue = "RMA"; - /// Enabled. + /// Represents the enabled state of BFD administrative state. public static BfdAdministrativeState Enabled { get; } = new BfdAdministrativeState(EnabledValue); - /// Disabled. + /// Represents the disabled state of BFD administrative state. public static BfdAdministrativeState Disabled { get; } = new BfdAdministrativeState(DisabledValue); - /// MAT. + /// Represents the MAT(Manual Action Taken) state of BFD administrative state. public static BfdAdministrativeState Mat { get; } = new BfdAdministrativeState(MatValue); - /// RMA. + /// Represents the RMA(Return Material Authorization) state of BFD administrative state. public static BfdAdministrativeState Rma { get; } = new BfdAdministrativeState(RmaValue); /// Determines if two values are the same. public static bool operator ==(BfdAdministrativeState left, BfdAdministrativeState right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonMatchConditions.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BfdPatchConfiguration.Serialization.cs similarity index 58% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonMatchConditions.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BfdPatchConfiguration.Serialization.cs index 6127f80f23cd..0d77af9f63eb 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonMatchConditions.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BfdPatchConfiguration.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - public partial class CommonMatchConditions : IUtf8JsonSerializable, IJsonModel + public partial class BfdPatchConfiguration : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,31 +28,26 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CommonMatchConditions)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(BfdPatchConfiguration)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(ProtocolTypes)) + if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) { - writer.WritePropertyName("protocolTypes"u8); - writer.WriteStartArray(); - foreach (var item in ProtocolTypes) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); } - if (Optional.IsDefined(VlanMatchCondition)) + if (Optional.IsDefined(IntervalInMilliSeconds)) { - writer.WritePropertyName("vlanMatchCondition"u8); - writer.WriteObjectValue(VlanMatchCondition, options); + writer.WritePropertyName("intervalInMilliSeconds"u8); + writer.WriteNumberValue(IntervalInMilliSeconds.Value); } - if (Optional.IsDefined(IPCondition)) + if (Optional.IsDefined(Multiplier)) { - writer.WritePropertyName("ipCondition"u8); - writer.WriteObjectValue(IPCondition, options); + writer.WritePropertyName("multiplier"u8); + writer.WriteNumberValue(Multiplier.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -71,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CommonMatchConditions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + BfdPatchConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CommonMatchConditions)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(BfdPatchConfiguration)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCommonMatchConditions(document.RootElement, options); + return DeserializeBfdPatchConfiguration(document.RootElement, options); } - internal static CommonMatchConditions DeserializeCommonMatchConditions(JsonElement element, ModelReaderWriterOptions options = null) + internal static BfdPatchConfiguration DeserializeBfdPatchConfiguration(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -91,43 +86,38 @@ internal static CommonMatchConditions DeserializeCommonMatchConditions(JsonEleme { return null; } - IList protocolTypes = default; - VlanMatchCondition vlanMatchCondition = default; - IPMatchCondition ipCondition = default; + BfdAdministrativeState? administrativeState = default; + int? intervalInMilliSeconds = default; + int? multiplier = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("protocolTypes"u8)) + if (property.NameEquals("administrativeState"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - protocolTypes = array; + administrativeState = new BfdAdministrativeState(property.Value.GetString()); continue; } - if (property.NameEquals("vlanMatchCondition"u8)) + if (property.NameEquals("intervalInMilliSeconds"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - vlanMatchCondition = VlanMatchCondition.DeserializeVlanMatchCondition(property.Value, options); + intervalInMilliSeconds = property.Value.GetInt32(); continue; } - if (property.NameEquals("ipCondition"u8)) + if (property.NameEquals("multiplier"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - ipCondition = IPMatchCondition.DeserializeIPMatchCondition(property.Value, options); + multiplier = property.Value.GetInt32(); continue; } if (options.Format != "W") @@ -136,38 +126,38 @@ internal static CommonMatchConditions DeserializeCommonMatchConditions(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new CommonMatchConditions(protocolTypes ?? new ChangeTrackingList(), vlanMatchCondition, ipCondition, serializedAdditionalRawData); + return new BfdPatchConfiguration(administrativeState, intervalInMilliSeconds, multiplier, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(CommonMatchConditions)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(BfdPatchConfiguration)} does not support writing '{options.Format}' format."); } } - CommonMatchConditions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + BfdPatchConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCommonMatchConditions(document.RootElement, options); + return DeserializeBfdPatchConfiguration(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(CommonMatchConditions)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(BfdPatchConfiguration)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BfdPatchConfiguration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BfdPatchConfiguration.cs new file mode 100644 index 000000000000..293ee543d899 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BfdPatchConfiguration.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// BFD configuration properties. + public partial class BfdPatchConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BfdPatchConfiguration() + { + } + + /// Initializes a new instance of . + /// Administrative state of the BfdConfiguration. Example: Enabled | Disabled. + /// Interval in milliseconds. Example: 300. + /// Multiplier for the Bfd Configuration. Example: 5. + /// Keeps track of any properties unknown to the library. + internal BfdPatchConfiguration(BfdAdministrativeState? administrativeState, int? intervalInMilliSeconds, int? multiplier, IDictionary serializedAdditionalRawData) + { + AdministrativeState = administrativeState; + IntervalInMilliSeconds = intervalInMilliSeconds; + Multiplier = multiplier; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Administrative state of the BfdConfiguration. Example: Enabled | Disabled. + public BfdAdministrativeState? AdministrativeState { get; } + /// Interval in milliseconds. Example: 300. + public int? IntervalInMilliSeconds { get; set; } + /// Multiplier for the Bfd Configuration. Example: 5. + public int? Multiplier { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BgpAdministrativeState.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BgpAdministrativeState.cs new file mode 100644 index 000000000000..00d52a811a74 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BgpAdministrativeState.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Border Gateway Protocol (BGP) Administrative State values. + public readonly partial struct BgpAdministrativeState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BgpAdministrativeState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// BgpAdministrativeState-Enabled. + public static BgpAdministrativeState Enabled { get; } = new BgpAdministrativeState(EnabledValue); + /// BgpAdministrativeState-Disabled. + public static BgpAdministrativeState Disabled { get; } = new BgpAdministrativeState(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(BgpAdministrativeState left, BgpAdministrativeState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BgpAdministrativeState left, BgpAdministrativeState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BgpAdministrativeState(string value) => new BgpAdministrativeState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BgpAdministrativeState other && Equals(other); + /// + public bool Equals(BgpAdministrativeState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BgpConfiguration.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BgpConfiguration.Serialization.cs index e4d02aa12f1a..b374b039cc1f 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BgpConfiguration.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BgpConfiguration.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,7 +34,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(BgpConfiguration)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } if (Optional.IsDefined(BfdConfiguration)) { writer.WritePropertyName("bfdConfiguration"u8); @@ -105,6 +109,36 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + if (Optional.IsDefined(BmpConfiguration)) + { + writer.WritePropertyName("bmpConfiguration"u8); + writer.WriteObjectValue(BmpConfiguration, options); + } + if (Optional.IsDefined(V4OverV6BgpSession)) + { + writer.WritePropertyName("v4OverV6BgpSession"u8); + writer.WriteStringValue(V4OverV6BgpSession.Value.ToString()); + } + if (Optional.IsDefined(V6OverV4BgpSession)) + { + writer.WritePropertyName("v6OverV4BgpSession"u8); + writer.WriteStringValue(V6OverV4BgpSession.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } BgpConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -127,6 +161,7 @@ internal static BgpConfiguration DeserializeBgpConfiguration(JsonElement element { return null; } + string annotation = default; BfdConfiguration bfdConfiguration = default; NetworkFabricBooleanValue? defaultRouteOriginate = default; int? allowAS = default; @@ -137,11 +172,18 @@ internal static BgpConfiguration DeserializeBgpConfiguration(JsonElement element IList ipv6ListenRangePrefixes = default; IList ipv4NeighborAddress = default; IList ipv6NeighborAddress = default; - string annotation = default; + InternalNetworkBmpProperties bmpConfiguration = default; + V4OverV6BgpSessionState? v4OverV6BgpSession = default; + V6OverV4BgpSessionState? v6OverV4BgpSession = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } if (property.NameEquals("bfdConfiguration"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -252,9 +294,31 @@ internal static BgpConfiguration DeserializeBgpConfiguration(JsonElement element ipv6NeighborAddress = array; continue; } - if (property.NameEquals("annotation"u8)) + if (property.NameEquals("bmpConfiguration"u8)) { - annotation = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bmpConfiguration = InternalNetworkBmpProperties.DeserializeInternalNetworkBmpProperties(property.Value, options); + continue; + } + if (property.NameEquals("v4OverV6BgpSession"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + v4OverV6BgpSession = new V4OverV6BgpSessionState(property.Value.GetString()); + continue; + } + if (property.NameEquals("v6OverV4BgpSession"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + v6OverV4BgpSession = new V6OverV4BgpSessionState(property.Value.GetString()); continue; } if (options.Format != "W") @@ -265,7 +329,6 @@ internal static BgpConfiguration DeserializeBgpConfiguration(JsonElement element serializedAdditionalRawData = rawDataDictionary; return new BgpConfiguration( annotation, - serializedAdditionalRawData, bfdConfiguration, defaultRouteOriginate, allowAS, @@ -275,7 +338,11 @@ internal static BgpConfiguration DeserializeBgpConfiguration(JsonElement element ipv4ListenRangePrefixes ?? new ChangeTrackingList(), ipv6ListenRangePrefixes ?? new ChangeTrackingList(), ipv4NeighborAddress ?? new ChangeTrackingList(), - ipv6NeighborAddress ?? new ChangeTrackingList()); + ipv6NeighborAddress ?? new ChangeTrackingList(), + bmpConfiguration, + v4OverV6BgpSession, + v6OverV4BgpSession, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BgpConfiguration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BgpConfiguration.cs index 4b869531a842..99c77edb42a0 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BgpConfiguration.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BgpConfiguration.cs @@ -11,8 +11,40 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// BGP configuration properties. - public partial class BgpConfiguration : AnnotationResourceProperties + public partial class BgpConfiguration { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public BgpConfiguration() { @@ -24,7 +56,6 @@ public BgpConfiguration() /// Initializes a new instance of . /// Switch configuration description. - /// Keeps track of any properties unknown to the library. /// BFD configuration properties. /// Originate a defaultRoute. Ex: "True" | "False". /// Allows for routes to be received and processed even if the router detects its own ASN in the AS-Path. 0 is disable, Possible values are 1-10, default is 2. @@ -35,8 +66,13 @@ public BgpConfiguration() /// List of BGP IPv6 Listen Ranges prefixes. /// List with stringified IPv4 Neighbor Addresses. /// List with stringified IPv6 Neighbor Address. - internal BgpConfiguration(string annotation, IDictionary serializedAdditionalRawData, BfdConfiguration bfdConfiguration, NetworkFabricBooleanValue? defaultRouteOriginate, int? allowAS, AllowASOverride? allowASOverride, long? fabricAsn, long? peerAsn, IList ipv4ListenRangePrefixes, IList ipv6ListenRangePrefixes, IList ipv4NeighborAddress, IList ipv6NeighborAddress) : base(annotation, serializedAdditionalRawData) + /// InternalNetwork BMP Configuration. + /// V4 over V6 bgp session. + /// v6 over v4 bgp session. + /// Keeps track of any properties unknown to the library. + internal BgpConfiguration(string annotation, BfdConfiguration bfdConfiguration, NetworkFabricBooleanValue? defaultRouteOriginate, int? allowAS, AllowASOverride? allowASOverride, long? fabricAsn, long? peerAsn, IList ipv4ListenRangePrefixes, IList ipv6ListenRangePrefixes, IList ipv4NeighborAddress, IList ipv6NeighborAddress, InternalNetworkBmpProperties bmpConfiguration, V4OverV6BgpSessionState? v4OverV6BgpSession, V6OverV4BgpSessionState? v6OverV4BgpSession, IDictionary serializedAdditionalRawData) { + Annotation = annotation; BfdConfiguration = bfdConfiguration; DefaultRouteOriginate = defaultRouteOriginate; AllowAS = allowAS; @@ -47,8 +83,14 @@ internal BgpConfiguration(string annotation, IDictionary ser IPv6ListenRangePrefixes = ipv6ListenRangePrefixes; IPv4NeighborAddress = ipv4NeighborAddress; IPv6NeighborAddress = ipv6NeighborAddress; + BmpConfiguration = bmpConfiguration; + V4OverV6BgpSession = v4OverV6BgpSession; + V6OverV4BgpSession = v6OverV4BgpSession; + _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Switch configuration description. + public string Annotation { get; set; } /// BFD configuration properties. public BfdConfiguration BfdConfiguration { get; set; } /// Originate a defaultRoute. Ex: "True" | "False". @@ -69,5 +111,11 @@ internal BgpConfiguration(string annotation, IDictionary ser public IList IPv4NeighborAddress { get; } /// List with stringified IPv6 Neighbor Address. public IList IPv6NeighborAddress { get; } + /// InternalNetwork BMP Configuration. + public InternalNetworkBmpProperties BmpConfiguration { get; set; } + /// V4 over V6 bgp session. + public V4OverV6BgpSessionState? V4OverV6BgpSession { get; set; } + /// v6 over v4 bgp session. + public V6OverV4BgpSessionState? V6OverV4BgpSession { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BgpPatchConfiguration.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BgpPatchConfiguration.Serialization.cs new file mode 100644 index 000000000000..a6dace325a1b --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BgpPatchConfiguration.Serialization.cs @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class BgpPatchConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BgpPatchConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (Optional.IsDefined(BfdConfiguration)) + { + writer.WritePropertyName("bfdConfiguration"u8); + writer.WriteObjectValue(BfdConfiguration, options); + } + if (Optional.IsDefined(DefaultRouteOriginate)) + { + writer.WritePropertyName("defaultRouteOriginate"u8); + writer.WriteStringValue(DefaultRouteOriginate.Value.ToString()); + } + if (Optional.IsDefined(AllowAS)) + { + writer.WritePropertyName("allowAS"u8); + writer.WriteNumberValue(AllowAS.Value); + } + if (Optional.IsDefined(AllowASOverride)) + { + writer.WritePropertyName("allowASOverride"u8); + writer.WriteStringValue(AllowASOverride.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(FabricAsn)) + { + writer.WritePropertyName("fabricASN"u8); + writer.WriteNumberValue(FabricAsn.Value); + } + if (Optional.IsDefined(PeerAsn)) + { + writer.WritePropertyName("peerASN"u8); + writer.WriteNumberValue(PeerAsn.Value); + } + if (Optional.IsCollectionDefined(IPv4ListenRangePrefixes)) + { + writer.WritePropertyName("ipv4ListenRangePrefixes"u8); + writer.WriteStartArray(); + foreach (var item in IPv4ListenRangePrefixes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(IPv6ListenRangePrefixes)) + { + writer.WritePropertyName("ipv6ListenRangePrefixes"u8); + writer.WriteStartArray(); + foreach (var item in IPv6ListenRangePrefixes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(IPv4NeighborAddress)) + { + writer.WritePropertyName("ipv4NeighborAddress"u8); + writer.WriteStartArray(); + foreach (var item in IPv4NeighborAddress) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(IPv6NeighborAddress)) + { + writer.WritePropertyName("ipv6NeighborAddress"u8); + writer.WriteStartArray(); + foreach (var item in IPv6NeighborAddress) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(BmpConfiguration)) + { + writer.WritePropertyName("bmpConfiguration"u8); + writer.WriteObjectValue(BmpConfiguration, options); + } + if (Optional.IsDefined(V4OverV6BgpSession)) + { + writer.WritePropertyName("v4OverV6BgpSession"u8); + writer.WriteStringValue(V4OverV6BgpSession.Value.ToString()); + } + if (Optional.IsDefined(V6OverV4BgpSession)) + { + writer.WritePropertyName("v6OverV4BgpSession"u8); + writer.WriteStringValue(V6OverV4BgpSession.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BgpPatchConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BgpPatchConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBgpPatchConfiguration(document.RootElement, options); + } + + internal static BgpPatchConfiguration DeserializeBgpPatchConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + BfdPatchConfiguration bfdConfiguration = default; + NetworkFabricBooleanValue? defaultRouteOriginate = default; + int? allowAS = default; + AllowASOverride? allowASOverride = default; + long? fabricAsn = default; + long? peerAsn = default; + IList ipv4ListenRangePrefixes = default; + IList ipv6ListenRangePrefixes = default; + IList ipv4NeighborAddress = default; + IList ipv6NeighborAddress = default; + InternalNetworkBmpPatchProperties bmpConfiguration = default; + V4OverV6BgpSessionState? v4OverV6BgpSession = default; + V6OverV4BgpSessionState? v6OverV4BgpSession = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("bfdConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bfdConfiguration = BfdPatchConfiguration.DeserializeBfdPatchConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("defaultRouteOriginate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultRouteOriginate = new NetworkFabricBooleanValue(property.Value.GetString()); + continue; + } + if (property.NameEquals("allowAS"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowAS = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("allowASOverride"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowASOverride = new AllowASOverride(property.Value.GetString()); + continue; + } + if (property.NameEquals("fabricASN"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fabricAsn = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("peerASN"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peerAsn = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("ipv4ListenRangePrefixes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipv4ListenRangePrefixes = array; + continue; + } + if (property.NameEquals("ipv6ListenRangePrefixes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipv6ListenRangePrefixes = array; + continue; + } + if (property.NameEquals("ipv4NeighborAddress"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeighborAddressPatch.DeserializeNeighborAddressPatch(item, options)); + } + ipv4NeighborAddress = array; + continue; + } + if (property.NameEquals("ipv6NeighborAddress"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeighborAddressPatch.DeserializeNeighborAddressPatch(item, options)); + } + ipv6NeighborAddress = array; + continue; + } + if (property.NameEquals("bmpConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bmpConfiguration = InternalNetworkBmpPatchProperties.DeserializeInternalNetworkBmpPatchProperties(property.Value, options); + continue; + } + if (property.NameEquals("v4OverV6BgpSession"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + v4OverV6BgpSession = new V4OverV6BgpSessionState(property.Value.GetString()); + continue; + } + if (property.NameEquals("v6OverV4BgpSession"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + v6OverV4BgpSession = new V6OverV4BgpSessionState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BgpPatchConfiguration( + annotation, + bfdConfiguration, + defaultRouteOriginate, + allowAS, + allowASOverride, + fabricAsn, + peerAsn, + ipv4ListenRangePrefixes ?? new ChangeTrackingList(), + ipv6ListenRangePrefixes ?? new ChangeTrackingList(), + ipv4NeighborAddress ?? new ChangeTrackingList(), + ipv6NeighborAddress ?? new ChangeTrackingList(), + bmpConfiguration, + v4OverV6BgpSession, + v6OverV4BgpSession, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(BgpPatchConfiguration)} does not support writing '{options.Format}' format."); + } + } + + BgpPatchConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBgpPatchConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BgpPatchConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BgpPatchConfiguration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BgpPatchConfiguration.cs new file mode 100644 index 000000000000..7ae03cf8459f --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BgpPatchConfiguration.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// BGP configuration properties. + public partial class BgpPatchConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BgpPatchConfiguration() + { + IPv4ListenRangePrefixes = new ChangeTrackingList(); + IPv6ListenRangePrefixes = new ChangeTrackingList(); + IPv4NeighborAddress = new ChangeTrackingList(); + IPv6NeighborAddress = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// BFD configuration properties. + /// Originate a defaultRoute. Ex: "True" | "False". + /// Allows for routes to be received and processed even if the router detects its own ASN in the AS-Path. 0 is disable, Possible values are 1-10, default is 2. + /// Enable Or Disable state. + /// ASN of Network Fabric. Example: 65048. + /// Peer ASN. Example: 65047. + /// List of BGP IPv4 Listen Range prefixes. + /// List of BGP IPv6 Listen Ranges prefixes. + /// List with stringified IPv4 Neighbor Addresses. + /// List with stringified IPv6 Neighbor Address. + /// InternalNetwork BMP Configuration. + /// V4 over V6 bgp session. + /// v6 over v4 bgp session. + /// Keeps track of any properties unknown to the library. + internal BgpPatchConfiguration(string annotation, BfdPatchConfiguration bfdConfiguration, NetworkFabricBooleanValue? defaultRouteOriginate, int? allowAS, AllowASOverride? allowASOverride, long? fabricAsn, long? peerAsn, IList ipv4ListenRangePrefixes, IList ipv6ListenRangePrefixes, IList ipv4NeighborAddress, IList ipv6NeighborAddress, InternalNetworkBmpPatchProperties bmpConfiguration, V4OverV6BgpSessionState? v4OverV6BgpSession, V6OverV4BgpSessionState? v6OverV4BgpSession, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + BfdConfiguration = bfdConfiguration; + DefaultRouteOriginate = defaultRouteOriginate; + AllowAS = allowAS; + AllowASOverride = allowASOverride; + FabricAsn = fabricAsn; + PeerAsn = peerAsn; + IPv4ListenRangePrefixes = ipv4ListenRangePrefixes; + IPv6ListenRangePrefixes = ipv6ListenRangePrefixes; + IPv4NeighborAddress = ipv4NeighborAddress; + IPv6NeighborAddress = ipv6NeighborAddress; + BmpConfiguration = bmpConfiguration; + V4OverV6BgpSession = v4OverV6BgpSession; + V6OverV4BgpSession = v6OverV4BgpSession; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// BFD configuration properties. + public BfdPatchConfiguration BfdConfiguration { get; set; } + /// Originate a defaultRoute. Ex: "True" | "False". + public NetworkFabricBooleanValue? DefaultRouteOriginate { get; set; } + /// Allows for routes to be received and processed even if the router detects its own ASN in the AS-Path. 0 is disable, Possible values are 1-10, default is 2. + public int? AllowAS { get; set; } + /// Enable Or Disable state. + public AllowASOverride? AllowASOverride { get; set; } + /// ASN of Network Fabric. Example: 65048. + public long? FabricAsn { get; } + /// Peer ASN. Example: 65047. + public long? PeerAsn { get; set; } + /// List of BGP IPv4 Listen Range prefixes. + public IList IPv4ListenRangePrefixes { get; } + /// List of BGP IPv6 Listen Ranges prefixes. + public IList IPv6ListenRangePrefixes { get; } + /// List with stringified IPv4 Neighbor Addresses. + public IList IPv4NeighborAddress { get; } + /// List with stringified IPv6 Neighbor Address. + public IList IPv6NeighborAddress { get; } + /// InternalNetwork BMP Configuration. + public InternalNetworkBmpPatchProperties BmpConfiguration { get; set; } + /// V4 over V6 bgp session. + public V4OverV6BgpSessionState? V4OverV6BgpSession { get; set; } + /// v6 over v4 bgp session. + public V6OverV4BgpSessionState? V6OverV4BgpSession { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BitRate.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BitRate.Serialization.cs new file mode 100644 index 000000000000..1bc50f83149d --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BitRate.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class BitRate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BitRate)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Rate)) + { + writer.WritePropertyName("rate"u8); + writer.WriteNumberValue(Rate.Value); + } + if (Optional.IsDefined(Unit)) + { + writer.WritePropertyName("unit"u8); + writer.WriteStringValue(Unit.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BitRate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BitRate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBitRate(document.RootElement, options); + } + + internal static BitRate DeserializeBitRate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? rate = default; + BitRateUnit? unit = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("rate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rate = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("unit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + unit = new BitRateUnit(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BitRate(rate, unit, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(BitRate)} does not support writing '{options.Format}' format."); + } + } + + BitRate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBitRate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BitRate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BitRate.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BitRate.cs new file mode 100644 index 000000000000..576d4b7d3dc9 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BitRate.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Bit rate in bits per second. + public partial class BitRate + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BitRate() + { + } + + /// Initializes a new instance of . + /// Bitrate. + /// Bitrate unit. + /// Keeps track of any properties unknown to the library. + internal BitRate(long? rate, BitRateUnit? unit, IDictionary serializedAdditionalRawData) + { + Rate = rate; + Unit = unit; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Bitrate. + public long? Rate { get; set; } + /// Bitrate unit. + public BitRateUnit? Unit { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BitRateUnit.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BitRateUnit.cs new file mode 100644 index 000000000000..48567801b7f4 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BitRateUnit.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Bit rate unit. + public readonly partial struct BitRateUnit : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BitRateUnit(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string BpsValue = "bps"; + private const string KbpsValue = "Kbps"; + private const string MbpsValue = "Mbps"; + private const string GbpsValue = "Gbps"; + + /// Bit rate unit in bits per second. + public static BitRateUnit Bps { get; } = new BitRateUnit(BpsValue); + /// Bit rate unit in kilobits per second. + public static BitRateUnit Kbps { get; } = new BitRateUnit(KbpsValue); + /// Bit rate unit in megabits per second. + public static BitRateUnit Mbps { get; } = new BitRateUnit(MbpsValue); + /// Bit rate unit in gigabits per second. + public static BitRateUnit Gbps { get; } = new BitRateUnit(GbpsValue); + /// Determines if two values are the same. + public static bool operator ==(BitRateUnit left, BitRateUnit right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BitRateUnit left, BitRateUnit right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BitRateUnit(string value) => new BitRateUnit(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BitRateUnit other && Equals(other); + /// + public bool Equals(BitRateUnit other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpConfigurationPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpConfigurationPatchProperties.Serialization.cs new file mode 100644 index 000000000000..6d92f0c7cf7f --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpConfigurationPatchProperties.Serialization.cs @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class BmpConfigurationPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BmpConfigurationPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(StationConfigurationState)) + { + writer.WritePropertyName("stationConfigurationState"u8); + writer.WriteStringValue(StationConfigurationState.Value.ToString()); + } + if (Optional.IsDefined(ScopeResourceId)) + { + writer.WritePropertyName("scopeResourceId"u8); + writer.WriteStringValue(ScopeResourceId); + } + if (Optional.IsDefined(StationName)) + { + writer.WritePropertyName("stationName"u8); + writer.WriteStringValue(StationName); + } + if (Optional.IsDefined(StationIP)) + { + writer.WritePropertyName("stationIp"u8); + writer.WriteStringValue(StationIP); + } + if (Optional.IsDefined(StationPort)) + { + writer.WritePropertyName("stationPort"u8); + writer.WriteNumberValue(StationPort.Value); + } + if (Optional.IsDefined(StationConnectionMode)) + { + writer.WritePropertyName("stationConnectionMode"u8); + writer.WriteStringValue(StationConnectionMode.Value.ToString()); + } + if (Optional.IsDefined(StationConnectionProperties)) + { + writer.WritePropertyName("stationConnectionProperties"u8); + writer.WriteObjectValue(StationConnectionProperties, options); + } + if (Optional.IsDefined(StationNetwork)) + { + writer.WritePropertyName("stationNetwork"u8); + writer.WriteStringValue(StationNetwork); + } + if (Optional.IsCollectionDefined(MonitoredNetworks)) + { + writer.WritePropertyName("monitoredNetworks"u8); + writer.WriteStartArray(); + foreach (var item in MonitoredNetworks) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ExportPolicy)) + { + writer.WritePropertyName("exportPolicy"u8); + writer.WriteStringValue(ExportPolicy.Value.ToString()); + } + if (Optional.IsCollectionDefined(MonitoredAddressFamilies)) + { + writer.WritePropertyName("monitoredAddressFamilies"u8); + writer.WriteStartArray(); + foreach (var item in MonitoredAddressFamilies) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BmpConfigurationPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BmpConfigurationPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBmpConfigurationPatchProperties(document.RootElement, options); + } + + internal static BmpConfigurationPatchProperties DeserializeBmpConfigurationPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + StationConfigurationState? stationConfigurationState = default; + ResourceIdentifier scopeResourceId = default; + string stationName = default; + string stationIP = default; + int? stationPort = default; + StationConnectionMode? stationConnectionMode = default; + StationConnectionPatchProperties stationConnectionProperties = default; + ResourceIdentifier stationNetwork = default; + IList monitoredNetworks = default; + BmpExportPolicy? exportPolicy = default; + IList monitoredAddressFamilies = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("stationConfigurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stationConfigurationState = new StationConfigurationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("scopeResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scopeResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("stationName"u8)) + { + stationName = property.Value.GetString(); + continue; + } + if (property.NameEquals("stationIp"u8)) + { + stationIP = property.Value.GetString(); + continue; + } + if (property.NameEquals("stationPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stationPort = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("stationConnectionMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stationConnectionMode = new StationConnectionMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("stationConnectionProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stationConnectionProperties = StationConnectionPatchProperties.DeserializeStationConnectionPatchProperties(property.Value, options); + continue; + } + if (property.NameEquals("stationNetwork"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stationNetwork = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("monitoredNetworks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + monitoredNetworks = array; + continue; + } + if (property.NameEquals("exportPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exportPolicy = new BmpExportPolicy(property.Value.GetString()); + continue; + } + if (property.NameEquals("monitoredAddressFamilies"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new BmpMonitoredAddressFamily(item.GetString())); + } + monitoredAddressFamilies = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BmpConfigurationPatchProperties( + stationConfigurationState, + scopeResourceId, + stationName, + stationIP, + stationPort, + stationConnectionMode, + stationConnectionProperties, + stationNetwork, + monitoredNetworks ?? new ChangeTrackingList(), + exportPolicy, + monitoredAddressFamilies ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(BmpConfigurationPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + BmpConfigurationPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBmpConfigurationPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BmpConfigurationPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpConfigurationPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpConfigurationPatchProperties.cs new file mode 100644 index 000000000000..38342b5e3a6b --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpConfigurationPatchProperties.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// BMP Configuration patch properties. + public partial class BmpConfigurationPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BmpConfigurationPatchProperties() + { + MonitoredNetworks = new ChangeTrackingList(); + MonitoredAddressFamilies = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Enabling a station. Either True/False. + /// Scope resource ARM Identifier. + /// Name of the station. + /// IP Address of the station. + /// Port of the station. Default value is 5000. + /// Station Connection Mode. + /// Station Connection Properties. + /// Network of the station. + /// The List of Network ID's that need to be monitored. + /// Export Policy for the BMP Configuration. + /// Monitored Address Families for the BMP Configuration. + /// Keeps track of any properties unknown to the library. + internal BmpConfigurationPatchProperties(StationConfigurationState? stationConfigurationState, ResourceIdentifier scopeResourceId, string stationName, string stationIP, int? stationPort, StationConnectionMode? stationConnectionMode, StationConnectionPatchProperties stationConnectionProperties, ResourceIdentifier stationNetwork, IList monitoredNetworks, BmpExportPolicy? exportPolicy, IList monitoredAddressFamilies, IDictionary serializedAdditionalRawData) + { + StationConfigurationState = stationConfigurationState; + ScopeResourceId = scopeResourceId; + StationName = stationName; + StationIP = stationIP; + StationPort = stationPort; + StationConnectionMode = stationConnectionMode; + StationConnectionProperties = stationConnectionProperties; + StationNetwork = stationNetwork; + MonitoredNetworks = monitoredNetworks; + ExportPolicy = exportPolicy; + MonitoredAddressFamilies = monitoredAddressFamilies; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Enabling a station. Either True/False. + public StationConfigurationState? StationConfigurationState { get; set; } + /// Scope resource ARM Identifier. + public ResourceIdentifier ScopeResourceId { get; set; } + /// Name of the station. + public string StationName { get; set; } + /// IP Address of the station. + public string StationIP { get; set; } + /// Port of the station. Default value is 5000. + public int? StationPort { get; set; } + /// Station Connection Mode. + public StationConnectionMode? StationConnectionMode { get; set; } + /// Station Connection Properties. + public StationConnectionPatchProperties StationConnectionProperties { get; set; } + /// Network of the station. + public ResourceIdentifier StationNetwork { get; set; } + /// The List of Network ID's that need to be monitored. + public IList MonitoredNetworks { get; } + /// Export Policy for the BMP Configuration. + public BmpExportPolicy? ExportPolicy { get; set; } + /// Monitored Address Families for the BMP Configuration. + public IList MonitoredAddressFamilies { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpConfigurationProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpConfigurationProperties.Serialization.cs new file mode 100644 index 000000000000..bb495cd1ae6e --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpConfigurationProperties.Serialization.cs @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class BmpConfigurationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BmpConfigurationProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(StationConfigurationState)) + { + writer.WritePropertyName("stationConfigurationState"u8); + writer.WriteStringValue(StationConfigurationState.Value.ToString()); + } + if (Optional.IsDefined(ScopeResourceId)) + { + writer.WritePropertyName("scopeResourceId"u8); + writer.WriteStringValue(ScopeResourceId); + } + if (Optional.IsDefined(StationName)) + { + writer.WritePropertyName("stationName"u8); + writer.WriteStringValue(StationName); + } + if (Optional.IsDefined(StationIP)) + { + writer.WritePropertyName("stationIp"u8); + writer.WriteStringValue(StationIP); + } + if (Optional.IsDefined(StationPort)) + { + writer.WritePropertyName("stationPort"u8); + writer.WriteNumberValue(StationPort.Value); + } + if (Optional.IsDefined(StationConnectionMode)) + { + writer.WritePropertyName("stationConnectionMode"u8); + writer.WriteStringValue(StationConnectionMode.Value.ToString()); + } + if (Optional.IsDefined(StationConnectionProperties)) + { + writer.WritePropertyName("stationConnectionProperties"u8); + writer.WriteObjectValue(StationConnectionProperties, options); + } + if (Optional.IsDefined(StationNetwork)) + { + writer.WritePropertyName("stationNetwork"u8); + writer.WriteStringValue(StationNetwork); + } + if (Optional.IsCollectionDefined(MonitoredNetworks)) + { + writer.WritePropertyName("monitoredNetworks"u8); + writer.WriteStartArray(); + foreach (var item in MonitoredNetworks) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ExportPolicy)) + { + writer.WritePropertyName("exportPolicy"u8); + writer.WriteStringValue(ExportPolicy.Value.ToString()); + } + if (Optional.IsCollectionDefined(MonitoredAddressFamilies)) + { + writer.WritePropertyName("monitoredAddressFamilies"u8); + writer.WriteStartArray(); + foreach (var item in MonitoredAddressFamilies) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BmpConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BmpConfigurationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBmpConfigurationProperties(document.RootElement, options); + } + + internal static BmpConfigurationProperties DeserializeBmpConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + StationConfigurationState? stationConfigurationState = default; + ResourceIdentifier scopeResourceId = default; + string stationName = default; + string stationIP = default; + int? stationPort = default; + StationConnectionMode? stationConnectionMode = default; + StationConnectionProperties stationConnectionProperties = default; + ResourceIdentifier stationNetwork = default; + IList monitoredNetworks = default; + BmpExportPolicy? exportPolicy = default; + IList monitoredAddressFamilies = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("stationConfigurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stationConfigurationState = new StationConfigurationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("scopeResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scopeResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("stationName"u8)) + { + stationName = property.Value.GetString(); + continue; + } + if (property.NameEquals("stationIp"u8)) + { + stationIP = property.Value.GetString(); + continue; + } + if (property.NameEquals("stationPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stationPort = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("stationConnectionMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stationConnectionMode = new StationConnectionMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("stationConnectionProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stationConnectionProperties = StationConnectionProperties.DeserializeStationConnectionProperties(property.Value, options); + continue; + } + if (property.NameEquals("stationNetwork"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stationNetwork = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("monitoredNetworks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + monitoredNetworks = array; + continue; + } + if (property.NameEquals("exportPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exportPolicy = new BmpExportPolicy(property.Value.GetString()); + continue; + } + if (property.NameEquals("monitoredAddressFamilies"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new BmpMonitoredAddressFamily(item.GetString())); + } + monitoredAddressFamilies = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BmpConfigurationProperties( + stationConfigurationState, + scopeResourceId, + stationName, + stationIP, + stationPort, + stationConnectionMode, + stationConnectionProperties, + stationNetwork, + monitoredNetworks ?? new ChangeTrackingList(), + exportPolicy, + monitoredAddressFamilies ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(BmpConfigurationProperties)} does not support writing '{options.Format}' format."); + } + } + + BmpConfigurationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBmpConfigurationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BmpConfigurationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpConfigurationProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpConfigurationProperties.cs new file mode 100644 index 000000000000..b5498f070b34 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpConfigurationProperties.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// BGP Monitoring Protocol (BMP) Configuration properties. + public partial class BmpConfigurationProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BmpConfigurationProperties() + { + MonitoredNetworks = new ChangeTrackingList(); + MonitoredAddressFamilies = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Enabling a station. Either True/False. + /// Scope resource ARM Identifier. + /// Name of the station. + /// IP Address of the station. + /// Port of the station. Default value is 5000. + /// Station Connection Mode. + /// Station Connection Properties. + /// Network of the station. + /// The List of Network ID's that need to be monitored. + /// Export Policy for the BMP Configuration. + /// Monitored Address Families for the BMP Configuration. + /// Keeps track of any properties unknown to the library. + internal BmpConfigurationProperties(StationConfigurationState? stationConfigurationState, ResourceIdentifier scopeResourceId, string stationName, string stationIP, int? stationPort, StationConnectionMode? stationConnectionMode, StationConnectionProperties stationConnectionProperties, ResourceIdentifier stationNetwork, IList monitoredNetworks, BmpExportPolicy? exportPolicy, IList monitoredAddressFamilies, IDictionary serializedAdditionalRawData) + { + StationConfigurationState = stationConfigurationState; + ScopeResourceId = scopeResourceId; + StationName = stationName; + StationIP = stationIP; + StationPort = stationPort; + StationConnectionMode = stationConnectionMode; + StationConnectionProperties = stationConnectionProperties; + StationNetwork = stationNetwork; + MonitoredNetworks = monitoredNetworks; + ExportPolicy = exportPolicy; + MonitoredAddressFamilies = monitoredAddressFamilies; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Enabling a station. Either True/False. + public StationConfigurationState? StationConfigurationState { get; set; } + /// Scope resource ARM Identifier. + public ResourceIdentifier ScopeResourceId { get; set; } + /// Name of the station. + public string StationName { get; set; } + /// IP Address of the station. + public string StationIP { get; set; } + /// Port of the station. Default value is 5000. + public int? StationPort { get; set; } + /// Station Connection Mode. + public StationConnectionMode? StationConnectionMode { get; set; } + /// Station Connection Properties. + public StationConnectionProperties StationConnectionProperties { get; set; } + /// Network of the station. + public ResourceIdentifier StationNetwork { get; set; } + /// The List of Network ID's that need to be monitored. + public IList MonitoredNetworks { get; } + /// Export Policy for the BMP Configuration. + public BmpExportPolicy? ExportPolicy { get; set; } + /// Monitored Address Families for the BMP Configuration. + public IList MonitoredAddressFamilies { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpConfigurationState.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpConfigurationState.cs new file mode 100644 index 000000000000..6c97f60e2f41 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpConfigurationState.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// BGP Monitoring Protocol (BMP) configuration state. + public readonly partial struct BmpConfigurationState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BmpConfigurationState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// BGP Monitoring Protocol (BMP) ConfigurationState - Enabled. + public static BmpConfigurationState Enabled { get; } = new BmpConfigurationState(EnabledValue); + /// BGP Monitoring Protocol (BMP) ConfigurationState - Disabled. + public static BmpConfigurationState Disabled { get; } = new BmpConfigurationState(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(BmpConfigurationState left, BmpConfigurationState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BmpConfigurationState left, BmpConfigurationState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BmpConfigurationState(string value) => new BmpConfigurationState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BmpConfigurationState other && Equals(other); + /// + public bool Equals(BmpConfigurationState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpExportPolicy.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpExportPolicy.cs new file mode 100644 index 000000000000..9c36a8a8e80f --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpExportPolicy.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Export Policy for the BMP Configuration. + public readonly partial struct BmpExportPolicy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BmpExportPolicy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PrePolicyValue = "Pre-Policy"; + private const string PostPolicyValue = "Post-Policy"; + private const string AllValue = "All"; + + /// BMP ExportPolicy Pre-Policy. + public static BmpExportPolicy PrePolicy { get; } = new BmpExportPolicy(PrePolicyValue); + /// BMP ExportPolicy Post-Policy. + public static BmpExportPolicy PostPolicy { get; } = new BmpExportPolicy(PostPolicyValue); + /// BMP ExportPolicy All. + public static BmpExportPolicy All { get; } = new BmpExportPolicy(AllValue); + /// Determines if two values are the same. + public static bool operator ==(BmpExportPolicy left, BmpExportPolicy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BmpExportPolicy left, BmpExportPolicy right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BmpExportPolicy(string value) => new BmpExportPolicy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BmpExportPolicy other && Equals(other); + /// + public bool Equals(BmpExportPolicy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpMonitoredAddressFamily.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpMonitoredAddressFamily.cs new file mode 100644 index 000000000000..7c1f5334d36a --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BmpMonitoredAddressFamily.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Monitored Address Family. + public readonly partial struct BmpMonitoredAddressFamily : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BmpMonitoredAddressFamily(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string IPv4UnicastValue = "ipv4Unicast"; + private const string IPv6UnicastValue = "ipv6Unicast"; + private const string VpnIPv4Value = "vpnIpv4"; + private const string VpnIPv6Value = "vpnIpv6"; + private const string AllValue = "All"; + + /// IPv4 Unicast. + public static BmpMonitoredAddressFamily IPv4Unicast { get; } = new BmpMonitoredAddressFamily(IPv4UnicastValue); + /// IPv6 Unicast. + public static BmpMonitoredAddressFamily IPv6Unicast { get; } = new BmpMonitoredAddressFamily(IPv6UnicastValue); + /// VPN IPv4. + public static BmpMonitoredAddressFamily VpnIPv4 { get; } = new BmpMonitoredAddressFamily(VpnIPv4Value); + /// VPN IPv6. + public static BmpMonitoredAddressFamily VpnIPv6 { get; } = new BmpMonitoredAddressFamily(VpnIPv6Value); + /// All Address Families. + public static BmpMonitoredAddressFamily All { get; } = new BmpMonitoredAddressFamily(AllValue); + /// Determines if two values are the same. + public static bool operator ==(BmpMonitoredAddressFamily left, BmpMonitoredAddressFamily right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BmpMonitoredAddressFamily left, BmpMonitoredAddressFamily right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BmpMonitoredAddressFamily(string value) => new BmpMonitoredAddressFamily(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BmpMonitoredAddressFamily other && Equals(other); + /// + public bool Equals(BmpMonitoredAddressFamily other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BurstSize.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BurstSize.Serialization.cs new file mode 100644 index 000000000000..432b98a3a227 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BurstSize.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class BurstSize : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BurstSize)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Size)) + { + writer.WritePropertyName("size"u8); + writer.WriteNumberValue(Size.Value); + } + if (Optional.IsDefined(Unit)) + { + writer.WritePropertyName("unit"u8); + writer.WriteStringValue(Unit.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BurstSize IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BurstSize)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBurstSize(document.RootElement, options); + } + + internal static BurstSize DeserializeBurstSize(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? size = default; + BurstSizeUnit? unit = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("size"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + size = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("unit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + unit = new BurstSizeUnit(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BurstSize(size, unit, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(BurstSize)} does not support writing '{options.Format}' format."); + } + } + + BurstSize IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBurstSize(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BurstSize)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BurstSize.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BurstSize.cs new file mode 100644 index 000000000000..1bb9b3bb1919 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BurstSize.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Burst size in packets. + public partial class BurstSize + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BurstSize() + { + } + + /// Initializes a new instance of . + /// Burst size. + /// Burst size unit. + /// Keeps track of any properties unknown to the library. + internal BurstSize(long? size, BurstSizeUnit? unit, IDictionary serializedAdditionalRawData) + { + Size = size; + Unit = unit; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Burst size. + public long? Size { get; set; } + /// Burst size unit. + public BurstSizeUnit? Unit { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BurstSizeUnit.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BurstSizeUnit.cs new file mode 100644 index 000000000000..7cc2109c6938 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/BurstSizeUnit.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Burst size unit in packets. + public readonly partial struct BurstSizeUnit : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BurstSizeUnit(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string BytesValue = "Bytes"; + private const string KBytesValue = "KBytes"; + private const string MBytesValue = "MBytes"; + private const string GBytesValue = "GBytes"; + + /// Burst size unit in bytes. + public static BurstSizeUnit Bytes { get; } = new BurstSizeUnit(BytesValue); + /// Burst size unit in kilobytes. + public static BurstSizeUnit KBytes { get; } = new BurstSizeUnit(KBytesValue); + /// Burst size unit in megabytes. + public static BurstSizeUnit MBytes { get; } = new BurstSizeUnit(MBytesValue); + /// Burst size unit in gigabytes. + public static BurstSizeUnit GBytes { get; } = new BurstSizeUnit(GBytesValue); + /// Determines if two values are the same. + public static bool operator ==(BurstSizeUnit left, BurstSizeUnit right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BurstSizeUnit left, BurstSizeUnit right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BurstSizeUnit(string value) => new BurstSizeUnit(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BurstSizeUnit other && Equals(other); + /// + public bool Equals(BurstSizeUnit other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchDetails.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchDetails.Serialization.cs new file mode 100644 index 000000000000..04f308248b6e --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchDetails.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class CommitBatchDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CommitBatchDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(FailedDevices)) + { + writer.WritePropertyName("failedDevices"u8); + writer.WriteStartArray(); + foreach (var item in FailedDevices) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CommitBatchDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CommitBatchDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCommitBatchDetails(document.RootElement, options); + } + + internal static CommitBatchDetails DeserializeCommitBatchDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList failedDevices = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("failedDevices"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + failedDevices = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CommitBatchDetails(failedDevices ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(CommitBatchDetails)} does not support writing '{options.Format}' format."); + } + } + + CommitBatchDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCommitBatchDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CommitBatchDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchDetails.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchDetails.cs new file mode 100644 index 000000000000..c0ded5777e27 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchDetails.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Commit Batch Details. + internal partial class CommitBatchDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal CommitBatchDetails() + { + FailedDevices = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of devices for which the commit operation failed. + /// Keeps track of any properties unknown to the library. + internal CommitBatchDetails(IReadOnlyList failedDevices, IDictionary serializedAdditionalRawData) + { + FailedDevices = failedDevices; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of devices for which the commit operation failed. + public IReadOnlyList FailedDevices { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchState.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchState.cs new file mode 100644 index 000000000000..e3cb73e7d182 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchState.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Commit Batch State. + public readonly partial struct CommitBatchState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CommitBatchState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ProcessingValue = "Processing"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + + /// CommitBatchState-PartialSuccess. + public static CommitBatchState Processing { get; } = new CommitBatchState(ProcessingValue); + /// CommitBatchState-Succeeded. + public static CommitBatchState Succeeded { get; } = new CommitBatchState(SucceededValue); + /// CommitBatchState-Failed. + public static CommitBatchState Failed { get; } = new CommitBatchState(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(CommitBatchState left, CommitBatchState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CommitBatchState left, CommitBatchState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CommitBatchState(string value) => new CommitBatchState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CommitBatchState other && Equals(other); + /// + public bool Equals(CommitBatchState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchStatusContent.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchStatusContent.Serialization.cs new file mode 100644 index 000000000000..be9b8af8f207 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchStatusContent.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class CommitBatchStatusContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CommitBatchStatusContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(CommitBatchId)) + { + writer.WritePropertyName("commitBatchId"u8); + writer.WriteStringValue(CommitBatchId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CommitBatchStatusContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CommitBatchStatusContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCommitBatchStatusContent(document.RootElement, options); + } + + internal static CommitBatchStatusContent DeserializeCommitBatchStatusContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string commitBatchId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("commitBatchId"u8)) + { + commitBatchId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CommitBatchStatusContent(commitBatchId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(CommitBatchStatusContent)} does not support writing '{options.Format}' format."); + } + } + + CommitBatchStatusContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCommitBatchStatusContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CommitBatchStatusContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchStatusContent.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchStatusContent.cs new file mode 100644 index 000000000000..6b59867c0826 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchStatusContent.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Commit Batch Status Request. + public partial class CommitBatchStatusContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public CommitBatchStatusContent() + { + } + + /// Initializes a new instance of . + /// Commit Batch Identifier. If not provided, the latest commit batch status will be returned. + /// Keeps track of any properties unknown to the library. + internal CommitBatchStatusContent(string commitBatchId, IDictionary serializedAdditionalRawData) + { + CommitBatchId = commitBatchId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Commit Batch Identifier. If not provided, the latest commit batch status will be returned. + public string CommitBatchId { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchStatusResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchStatusResult.Serialization.cs new file mode 100644 index 000000000000..5333bb4818d8 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchStatusResult.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class CommitBatchStatusResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CommitBatchStatusResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(CommitBatchId)) + { + writer.WritePropertyName("commitBatchId"u8); + writer.WriteStringValue(CommitBatchId); + } + if (options.Format != "W" && Optional.IsDefined(CommitBatchState)) + { + writer.WritePropertyName("commitBatchState"u8); + writer.WriteStringValue(CommitBatchState.Value.ToString()); + } + if (Optional.IsDefined(CommitBatchDetails)) + { + writer.WritePropertyName("commitBatchDetails"u8); + writer.WriteObjectValue(CommitBatchDetails, options); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + ((IJsonModel)Error).Write(writer, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CommitBatchStatusResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CommitBatchStatusResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCommitBatchStatusResult(document.RootElement, options); + } + + internal static CommitBatchStatusResult DeserializeCommitBatchStatusResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string commitBatchId = default; + CommitBatchState? commitBatchState = default; + CommitBatchDetails commitBatchDetails = default; + ResponseError error = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("commitBatchId"u8)) + { + commitBatchId = property.Value.GetString(); + continue; + } + if (property.NameEquals("commitBatchState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + commitBatchState = new CommitBatchState(property.Value.GetString()); + continue; + } + if (property.NameEquals("commitBatchDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + commitBatchDetails = CommitBatchDetails.DeserializeCommitBatchDetails(property.Value, options); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerManagedNetworkFabricContext.Default); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CommitBatchStatusResult(commitBatchId, commitBatchState, commitBatchDetails, error, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(CommitBatchStatusResult)} does not support writing '{options.Format}' format."); + } + } + + CommitBatchStatusResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCommitBatchStatusResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CommitBatchStatusResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchStatusResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchStatusResult.cs new file mode 100644 index 000000000000..7b54cdd35791 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommitBatchStatusResult.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Commit Batch Status Response. + public partial class CommitBatchStatusResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal CommitBatchStatusResult() + { + } + + /// Initializes a new instance of . + /// Commit Batch Identifier. + /// Commit Batch State. + /// Commit Batch Details. + /// The error object. + /// Keeps track of any properties unknown to the library. + internal CommitBatchStatusResult(string commitBatchId, CommitBatchState? commitBatchState, CommitBatchDetails commitBatchDetails, ResponseError error, IDictionary serializedAdditionalRawData) + { + CommitBatchId = commitBatchId; + CommitBatchState = commitBatchState; + CommitBatchDetails = commitBatchDetails; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Commit Batch Identifier. + public string CommitBatchId { get; } + /// Commit Batch State. + public CommitBatchState? CommitBatchState { get; } + /// Commit Batch Details. + internal CommitBatchDetails CommitBatchDetails { get; } + /// List of devices for which the commit operation failed. + public IReadOnlyList CommitBatchDetailsFailedDevices + { + get => CommitBatchDetails?.FailedDevices; + } + + /// The error object. + public ResponseError Error { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonDynamicMatchConfigurationPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonDynamicMatchConfigurationPatch.Serialization.cs new file mode 100644 index 000000000000..2c3cc8acb9a4 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonDynamicMatchConfigurationPatch.Serialization.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class CommonDynamicMatchConfigurationPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CommonDynamicMatchConfigurationPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(IPGroups)) + { + writer.WritePropertyName("ipGroups"u8); + writer.WriteStartArray(); + foreach (var item in IPGroups) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(VlanGroups)) + { + writer.WritePropertyName("vlanGroups"u8); + writer.WriteStartArray(); + foreach (var item in VlanGroups) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(PortGroups)) + { + writer.WritePropertyName("portGroups"u8); + writer.WriteStartArray(); + foreach (var item in PortGroups) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CommonDynamicMatchConfigurationPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CommonDynamicMatchConfigurationPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCommonDynamicMatchConfigurationPatch(document.RootElement, options); + } + + internal static CommonDynamicMatchConfigurationPatch DeserializeCommonDynamicMatchConfigurationPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList ipGroups = default; + IList vlanGroups = default; + IList portGroups = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipGroups"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IPGroupPatchProperties.DeserializeIPGroupPatchProperties(item, options)); + } + ipGroups = array; + continue; + } + if (property.NameEquals("vlanGroups"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VlanGroupPatchProperties.DeserializeVlanGroupPatchProperties(item, options)); + } + vlanGroups = array; + continue; + } + if (property.NameEquals("portGroups"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PortGroupPatchProperties.DeserializePortGroupPatchProperties(item, options)); + } + portGroups = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CommonDynamicMatchConfigurationPatch(ipGroups ?? new ChangeTrackingList(), vlanGroups ?? new ChangeTrackingList(), portGroups ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(CommonDynamicMatchConfigurationPatch)} does not support writing '{options.Format}' format."); + } + } + + CommonDynamicMatchConfigurationPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCommonDynamicMatchConfigurationPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CommonDynamicMatchConfigurationPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonDynamicMatchConfigurationPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonDynamicMatchConfigurationPatch.cs new file mode 100644 index 000000000000..fadc7ec1d181 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonDynamicMatchConfigurationPatch.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Dynamic match configuration object. + public partial class CommonDynamicMatchConfigurationPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public CommonDynamicMatchConfigurationPatch() + { + IPGroups = new ChangeTrackingList(); + VlanGroups = new ChangeTrackingList(); + PortGroups = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of IP Groups. + /// List of vlan groups. + /// List of the port groups. + /// Keeps track of any properties unknown to the library. + internal CommonDynamicMatchConfigurationPatch(IList ipGroups, IList vlanGroups, IList portGroups, IDictionary serializedAdditionalRawData) + { + IPGroups = ipGroups; + VlanGroups = vlanGroups; + PortGroups = portGroups; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of IP Groups. + public IList IPGroups { get; } + /// List of vlan groups. + public IList VlanGroups { get; } + /// List of the port groups. + public IList PortGroups { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonPostActionResponseForDeviceROCommands.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonPostActionResponseForDeviceROCommands.Serialization.cs new file mode 100644 index 000000000000..4897c580596e --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonPostActionResponseForDeviceROCommands.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class CommonPostActionResponseForDeviceROCommands : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CommonPostActionResponseForDeviceROCommands)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) + { + writer.WritePropertyName("configurationState"u8); + writer.WriteStringValue(ConfigurationState.Value.ToString()); + } + if (Optional.IsDefined(OutputUri)) + { + writer.WritePropertyName("outputUrl"u8); + writer.WriteStringValue(OutputUri.AbsoluteUri); + } + if (Optional.IsDefined(DeviceConfigurationPreview)) + { + writer.WritePropertyName("deviceConfigurationPreview"u8); + writer.WriteStringValue(DeviceConfigurationPreview); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CommonPostActionResponseForDeviceROCommands IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CommonPostActionResponseForDeviceROCommands)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCommonPostActionResponseForDeviceROCommands(document.RootElement, options); + } + + internal static CommonPostActionResponseForDeviceROCommands DeserializeCommonPostActionResponseForDeviceROCommands(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NetworkFabricConfigurationState? configurationState = default; + Uri outputUrl = default; + string deviceConfigurationPreview = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("configurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configurationState = new NetworkFabricConfigurationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("outputUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + outputUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("deviceConfigurationPreview"u8)) + { + deviceConfigurationPreview = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CommonPostActionResponseForDeviceROCommands(configurationState, outputUrl, deviceConfigurationPreview, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(CommonPostActionResponseForDeviceROCommands)} does not support writing '{options.Format}' format."); + } + } + + CommonPostActionResponseForDeviceROCommands IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCommonPostActionResponseForDeviceROCommands(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CommonPostActionResponseForDeviceROCommands)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonPostActionResponseForDeviceROCommands.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonPostActionResponseForDeviceROCommands.cs new file mode 100644 index 000000000000..caf0952eb640 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonPostActionResponseForDeviceROCommands.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Common response for device Ro Commands. + public partial class CommonPostActionResponseForDeviceROCommands + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal CommonPostActionResponseForDeviceROCommands() + { + } + + /// Initializes a new instance of . + /// Gets the configuration state. + /// Predefined link containing Device RO Command output. + /// Device RO command Response limited to 4000 characters. + /// Keeps track of any properties unknown to the library. + internal CommonPostActionResponseForDeviceROCommands(NetworkFabricConfigurationState? configurationState, Uri outputUri, string deviceConfigurationPreview, IDictionary serializedAdditionalRawData) + { + ConfigurationState = configurationState; + OutputUri = outputUri; + DeviceConfigurationPreview = deviceConfigurationPreview; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the configuration state. + public NetworkFabricConfigurationState? ConfigurationState { get; } + /// Predefined link containing Device RO Command output. + public Uri OutputUri { get; } + /// Device RO command Response limited to 4000 characters. + public string DeviceConfigurationPreview { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonPostActionResponseForDeviceROCommandsOperationStatusResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonPostActionResponseForDeviceROCommandsOperationStatusResult.Serialization.cs new file mode 100644 index 000000000000..3fed11a1fceb --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonPostActionResponseForDeviceROCommandsOperationStatusResult.Serialization.cs @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class CommonPostActionResponseForDeviceROCommandsOperationStatusResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CommonPostActionResponseForDeviceROCommandsOperationStatusResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + ((IJsonModel)Error).Write(writer, options); + } + if (options.Format != "W" && Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && Optional.IsDefined(ResourceId)) + { + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + } + if (options.Format != "W" && Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CommonPostActionResponseForDeviceROCommandsOperationStatusResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CommonPostActionResponseForDeviceROCommandsOperationStatusResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCommonPostActionResponseForDeviceROCommandsOperationStatusResult(document.RootElement, options); + } + + internal static CommonPostActionResponseForDeviceROCommandsOperationStatusResult DeserializeCommonPostActionResponseForDeviceROCommandsOperationStatusResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResponseError error = default; + DateTimeOffset? endTime = default; + string id = default; + string name = default; + CommonPostActionResponseForDeviceROCommands properties = default; + ResourceIdentifier resourceId = default; + DateTimeOffset? startTime = default; + string status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerManagedNetworkFabricContext.Default); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = CommonPostActionResponseForDeviceROCommands.DeserializeCommonPostActionResponseForDeviceROCommands(property.Value, options); + continue; + } + if (property.NameEquals("resourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CommonPostActionResponseForDeviceROCommandsOperationStatusResult( + error, + endTime, + id, + name, + properties, + resourceId, + startTime, + status, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(CommonPostActionResponseForDeviceROCommandsOperationStatusResult)} does not support writing '{options.Format}' format."); + } + } + + CommonPostActionResponseForDeviceROCommandsOperationStatusResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCommonPostActionResponseForDeviceROCommandsOperationStatusResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CommonPostActionResponseForDeviceROCommandsOperationStatusResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonPostActionResponseForDeviceROCommandsOperationStatusResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonPostActionResponseForDeviceROCommandsOperationStatusResult.cs new file mode 100644 index 000000000000..a450b4db383c --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonPostActionResponseForDeviceROCommandsOperationStatusResult.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The current status of an async operation. + public partial class CommonPostActionResponseForDeviceROCommandsOperationStatusResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Operation status. + /// is null. + internal CommonPostActionResponseForDeviceROCommandsOperationStatusResult(string status) + { + Argument.AssertNotNull(status, nameof(status)); + + Status = status; + } + + /// Initializes a new instance of . + /// The error object. + /// The end time of the operation. + /// Fully qualified ID for the async operation. + /// Name of the async operation. + /// The additional properties of the operation status result. + /// Fully qualified ID of the resource against which the original async operation was started. + /// The start time of the operation. + /// Operation status. + /// Keeps track of any properties unknown to the library. + internal CommonPostActionResponseForDeviceROCommandsOperationStatusResult(ResponseError error, DateTimeOffset? endOn, string id, string name, CommonPostActionResponseForDeviceROCommands properties, ResourceIdentifier resourceId, DateTimeOffset? startOn, string status, IDictionary serializedAdditionalRawData) + { + Error = error; + EndOn = endOn; + Id = id; + Name = name; + Properties = properties; + ResourceId = resourceId; + StartOn = startOn; + Status = status; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CommonPostActionResponseForDeviceROCommandsOperationStatusResult() + { + } + + /// The error object. + public ResponseError Error { get; } + /// The end time of the operation. + public DateTimeOffset? EndOn { get; } + /// Fully qualified ID for the async operation. + public string Id { get; } + /// Name of the async operation. + public string Name { get; } + /// The additional properties of the operation status result. + public CommonPostActionResponseForDeviceROCommands Properties { get; } + /// Fully qualified ID of the resource against which the original async operation was started. + public ResourceIdentifier ResourceId { get; } + /// The start time of the operation. + public DateTimeOffset? StartOn { get; } + /// Operation status. + public string Status { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonPostActionResponseForDeviceRWCommands.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonPostActionResponseForDeviceRWCommands.Serialization.cs new file mode 100644 index 000000000000..603ea5ad8919 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonPostActionResponseForDeviceRWCommands.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class CommonPostActionResponseForDeviceRWCommands : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CommonPostActionResponseForDeviceRWCommands)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + ((IJsonModel)Error).Write(writer, options); + } + if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) + { + writer.WritePropertyName("configurationState"u8); + writer.WriteStringValue(ConfigurationState.Value.ToString()); + } + if (Optional.IsDefined(OutputUri)) + { + writer.WritePropertyName("outputUrl"u8); + writer.WriteStringValue(OutputUri.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CommonPostActionResponseForDeviceRWCommands IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CommonPostActionResponseForDeviceRWCommands)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCommonPostActionResponseForDeviceRWCommands(document.RootElement, options); + } + + internal static CommonPostActionResponseForDeviceRWCommands DeserializeCommonPostActionResponseForDeviceRWCommands(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResponseError error = default; + NetworkFabricConfigurationState? configurationState = default; + Uri outputUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerManagedNetworkFabricContext.Default); + continue; + } + if (property.NameEquals("configurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configurationState = new NetworkFabricConfigurationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("outputUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + outputUrl = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CommonPostActionResponseForDeviceRWCommands(error, configurationState, outputUrl, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(CommonPostActionResponseForDeviceRWCommands)} does not support writing '{options.Format}' format."); + } + } + + CommonPostActionResponseForDeviceRWCommands IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCommonPostActionResponseForDeviceRWCommands(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CommonPostActionResponseForDeviceRWCommands)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonPostActionResponseForDeviceRWCommands.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonPostActionResponseForDeviceRWCommands.cs new file mode 100644 index 000000000000..fcadff57145a --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonPostActionResponseForDeviceRWCommands.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Common response for device Rw Commands. + public partial class CommonPostActionResponseForDeviceRWCommands + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal CommonPostActionResponseForDeviceRWCommands() + { + } + + /// Initializes a new instance of . + /// The error object. + /// Gets the configuration state. + /// Predefined link containing Device Rw Command output. + /// Keeps track of any properties unknown to the library. + internal CommonPostActionResponseForDeviceRWCommands(ResponseError error, NetworkFabricConfigurationState? configurationState, Uri outputUri, IDictionary serializedAdditionalRawData) + { + Error = error; + ConfigurationState = configurationState; + OutputUri = outputUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The error object. + public ResponseError Error { get; } + /// Gets the configuration state. + public NetworkFabricConfigurationState? ConfigurationState { get; } + /// Predefined link containing Device Rw Command output. + public Uri OutputUri { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommunityActionType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommunityActionType.cs index 1436f15ef499..4f01e233db5d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommunityActionType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommunityActionType.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// community action types. Example: Permit | Deny. + /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. public readonly partial struct CommunityActionType : IEquatable { private readonly string _value; @@ -25,9 +25,9 @@ public CommunityActionType(string value) private const string PermitValue = "Permit"; private const string DenyValue = "Deny"; - /// Permit. + /// Permit Community Action Types. public static CommunityActionType Permit { get; } = new CommunityActionType(PermitValue); - /// Deny. + /// Deny Community Action Types. public static CommunityActionType Deny { get; } = new CommunityActionType(DenyValue); /// Determines if two values are the same. public static bool operator ==(CommunityActionType left, CommunityActionType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConditionalDefaultRouteProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConditionalDefaultRouteProperties.Serialization.cs new file mode 100644 index 000000000000..77154812d2e8 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConditionalDefaultRouteProperties.Serialization.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class ConditionalDefaultRouteProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConditionalDefaultRouteProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(IPv4Routes)) + { + writer.WritePropertyName("ipv4Routes"u8); + writer.WriteStartArray(); + foreach (var item in IPv4Routes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(IPv6Routes)) + { + writer.WritePropertyName("ipv6Routes"u8); + writer.WriteStartArray(); + foreach (var item in IPv6Routes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConditionalDefaultRouteProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConditionalDefaultRouteProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConditionalDefaultRouteProperties(document.RootElement, options); + } + + internal static ConditionalDefaultRouteProperties DeserializeConditionalDefaultRouteProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList ipv4Routes = default; + IList ipv6Routes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipv4Routes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StaticRouteProperties.DeserializeStaticRouteProperties(item, options)); + } + ipv4Routes = array; + continue; + } + if (property.NameEquals("ipv6Routes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StaticRouteProperties.DeserializeStaticRouteProperties(item, options)); + } + ipv6Routes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConditionalDefaultRouteProperties(ipv4Routes ?? new ChangeTrackingList(), ipv6Routes ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(ConditionalDefaultRouteProperties)} does not support writing '{options.Format}' format."); + } + } + + ConditionalDefaultRouteProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConditionalDefaultRouteProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConditionalDefaultRouteProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConditionalDefaultRouteProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConditionalDefaultRouteProperties.cs new file mode 100644 index 000000000000..098d974aebaf --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConditionalDefaultRouteProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Conditional Default Route Configuration properties. + public partial class ConditionalDefaultRouteProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ConditionalDefaultRouteProperties() + { + IPv4Routes = new ChangeTrackingList(); + IPv6Routes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of IPv4 Routes. + /// List of IPv6 Routes. + /// Keeps track of any properties unknown to the library. + internal ConditionalDefaultRouteProperties(IList ipv4Routes, IList ipv6Routes, IDictionary serializedAdditionalRawData) + { + IPv4Routes = ipv4Routes; + IPv6Routes = ipv6Routes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of IPv4 Routes. + public IList IPv4Routes { get; } + /// List of IPv6 Routes. + public IList IPv6Routes { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnet.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnet.Serialization.cs index 3251597a1b27..9341f2dd1052 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnet.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnet.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,9 +34,28 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(ConnectedSubnet)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } writer.WritePropertyName("prefix"u8); writer.WriteStringValue(Prefix); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } ConnectedSubnet IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -59,20 +78,20 @@ internal static ConnectedSubnet DeserializeConnectedSubnet(JsonElement element, { return null; } - string prefix = default; string annotation = default; + string prefix = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("prefix"u8)) + if (property.NameEquals("annotation"u8)) { - prefix = property.Value.GetString(); + annotation = property.Value.GetString(); continue; } - if (property.NameEquals("annotation"u8)) + if (property.NameEquals("prefix"u8)) { - annotation = property.Value.GetString(); + prefix = property.Value.GetString(); continue; } if (options.Format != "W") @@ -81,7 +100,7 @@ internal static ConnectedSubnet DeserializeConnectedSubnet(JsonElement element, } } serializedAdditionalRawData = rawDataDictionary; - return new ConnectedSubnet(annotation, serializedAdditionalRawData, prefix); + return new ConnectedSubnet(annotation, prefix, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnet.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnet.cs index 802d3c672aa1..42b15fd4b37d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnet.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnet.cs @@ -11,8 +11,40 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// Connected Subnet properties. - public partial class ConnectedSubnet : AnnotationResourceProperties + public partial class ConnectedSubnet { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . /// Prefix of the Connected Subnet. /// is null. @@ -25,11 +57,13 @@ public ConnectedSubnet(string prefix) /// Initializes a new instance of . /// Switch configuration description. - /// Keeps track of any properties unknown to the library. /// Prefix of the Connected Subnet. - internal ConnectedSubnet(string annotation, IDictionary serializedAdditionalRawData, string prefix) : base(annotation, serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ConnectedSubnet(string annotation, string prefix, IDictionary serializedAdditionalRawData) { + Annotation = annotation; Prefix = prefix; + _serializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. @@ -37,6 +71,8 @@ internal ConnectedSubnet() { } + /// Switch configuration description. + public string Annotation { get; set; } /// Prefix of the Connected Subnet. public string Prefix { get; set; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetPatch.Serialization.cs new file mode 100644 index 000000000000..3f8356504a2c --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetPatch.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class ConnectedSubnetPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedSubnetPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + writer.WritePropertyName("prefix"u8); + writer.WriteStringValue(Prefix); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectedSubnetPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedSubnetPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedSubnetPatch(document.RootElement, options); + } + + internal static ConnectedSubnetPatch DeserializeConnectedSubnetPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + string prefix = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("prefix"u8)) + { + prefix = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedSubnetPatch(annotation, prefix, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(ConnectedSubnetPatch)} does not support writing '{options.Format}' format."); + } + } + + ConnectedSubnetPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectedSubnetPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedSubnetPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetPatch.cs new file mode 100644 index 000000000000..eb81dfb3f55d --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetPatch.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Connected Subnet properties. + public partial class ConnectedSubnetPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Prefix of the Connected Subnet. + /// is null. + public ConnectedSubnetPatch(string prefix) + { + Argument.AssertNotNull(prefix, nameof(prefix)); + + Prefix = prefix; + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Prefix of the Connected Subnet. + /// Keeps track of any properties unknown to the library. + internal ConnectedSubnetPatch(string annotation, string prefix, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + Prefix = prefix; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConnectedSubnetPatch() + { + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// Prefix of the Connected Subnet. + public string Prefix { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetRoutePolicy.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetRoutePolicy.Serialization.cs index d317603311a6..4f08d3f8ea77 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetRoutePolicy.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetRoutePolicy.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - public partial class ConnectedSubnetRoutePolicy : IUtf8JsonSerializable, IJsonModel + internal partial class ConnectedSubnetRoutePolicy : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -34,15 +34,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ConnectedSubnetRoutePolicy)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ExportRoutePolicyId)) - { - writer.WritePropertyName("exportRoutePolicyId"u8); - writer.WriteStringValue(ExportRoutePolicyId); - } - if (Optional.IsDefined(ExportRoutePolicy)) + if (Optional.IsDefined(ConnectedExportRoutePolicy)) { writer.WritePropertyName("exportRoutePolicy"u8); - writer.WriteObjectValue(ExportRoutePolicy, options); + writer.WriteObjectValue(ConnectedExportRoutePolicy, options); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -81,21 +76,11 @@ internal static ConnectedSubnetRoutePolicy DeserializeConnectedSubnetRoutePolicy { return null; } - ResourceIdentifier exportRoutePolicyId = default; L3ExportRoutePolicy exportRoutePolicy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("exportRoutePolicyId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - exportRoutePolicyId = new ResourceIdentifier(property.Value.GetString()); - continue; - } if (property.NameEquals("exportRoutePolicy"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -111,7 +96,7 @@ internal static ConnectedSubnetRoutePolicy DeserializeConnectedSubnetRoutePolicy } } serializedAdditionalRawData = rawDataDictionary; - return new ConnectedSubnetRoutePolicy(exportRoutePolicyId, exportRoutePolicy, serializedAdditionalRawData); + return new ConnectedSubnetRoutePolicy(exportRoutePolicy, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetRoutePolicy.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetRoutePolicy.cs index 5e864306b436..0829646d17e4 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetRoutePolicy.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetRoutePolicy.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// Connected Subnet Route Policy properties. - public partial class ConnectedSubnetRoutePolicy + internal partial class ConnectedSubnetRoutePolicy { /// /// Keeps track of any properties unknown to the library. @@ -52,19 +51,15 @@ public ConnectedSubnetRoutePolicy() } /// Initializes a new instance of . - /// ARM Resource ID of the Route Policy. This is used for the backward compatibility. - /// Array of ARM Resource ID of the RoutePolicies. + /// Array of ARM Resource ID of the RoutePolicies. /// Keeps track of any properties unknown to the library. - internal ConnectedSubnetRoutePolicy(ResourceIdentifier exportRoutePolicyId, L3ExportRoutePolicy exportRoutePolicy, IDictionary serializedAdditionalRawData) + internal ConnectedSubnetRoutePolicy(L3ExportRoutePolicy connectedExportRoutePolicy, IDictionary serializedAdditionalRawData) { - ExportRoutePolicyId = exportRoutePolicyId; - ExportRoutePolicy = exportRoutePolicy; + ConnectedExportRoutePolicy = connectedExportRoutePolicy; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// ARM Resource ID of the Route Policy. This is used for the backward compatibility. - public ResourceIdentifier ExportRoutePolicyId { get; set; } /// Array of ARM Resource ID of the RoutePolicies. - public L3ExportRoutePolicy ExportRoutePolicy { get; set; } + public L3ExportRoutePolicy ConnectedExportRoutePolicy { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetRoutePolicyPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetRoutePolicyPatch.Serialization.cs new file mode 100644 index 000000000000..61db0458bb1e --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetRoutePolicyPatch.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class ConnectedSubnetRoutePolicyPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedSubnetRoutePolicyPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ConnectedExportRoutePolicy)) + { + writer.WritePropertyName("exportRoutePolicy"u8); + writer.WriteObjectValue(ConnectedExportRoutePolicy, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectedSubnetRoutePolicyPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedSubnetRoutePolicyPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedSubnetRoutePolicyPatch(document.RootElement, options); + } + + internal static ConnectedSubnetRoutePolicyPatch DeserializeConnectedSubnetRoutePolicyPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + L3ExportRoutePolicyPatch exportRoutePolicy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("exportRoutePolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exportRoutePolicy = L3ExportRoutePolicyPatch.DeserializeL3ExportRoutePolicyPatch(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedSubnetRoutePolicyPatch(exportRoutePolicy, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(ConnectedSubnetRoutePolicyPatch)} does not support writing '{options.Format}' format."); + } + } + + ConnectedSubnetRoutePolicyPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectedSubnetRoutePolicyPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedSubnetRoutePolicyPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetRoutePolicyPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetRoutePolicyPatch.cs new file mode 100644 index 000000000000..4f96a259f294 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ConnectedSubnetRoutePolicyPatch.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Connected Subnet Route Policy properties. + internal partial class ConnectedSubnetRoutePolicyPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ConnectedSubnetRoutePolicyPatch() + { + } + + /// Initializes a new instance of . + /// Array of ARM Resource ID of the RoutePolicies. + /// Keeps track of any properties unknown to the library. + internal ConnectedSubnetRoutePolicyPatch(L3ExportRoutePolicyPatch connectedExportRoutePolicy, IDictionary serializedAdditionalRawData) + { + ConnectedExportRoutePolicy = connectedExportRoutePolicy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Array of ARM Resource ID of the RoutePolicies. + public L3ExportRoutePolicyPatch ConnectedExportRoutePolicy { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatchableParametersDestinationsItem.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DestinationPatchProperties.Serialization.cs similarity index 54% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatchableParametersDestinationsItem.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DestinationPatchProperties.Serialization.cs index 64bbfc1b1180..a5d7ad63d65c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatchableParametersDestinationsItem.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DestinationPatchProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - public partial class NetworkTapPatchableParametersDestinationsItem : IUtf8JsonSerializable, IJsonModel + public partial class DestinationPatchProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -26,30 +26,69 @@ void IJsonModel.Write(Utf8JsonWri /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkTapPatchableParametersDestinationsItem)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DestinationPatchProperties)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(DestinationType)) + { + writer.WritePropertyName("destinationType"u8); + writer.WriteStringValue(DestinationType.Value.ToString()); + } + if (Optional.IsDefined(DestinationId)) + { + writer.WritePropertyName("destinationId"u8); + writer.WriteStringValue(DestinationId); + } + if (Optional.IsDefined(IsolationDomainProperties)) + { + writer.WritePropertyName("isolationDomainProperties"u8); + writer.WriteObjectValue(IsolationDomainProperties, options); + } + if (Optional.IsDefined(DestinationTapRuleId)) + { + writer.WritePropertyName("destinationTapRuleId"u8); + writer.WriteStringValue(DestinationTapRuleId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } - NetworkTapPatchableParametersDestinationsItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DestinationPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkTapPatchableParametersDestinationsItem)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DestinationPatchProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkTapPatchableParametersDestinationsItem(document.RootElement, options); + return DeserializeDestinationPatchProperties(document.RootElement, options); } - internal static NetworkTapPatchableParametersDestinationsItem DeserializeNetworkTapPatchableParametersDestinationsItem(JsonElement element, ModelReaderWriterOptions options = null) + internal static DestinationPatchProperties DeserializeDestinationPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -60,7 +99,7 @@ internal static NetworkTapPatchableParametersDestinationsItem DeserializeNetwork string name = default; NetworkTapDestinationType? destinationType = default; ResourceIdentifier destinationId = default; - IsolationDomainProperties isolationDomainProperties = default; + IsolationDomainPatchProperties isolationDomainProperties = default; ResourceIdentifier destinationTapRuleId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -95,7 +134,7 @@ internal static NetworkTapPatchableParametersDestinationsItem DeserializeNetwork { continue; } - isolationDomainProperties = IsolationDomainProperties.DeserializeIsolationDomainProperties(property.Value, options); + isolationDomainProperties = IsolationDomainPatchProperties.DeserializeIsolationDomainPatchProperties(property.Value, options); continue; } if (property.NameEquals("destinationTapRuleId"u8)) @@ -113,7 +152,7 @@ internal static NetworkTapPatchableParametersDestinationsItem DeserializeNetwork } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkTapPatchableParametersDestinationsItem( + return new DestinationPatchProperties( name, destinationType, destinationId, @@ -122,35 +161,35 @@ internal static NetworkTapPatchableParametersDestinationsItem DeserializeNetwork serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(NetworkTapPatchableParametersDestinationsItem)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DestinationPatchProperties)} does not support writing '{options.Format}' format."); } } - NetworkTapPatchableParametersDestinationsItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DestinationPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkTapPatchableParametersDestinationsItem(document.RootElement, options); + return DeserializeDestinationPatchProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NetworkTapPatchableParametersDestinationsItem)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DestinationPatchProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DestinationPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DestinationPatchProperties.cs new file mode 100644 index 000000000000..18b4cc950c9b --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DestinationPatchProperties.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The network tap destination properties. + public partial class DestinationPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DestinationPatchProperties() + { + } + + /// Initializes a new instance of . + /// Destination name. + /// Type of destination. Input can be IsolationDomain or Direct. + /// The destination Id. ARM Resource ID of either NNI or Internal Networks. + /// Isolation Domain Properties. + /// ARM Resource ID of destination Tap Rule that contains match configurations. + /// Keeps track of any properties unknown to the library. + internal DestinationPatchProperties(string name, NetworkTapDestinationType? destinationType, ResourceIdentifier destinationId, IsolationDomainPatchProperties isolationDomainProperties, ResourceIdentifier destinationTapRuleId, IDictionary serializedAdditionalRawData) + { + Name = name; + DestinationType = destinationType; + DestinationId = destinationId; + IsolationDomainProperties = isolationDomainProperties; + DestinationTapRuleId = destinationTapRuleId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Destination name. + public string Name { get; set; } + /// Type of destination. Input can be IsolationDomain or Direct. + public NetworkTapDestinationType? DestinationType { get; set; } + /// The destination Id. ARM Resource ID of either NNI or Internal Networks. + public ResourceIdentifier DestinationId { get; set; } + /// Isolation Domain Properties. + public IsolationDomainPatchProperties IsolationDomainProperties { get; set; } + /// ARM Resource ID of destination Tap Rule that contains match configurations. + public ResourceIdentifier DestinationTapRuleId { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceRoCommand.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceRoCommand.Serialization.cs new file mode 100644 index 000000000000..30097abf2114 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceRoCommand.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class DeviceRoCommand : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRoCommand)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Command)) + { + writer.WritePropertyName("command"u8); + writer.WriteStringValue(Command); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeviceRoCommand IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRoCommand)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRoCommand(document.RootElement, options); + } + + internal static DeviceRoCommand DeserializeDeviceRoCommand(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string command = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("command"u8)) + { + command = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRoCommand(command, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(DeviceRoCommand)} does not support writing '{options.Format}' format."); + } + } + + DeviceRoCommand IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeviceRoCommand(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRoCommand)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceRoCommand.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceRoCommand.cs new file mode 100644 index 000000000000..a8d291574e69 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceRoCommand.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Provide the RO command. + public partial class DeviceRoCommand + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeviceRoCommand() + { + } + + /// Initializes a new instance of . + /// Specify the command. + /// Keeps track of any properties unknown to the library. + internal DeviceRoCommand(string command, IDictionary serializedAdditionalRawData) + { + Command = command; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specify the command. + public string Command { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceRole.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceRole.cs new file mode 100644 index 000000000000..87763c0b7e06 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceRole.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Device Role. + public readonly partial struct DeviceRole : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DeviceRole(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CEValue = "CE"; + private const string ToRValue = "ToR"; + private const string NpbValue = "NPB"; + private const string ManagementSwitchValue = "ManagementSwitch"; + + /// DeviceRole - Customer Edge (CE). + public static DeviceRole CE { get; } = new DeviceRole(CEValue); + /// DeviceRole - Top of Rack (ToR). + public static DeviceRole ToR { get; } = new DeviceRole(ToRValue); + /// DeviceRole - Network Packet Broker (NPB). + public static DeviceRole Npb { get; } = new DeviceRole(NpbValue); + /// Device Role Management Switch. + public static DeviceRole ManagementSwitch { get; } = new DeviceRole(ManagementSwitchValue); + /// Determines if two values are the same. + public static bool operator ==(DeviceRole left, DeviceRole right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DeviceRole left, DeviceRole right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DeviceRole(string value) => new DeviceRole(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DeviceRole other && Equals(other); + /// + public bool Equals(DeviceRole other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceRwCommand.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceRwCommand.Serialization.cs new file mode 100644 index 000000000000..9c8dbc4ce7bb --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceRwCommand.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class DeviceRwCommand : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRwCommand)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Command)) + { + writer.WritePropertyName("command"u8); + writer.WriteStringValue(Command); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeviceRwCommand IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRwCommand)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRwCommand(document.RootElement, options); + } + + internal static DeviceRwCommand DeserializeDeviceRwCommand(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string command = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("command"u8)) + { + command = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRwCommand(command, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(DeviceRwCommand)} does not support writing '{options.Format}' format."); + } + } + + DeviceRwCommand IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeviceRwCommand(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRwCommand)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceRwCommand.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceRwCommand.cs new file mode 100644 index 000000000000..613df77f8bce --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceRwCommand.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Provide the Rw command. + public partial class DeviceRwCommand + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeviceRwCommand() + { + } + + /// Initializes a new instance of . + /// Specify the command. + /// Keeps track of any properties unknown to the library. + internal DeviceRwCommand(string command, IDictionary serializedAdditionalRawData) + { + Command = command; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specify the command. + public string Command { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceUpdateCommonPostActionResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceUpdateCommonPostActionResult.Serialization.cs index d2288c9d3e7e..dca2dcdfcf9d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceUpdateCommonPostActionResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceUpdateCommonPostActionResult.Serialization.cs @@ -27,7 +27,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -35,7 +35,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(DeviceUpdateCommonPostActionResult)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + ((IJsonModel)Error).Write(writer, options); + } if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) { writer.WritePropertyName("configurationState"u8); @@ -61,6 +65,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } DeviceUpdateCommonPostActionResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -83,14 +102,23 @@ internal static DeviceUpdateCommonPostActionResult DeserializeDeviceUpdateCommon { return null; } + ResponseError error = default; NetworkFabricConfigurationState? configurationState = default; IReadOnlyList successfulDevices = default; IReadOnlyList failedDevices = default; - ResponseError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerManagedNetworkFabricContext.Default); + continue; + } if (property.NameEquals("configurationState"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -128,22 +156,13 @@ internal static DeviceUpdateCommonPostActionResult DeserializeDeviceUpdateCommon failedDevices = array; continue; } - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerManagedNetworkFabricContext.Default); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceUpdateCommonPostActionResult(error, serializedAdditionalRawData, configurationState, successfulDevices ?? new ChangeTrackingList(), failedDevices ?? new ChangeTrackingList()); + return new DeviceUpdateCommonPostActionResult(error, configurationState, successfulDevices ?? new ChangeTrackingList(), failedDevices ?? new ChangeTrackingList(), serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceUpdateCommonPostActionResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceUpdateCommonPostActionResult.cs index 42f7abdddb12..be25106525f1 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceUpdateCommonPostActionResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DeviceUpdateCommonPostActionResult.cs @@ -11,8 +11,40 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// Common response for device updates. - public partial class DeviceUpdateCommonPostActionResult : NetworkFabricErrorResult + public partial class DeviceUpdateCommonPostActionResult { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . internal DeviceUpdateCommonPostActionResult() { @@ -22,17 +54,21 @@ internal DeviceUpdateCommonPostActionResult() /// Initializes a new instance of . /// The error object. - /// Keeps track of any properties unknown to the library. /// Gets the configuration state. /// List of ARM Resource IDs for which the given action applied successfully. /// List of ARM Resource IDs for which the given action failed to apply. - internal DeviceUpdateCommonPostActionResult(ResponseError error, IDictionary serializedAdditionalRawData, NetworkFabricConfigurationState? configurationState, IReadOnlyList successfulDevices, IReadOnlyList failedDevices) : base(error, serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DeviceUpdateCommonPostActionResult(ResponseError error, NetworkFabricConfigurationState? configurationState, IReadOnlyList successfulDevices, IReadOnlyList failedDevices, IDictionary serializedAdditionalRawData) { + Error = error; ConfigurationState = configurationState; SuccessfulDevices = successfulDevices; FailedDevices = failedDevices; + _serializedAdditionalRawData = serializedAdditionalRawData; } + /// The error object. + public ResponseError Error { get; } /// Gets the configuration state. public NetworkFabricConfigurationState? ConfigurationState { get; } /// List of ARM Resource IDs for which the given action applied successfully. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DiscardCommitBatchContent.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DiscardCommitBatchContent.Serialization.cs new file mode 100644 index 000000000000..df830ee36c05 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DiscardCommitBatchContent.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class DiscardCommitBatchContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscardCommitBatchContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(CommitBatchId)) + { + writer.WritePropertyName("commitBatchId"u8); + writer.WriteStringValue(CommitBatchId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiscardCommitBatchContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscardCommitBatchContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiscardCommitBatchContent(document.RootElement, options); + } + + internal static DiscardCommitBatchContent DeserializeDiscardCommitBatchContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string commitBatchId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("commitBatchId"u8)) + { + commitBatchId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiscardCommitBatchContent(commitBatchId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(DiscardCommitBatchContent)} does not support writing '{options.Format}' format."); + } + } + + DiscardCommitBatchContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDiscardCommitBatchContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiscardCommitBatchContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DiscardCommitBatchContent.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DiscardCommitBatchContent.cs new file mode 100644 index 000000000000..7e68210389bb --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DiscardCommitBatchContent.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Discard Commit Batch Request. + public partial class DiscardCommitBatchContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DiscardCommitBatchContent() + { + } + + /// Initializes a new instance of . + /// Commit Batch Identifier. If not provided, the latest commit batch status will be returned. + /// Keeps track of any properties unknown to the library. + internal DiscardCommitBatchContent(string commitBatchId, IDictionary serializedAdditionalRawData) + { + CommitBatchId = commitBatchId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Commit Batch Identifier. If not provided, the latest commit batch status will be returned. + public string CommitBatchId { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricErrorResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DiscardCommitBatchResult.Serialization.cs similarity index 69% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricErrorResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DiscardCommitBatchResult.Serialization.cs index 2c5f1c02e78f..793c09186fd2 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricErrorResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DiscardCommitBatchResult.Serialization.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - public partial class NetworkFabricErrorResult : IUtf8JsonSerializable, IJsonModel + public partial class DiscardCommitBatchResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -29,12 +29,17 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkFabricErrorResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DiscardCommitBatchResult)} does not support writing '{format}' format."); } + if (Optional.IsDefined(CommitBatchId)) + { + writer.WritePropertyName("commitBatchId"u8); + writer.WriteStringValue(CommitBatchId); + } if (Optional.IsDefined(Error)) { writer.WritePropertyName("error"u8); @@ -57,19 +62,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NetworkFabricErrorResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DiscardCommitBatchResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkFabricErrorResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DiscardCommitBatchResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkFabricErrorResult(document.RootElement, options); + return DeserializeDiscardCommitBatchResult(document.RootElement, options); } - internal static NetworkFabricErrorResult DeserializeNetworkFabricErrorResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static DiscardCommitBatchResult DeserializeDiscardCommitBatchResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -77,11 +82,17 @@ internal static NetworkFabricErrorResult DeserializeNetworkFabricErrorResult(Jso { return null; } + string commitBatchId = default; ResponseError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("commitBatchId"u8)) + { + commitBatchId = property.Value.GetString(); + continue; + } if (property.NameEquals("error"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -97,38 +108,38 @@ internal static NetworkFabricErrorResult DeserializeNetworkFabricErrorResult(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkFabricErrorResult(error, serializedAdditionalRawData); + return new DiscardCommitBatchResult(commitBatchId, error, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(NetworkFabricErrorResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DiscardCommitBatchResult)} does not support writing '{options.Format}' format."); } } - NetworkFabricErrorResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DiscardCommitBatchResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkFabricErrorResult(document.RootElement, options); + return DeserializeDiscardCommitBatchResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NetworkFabricErrorResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DiscardCommitBatchResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DiscardCommitBatchResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DiscardCommitBatchResult.cs new file mode 100644 index 000000000000..59e9d7431aae --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/DiscardCommitBatchResult.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Discard Commit Batch Response. + public partial class DiscardCommitBatchResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DiscardCommitBatchResult() + { + } + + /// Initializes a new instance of . + /// Commit Batch Identifier. + /// The error object. + /// Keeps track of any properties unknown to the library. + internal DiscardCommitBatchResult(string commitBatchId, ResponseError error, IDictionary serializedAdditionalRawData) + { + CommitBatchId = commitBatchId; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Commit Batch Identifier. + public string CommitBatchId { get; } + /// The error object. + public ResponseError Error { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExportRoutePolicyInformationPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExportRoutePolicyInformationPatch.Serialization.cs new file mode 100644 index 000000000000..27992b1b957e --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExportRoutePolicyInformationPatch.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class ExportRoutePolicyInformationPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportRoutePolicyInformationPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ExportIPv4RoutePolicyId)) + { + writer.WritePropertyName("exportIpv4RoutePolicyId"u8); + writer.WriteStringValue(ExportIPv4RoutePolicyId); + } + if (Optional.IsDefined(ExportIPv6RoutePolicyId)) + { + writer.WritePropertyName("exportIpv6RoutePolicyId"u8); + writer.WriteStringValue(ExportIPv6RoutePolicyId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportRoutePolicyInformationPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportRoutePolicyInformationPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportRoutePolicyInformationPatch(document.RootElement, options); + } + + internal static ExportRoutePolicyInformationPatch DeserializeExportRoutePolicyInformationPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier exportIPv4RoutePolicyId = default; + ResourceIdentifier exportIPv6RoutePolicyId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("exportIpv4RoutePolicyId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exportIPv4RoutePolicyId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("exportIpv6RoutePolicyId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exportIPv6RoutePolicyId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportRoutePolicyInformationPatch(exportIPv4RoutePolicyId, exportIPv6RoutePolicyId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(ExportRoutePolicyInformationPatch)} does not support writing '{options.Format}' format."); + } + } + + ExportRoutePolicyInformationPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeExportRoutePolicyInformationPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportRoutePolicyInformationPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExportRoutePolicyInformationPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExportRoutePolicyInformationPatch.cs new file mode 100644 index 000000000000..974328e5de34 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExportRoutePolicyInformationPatch.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Export Route Policy Configuration. + public partial class ExportRoutePolicyInformationPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportRoutePolicyInformationPatch() + { + } + + /// Initializes a new instance of . + /// Export IPv4 Route Policy Id. + /// Export IPv6 Route Policy Id. + /// Keeps track of any properties unknown to the library. + internal ExportRoutePolicyInformationPatch(ResourceIdentifier exportIPv4RoutePolicyId, ResourceIdentifier exportIPv6RoutePolicyId, IDictionary serializedAdditionalRawData) + { + ExportIPv4RoutePolicyId = exportIPv4RoutePolicyId; + ExportIPv6RoutePolicyId = exportIPv6RoutePolicyId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Export IPv4 Route Policy Id. + public ResourceIdentifier ExportIPv4RoutePolicyId { get; set; } + /// Export IPv6 Route Policy Id. + public ResourceIdentifier ExportIPv6RoutePolicyId { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExportRoutePolicyPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExportRoutePolicyPatch.Serialization.cs new file mode 100644 index 000000000000..9ca05cf469f6 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExportRoutePolicyPatch.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class ExportRoutePolicyPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportRoutePolicyPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ExportIPv4RoutePolicyId)) + { + writer.WritePropertyName("exportIpv4RoutePolicyId"u8); + writer.WriteStringValue(ExportIPv4RoutePolicyId); + } + if (Optional.IsDefined(ExportIPv6RoutePolicyId)) + { + writer.WritePropertyName("exportIpv6RoutePolicyId"u8); + writer.WriteStringValue(ExportIPv6RoutePolicyId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportRoutePolicyPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportRoutePolicyPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportRoutePolicyPatch(document.RootElement, options); + } + + internal static ExportRoutePolicyPatch DeserializeExportRoutePolicyPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier exportIPv4RoutePolicyId = default; + ResourceIdentifier exportIPv6RoutePolicyId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("exportIpv4RoutePolicyId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exportIPv4RoutePolicyId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("exportIpv6RoutePolicyId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exportIPv6RoutePolicyId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportRoutePolicyPatch(exportIPv4RoutePolicyId, exportIPv6RoutePolicyId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(ExportRoutePolicyPatch)} does not support writing '{options.Format}' format."); + } + } + + ExportRoutePolicyPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeExportRoutePolicyPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportRoutePolicyPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExportRoutePolicyPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExportRoutePolicyPatch.cs new file mode 100644 index 000000000000..a798c0a794ed --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExportRoutePolicyPatch.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Export Route Policy either IPv4 or IPv6. + public partial class ExportRoutePolicyPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportRoutePolicyPatch() + { + } + + /// Initializes a new instance of . + /// ARM resource ID of RoutePolicy. + /// ARM resource ID of RoutePolicy. + /// Keeps track of any properties unknown to the library. + internal ExportRoutePolicyPatch(ResourceIdentifier exportIPv4RoutePolicyId, ResourceIdentifier exportIPv6RoutePolicyId, IDictionary serializedAdditionalRawData) + { + ExportIPv4RoutePolicyId = exportIPv4RoutePolicyId; + ExportIPv6RoutePolicyId = exportIPv6RoutePolicyId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// ARM resource ID of RoutePolicy. + public ResourceIdentifier ExportIPv4RoutePolicyId { get; set; } + /// ARM resource ID of RoutePolicy. + public ResourceIdentifier ExportIPv6RoutePolicyId { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExtendedVlan.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExtendedVlan.cs new file mode 100644 index 000000000000..d834df9710d2 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExtendedVlan.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Extended VLAN status. + public readonly partial struct ExtendedVlan : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ExtendedVlan(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Extended VLAN is enabled. + public static ExtendedVlan Enabled { get; } = new ExtendedVlan(EnabledValue); + /// Extended VLAN is disabled. + public static ExtendedVlan Disabled { get; } = new ExtendedVlan(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(ExtendedVlan left, ExtendedVlan right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ExtendedVlan left, ExtendedVlan right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ExtendedVlan(string value) => new ExtendedVlan(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ExtendedVlan other && Equals(other); + /// + public bool Equals(ExtendedVlan other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBfdAdministrativeStateContent.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBfdAdministrativeStateContent.Serialization.cs new file mode 100644 index 000000000000..f62ce684d819 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBfdAdministrativeStateContent.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class ExternalNetworkBfdAdministrativeStateContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExternalNetworkBfdAdministrativeStateContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RouteType)) + { + writer.WritePropertyName("routeType"u8); + writer.WriteStringValue(RouteType.Value.ToString()); + } + if (Optional.IsDefined(AdministrativeState)) + { + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExternalNetworkBfdAdministrativeStateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExternalNetworkBfdAdministrativeStateContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExternalNetworkBfdAdministrativeStateContent(document.RootElement, options); + } + + internal static ExternalNetworkBfdAdministrativeStateContent DeserializeExternalNetworkBfdAdministrativeStateContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExternalNetworkRouteType? routeType = default; + BfdAdministrativeState? administrativeState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("routeType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + routeType = new ExternalNetworkRouteType(property.Value.GetString()); + continue; + } + if (property.NameEquals("administrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeState = new BfdAdministrativeState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExternalNetworkBfdAdministrativeStateContent(routeType, administrativeState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(ExternalNetworkBfdAdministrativeStateContent)} does not support writing '{options.Format}' format."); + } + } + + ExternalNetworkBfdAdministrativeStateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeExternalNetworkBfdAdministrativeStateContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExternalNetworkBfdAdministrativeStateContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBfdAdministrativeStateContent.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBfdAdministrativeStateContent.cs new file mode 100644 index 000000000000..57a47968c058 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBfdAdministrativeStateContent.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// External Network Administrative State request. + public partial class ExternalNetworkBfdAdministrativeStateContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExternalNetworkBfdAdministrativeStateContent() + { + } + + /// Initializes a new instance of . + /// Route Type that helps to know which bfd we are updating. + /// Administrative state. + /// Keeps track of any properties unknown to the library. + internal ExternalNetworkBfdAdministrativeStateContent(ExternalNetworkRouteType? routeType, BfdAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) + { + RouteType = routeType; + AdministrativeState = administrativeState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Route Type that helps to know which bfd we are updating. + public ExternalNetworkRouteType? RouteType { get; set; } + /// Administrative state. + public BfdAdministrativeState? AdministrativeState { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBfdAdministrativeStateResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBfdAdministrativeStateResult.Serialization.cs new file mode 100644 index 000000000000..9f0703c6d3bb --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBfdAdministrativeStateResult.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class ExternalNetworkBfdAdministrativeStateResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExternalNetworkBfdAdministrativeStateResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RouteType)) + { + writer.WritePropertyName("routeType"u8); + writer.WriteStringValue(RouteType.Value.ToString()); + } + if (Optional.IsDefined(AdministrativeState)) + { + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + ((IJsonModel)Error).Write(writer, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExternalNetworkBfdAdministrativeStateResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExternalNetworkBfdAdministrativeStateResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExternalNetworkBfdAdministrativeStateResult(document.RootElement, options); + } + + internal static ExternalNetworkBfdAdministrativeStateResult DeserializeExternalNetworkBfdAdministrativeStateResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExternalNetworkRouteType? routeType = default; + BfdAdministrativeState? administrativeState = default; + ResponseError error = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("routeType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + routeType = new ExternalNetworkRouteType(property.Value.GetString()); + continue; + } + if (property.NameEquals("administrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeState = new BfdAdministrativeState(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerManagedNetworkFabricContext.Default); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExternalNetworkBfdAdministrativeStateResult(routeType, administrativeState, error, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(ExternalNetworkBfdAdministrativeStateResult)} does not support writing '{options.Format}' format."); + } + } + + ExternalNetworkBfdAdministrativeStateResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeExternalNetworkBfdAdministrativeStateResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExternalNetworkBfdAdministrativeStateResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBfdAdministrativeStateResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBfdAdministrativeStateResult.cs new file mode 100644 index 000000000000..57801d9eb3ba --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBfdAdministrativeStateResult.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// External Network Administrative State response. + public partial class ExternalNetworkBfdAdministrativeStateResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ExternalNetworkBfdAdministrativeStateResult() + { + } + + /// Initializes a new instance of . + /// Route Type that helps to know which bfd we are updating. + /// Administrative state. + /// The error object. + /// Keeps track of any properties unknown to the library. + internal ExternalNetworkBfdAdministrativeStateResult(ExternalNetworkRouteType? routeType, BfdAdministrativeState? administrativeState, ResponseError error, IDictionary serializedAdditionalRawData) + { + RouteType = routeType; + AdministrativeState = administrativeState; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Route Type that helps to know which bfd we are updating. + public ExternalNetworkRouteType? RouteType { get; } + /// Administrative state. + public BfdAdministrativeState? AdministrativeState { get; } + /// The error object. + public ResponseError Error { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityAddOperationProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBmpPatchProperties.Serialization.cs similarity index 66% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityAddOperationProperties.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBmpPatchProperties.Serialization.cs index cb7f2c8d43fe..c37da7e8ed21 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityAddOperationProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBmpPatchProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - public partial class IPCommunityAddOperationProperties : IUtf8JsonSerializable, IJsonModel + internal partial class ExternalNetworkBmpPatchProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,16 +28,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IPCommunityAddOperationProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ExternalNetworkBmpPatchProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Add)) + if (Optional.IsDefined(ConfigurationState)) { - writer.WritePropertyName("add"u8); - writer.WriteObjectValue(Add, options); + writer.WritePropertyName("configurationState"u8); + writer.WriteStringValue(ConfigurationState.Value.ToString()); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -56,19 +56,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - IPCommunityAddOperationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ExternalNetworkBmpPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IPCommunityAddOperationProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ExternalNetworkBmpPatchProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeIPCommunityAddOperationProperties(document.RootElement, options); + return DeserializeExternalNetworkBmpPatchProperties(document.RootElement, options); } - internal static IPCommunityAddOperationProperties DeserializeIPCommunityAddOperationProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static ExternalNetworkBmpPatchProperties DeserializeExternalNetworkBmpPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -76,18 +76,18 @@ internal static IPCommunityAddOperationProperties DeserializeIPCommunityAddOpera { return null; } - IPCommunityIdList @add = default; + BmpConfigurationState? configurationState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("add"u8)) + if (property.NameEquals("configurationState"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - @add = IPCommunityIdList.DeserializeIPCommunityIdList(property.Value, options); + configurationState = new BmpConfigurationState(property.Value.GetString()); continue; } if (options.Format != "W") @@ -96,38 +96,38 @@ internal static IPCommunityAddOperationProperties DeserializeIPCommunityAddOpera } } serializedAdditionalRawData = rawDataDictionary; - return new IPCommunityAddOperationProperties(@add, serializedAdditionalRawData); + return new ExternalNetworkBmpPatchProperties(configurationState, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(IPCommunityAddOperationProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExternalNetworkBmpPatchProperties)} does not support writing '{options.Format}' format."); } } - IPCommunityAddOperationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ExternalNetworkBmpPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeIPCommunityAddOperationProperties(document.RootElement, options); + return DeserializeExternalNetworkBmpPatchProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(IPCommunityAddOperationProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExternalNetworkBmpPatchProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworksList.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBmpPatchProperties.cs similarity index 67% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworksList.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBmpPatchProperties.cs index f6deab17bb19..07c908c35cba 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworksList.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBmpPatchProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of External Networks. - internal partial class ExternalNetworksList + /// BMP Monitoring Configuration patch properties. + internal partial class ExternalNetworkBmpPatchProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,21 @@ internal partial class ExternalNetworksList /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ExternalNetworksList() + /// Initializes a new instance of . + public ExternalNetworkBmpPatchProperties() { - Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of External Network resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// BMP Configuration State. /// Keeps track of any properties unknown to the library. - internal ExternalNetworksList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ExternalNetworkBmpPatchProperties(BmpConfigurationState? configurationState, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + ConfigurationState = configurationState; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of External Network resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// BMP Configuration State. + public BmpConfigurationState? ConfigurationState { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainsListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBmpProperties.Serialization.cs similarity index 56% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainsListResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBmpProperties.Serialization.cs index 1259be16150f..a1fc48ddff31 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainsListResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBmpProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class L2IsolationDomainsListResult : IUtf8JsonSerializable, IJsonModel + internal partial class ExternalNetworkBmpProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(L2IsolationDomainsListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ExternalNetworkBmpProperties)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + if (Optional.IsDefined(ConfigurationState)) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WritePropertyName("configurationState"u8); + writer.WriteStringValue(ConfigurationState.Value.ToString()); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +56,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - L2IsolationDomainsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ExternalNetworkBmpProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(L2IsolationDomainsListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ExternalNetworkBmpProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeL2IsolationDomainsListResult(document.RootElement, options); + return DeserializeExternalNetworkBmpProperties(document.RootElement, options); } - internal static L2IsolationDomainsListResult DeserializeL2IsolationDomainsListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static ExternalNetworkBmpProperties DeserializeExternalNetworkBmpProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,29 +76,18 @@ internal static L2IsolationDomainsListResult DeserializeL2IsolationDomainsListRe { return null; } - IReadOnlyList value = default; - string nextLink = default; + BmpConfigurationState? configurationState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (property.NameEquals("configurationState"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NetworkFabricL2IsolationDomainData.DeserializeNetworkFabricL2IsolationDomainData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); + configurationState = new BmpConfigurationState(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +96,38 @@ internal static L2IsolationDomainsListResult DeserializeL2IsolationDomainsListRe } } serializedAdditionalRawData = rawDataDictionary; - return new L2IsolationDomainsListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ExternalNetworkBmpProperties(configurationState, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(L2IsolationDomainsListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExternalNetworkBmpProperties)} does not support writing '{options.Format}' format."); } } - L2IsolationDomainsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ExternalNetworkBmpProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeL2IsolationDomainsListResult(document.RootElement, options); + return DeserializeExternalNetworkBmpProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(L2IsolationDomainsListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExternalNetworkBmpProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBmpProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBmpProperties.cs new file mode 100644 index 000000000000..be34449d495b --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkBmpProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// BGP Monitoring Protocol (BMP) Configuration properties. + internal partial class ExternalNetworkBmpProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExternalNetworkBmpProperties() + { + } + + /// Initializes a new instance of . + /// BMP Configuration State. + /// Keeps track of any properties unknown to the library. + internal ExternalNetworkBmpProperties(BmpConfigurationState? configurationState, IDictionary serializedAdditionalRawData) + { + ConfigurationState = configurationState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// BMP Configuration State. + public BmpConfigurationState? ConfigurationState { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulesListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkListResult.Serialization.cs similarity index 66% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulesListResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkListResult.Serialization.cs index 62c2f9fc74d3..f9b10c5a799e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulesListResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class NetworkTapRulesListResult : IUtf8JsonSerializable, IJsonModel + internal partial class ExternalNetworkListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkTapRulesListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ExternalNetworkListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NetworkTapRulesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ExternalNetworkListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkTapRulesListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ExternalNetworkListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkTapRulesListResult(document.RootElement, options); + return DeserializeExternalNetworkListResult(document.RootElement, options); } - internal static NetworkTapRulesListResult DeserializeNetworkTapRulesListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static ExternalNetworkListResult DeserializeExternalNetworkListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,29 +83,29 @@ internal static NetworkTapRulesListResult DeserializeNetworkTapRulesListResult(J { return null; } - IReadOnlyList value = default; - string nextLink = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(NetworkTapRuleData.DeserializeNetworkTapRuleData(item, options)); + array.Add(NetworkFabricExternalNetworkData.DeserializeNetworkFabricExternalNetworkData(item, options)); } value = array; continue; } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +114,38 @@ internal static NetworkTapRulesListResult DeserializeNetworkTapRulesListResult(J } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkTapRulesListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ExternalNetworkListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(NetworkTapRulesListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExternalNetworkListResult)} does not support writing '{options.Format}' format."); } } - NetworkTapRulesListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ExternalNetworkListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkTapRulesListResult(document.RootElement, options); + return DeserializeExternalNetworkListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NetworkTapRulesListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExternalNetworkListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkListResult.cs new file mode 100644 index 000000000000..894170c2e7d1 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a ExternalNetwork list operation. + internal partial class ExternalNetworkListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The ExternalNetwork items on this page. + /// is null. + internal ExternalNetworkListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ExternalNetwork items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ExternalNetworkListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExternalNetworkListResult() + { + } + + /// The ExternalNetwork items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkOptionAProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkOptionAProperties.Serialization.cs index efd32ed4a0f2..60a6b4c67fa3 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkOptionAProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkOptionAProperties.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,7 +34,26 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(ExternalNetworkOptionAProperties)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(PrimaryIPv4Prefix)) + { + writer.WritePropertyName("primaryIpv4Prefix"u8); + writer.WriteStringValue(PrimaryIPv4Prefix); + } + if (Optional.IsDefined(PrimaryIPv6Prefix)) + { + writer.WritePropertyName("primaryIpv6Prefix"u8); + writer.WriteStringValue(PrimaryIPv6Prefix); + } + if (Optional.IsDefined(SecondaryIPv4Prefix)) + { + writer.WritePropertyName("secondaryIpv4Prefix"u8); + writer.WriteStringValue(SecondaryIPv4Prefix); + } + if (Optional.IsDefined(SecondaryIPv6Prefix)) + { + writer.WritePropertyName("secondaryIpv6Prefix"u8); + writer.WriteStringValue(SecondaryIPv6Prefix); + } if (Optional.IsDefined(Mtu)) { writer.WritePropertyName("mtu"u8); @@ -65,11 +84,51 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("ingressAclId"u8); writer.WriteStringValue(IngressAclId); } + if (Optional.IsDefined(BmpConfiguration)) + { + writer.WritePropertyName("bmpConfiguration"u8); + writer.WriteObjectValue(BmpConfiguration, options); + } if (Optional.IsDefined(EgressAclId)) { writer.WritePropertyName("egressAclId"u8); writer.WriteStringValue(EgressAclId); } + if (Optional.IsDefined(V4OverV6BgpSession)) + { + writer.WritePropertyName("v4OverV6BgpSession"u8); + writer.WriteStringValue(V4OverV6BgpSession.Value.ToString()); + } + if (Optional.IsDefined(V6OverV4BgpSession)) + { + writer.WritePropertyName("v6OverV4BgpSession"u8); + writer.WriteStringValue(V6OverV4BgpSession.Value.ToString()); + } + if (Optional.IsDefined(NativeIPv4PrefixLimit)) + { + writer.WritePropertyName("nativeIpv4PrefixLimit"u8); + writer.WriteObjectValue(NativeIPv4PrefixLimit, options); + } + if (Optional.IsDefined(NativeIPv6PrefixLimit)) + { + writer.WritePropertyName("nativeIpv6PrefixLimit"u8); + writer.WriteObjectValue(NativeIPv6PrefixLimit, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } ExternalNetworkOptionAProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -92,21 +151,46 @@ internal static ExternalNetworkOptionAProperties DeserializeExternalNetworkOptio { return null; } + string primaryIPv4Prefix = default; + string primaryIPv6Prefix = default; + string secondaryIPv4Prefix = default; + string secondaryIPv6Prefix = default; int? mtu = default; int? vlanId = default; long? fabricAsn = default; long? peerAsn = default; BfdConfiguration bfdConfiguration = default; ResourceIdentifier ingressAclId = default; + ExternalNetworkBmpProperties bmpConfiguration = default; ResourceIdentifier egressAclId = default; - string primaryIPv4Prefix = default; - string primaryIPv6Prefix = default; - string secondaryIPv4Prefix = default; - string secondaryIPv6Prefix = default; + V4OverV6BgpSessionState? v4OverV6BgpSession = default; + V6OverV4BgpSessionState? v6OverV4BgpSession = default; + NativeIPv4PrefixLimitProperties nativeIPv4PrefixLimit = default; + NativeIPv6PrefixLimitProperties nativeIPv6PrefixLimit = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("primaryIpv4Prefix"u8)) + { + primaryIPv4Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("primaryIpv6Prefix"u8)) + { + primaryIPv6Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("secondaryIpv4Prefix"u8)) + { + secondaryIPv4Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("secondaryIpv6Prefix"u8)) + { + secondaryIPv6Prefix = property.Value.GetString(); + continue; + } if (property.NameEquals("mtu"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -161,6 +245,15 @@ internal static ExternalNetworkOptionAProperties DeserializeExternalNetworkOptio ingressAclId = new ResourceIdentifier(property.Value.GetString()); continue; } + if (property.NameEquals("bmpConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bmpConfiguration = ExternalNetworkBmpProperties.DeserializeExternalNetworkBmpProperties(property.Value, options); + continue; + } if (property.NameEquals("egressAclId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -170,24 +263,40 @@ internal static ExternalNetworkOptionAProperties DeserializeExternalNetworkOptio egressAclId = new ResourceIdentifier(property.Value.GetString()); continue; } - if (property.NameEquals("primaryIpv4Prefix"u8)) + if (property.NameEquals("v4OverV6BgpSession"u8)) { - primaryIPv4Prefix = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + v4OverV6BgpSession = new V4OverV6BgpSessionState(property.Value.GetString()); continue; } - if (property.NameEquals("primaryIpv6Prefix"u8)) + if (property.NameEquals("v6OverV4BgpSession"u8)) { - primaryIPv6Prefix = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + v6OverV4BgpSession = new V6OverV4BgpSessionState(property.Value.GetString()); continue; } - if (property.NameEquals("secondaryIpv4Prefix"u8)) + if (property.NameEquals("nativeIpv4PrefixLimit"u8)) { - secondaryIPv4Prefix = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nativeIPv4PrefixLimit = NativeIPv4PrefixLimitProperties.DeserializeNativeIPv4PrefixLimitProperties(property.Value, options); continue; } - if (property.NameEquals("secondaryIpv6Prefix"u8)) + if (property.NameEquals("nativeIpv6PrefixLimit"u8)) { - secondaryIPv6Prefix = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nativeIPv6PrefixLimit = NativeIPv6PrefixLimitProperties.DeserializeNativeIPv6PrefixLimitProperties(property.Value, options); continue; } if (options.Format != "W") @@ -201,14 +310,19 @@ internal static ExternalNetworkOptionAProperties DeserializeExternalNetworkOptio primaryIPv6Prefix, secondaryIPv4Prefix, secondaryIPv6Prefix, - serializedAdditionalRawData, mtu, vlanId, fabricAsn, peerAsn, bfdConfiguration, ingressAclId, - egressAclId); + bmpConfiguration, + egressAclId, + v4OverV6BgpSession, + v6OverV4BgpSession, + nativeIPv4PrefixLimit, + nativeIPv6PrefixLimit, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkOptionAProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkOptionAProperties.cs index c5d0d6c32611..75cd74b4b563 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkOptionAProperties.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkOptionAProperties.cs @@ -12,8 +12,40 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// option A properties object. - public partial class ExternalNetworkOptionAProperties : Layer3IPPrefixProperties + public partial class ExternalNetworkOptionAProperties { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public ExternalNetworkOptionAProperties() { @@ -24,25 +56,48 @@ public ExternalNetworkOptionAProperties() /// IPv6 Address Prefix. /// Secondary IPv4 Address Prefix. /// Secondary IPv6 Address Prefix. - /// Keeps track of any properties unknown to the library. /// MTU to use for option A peering. /// Vlan identifier. Example : 501. /// Fabric ASN number. Example 65001. /// Peer ASN number.Example : 28. /// BFD configuration properties. /// Ingress Acl. ARM resource ID of Access Control Lists. + /// BMP Monitor Configuration. /// Egress Acl. ARM resource ID of Access Control Lists. - internal ExternalNetworkOptionAProperties(string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix, IDictionary serializedAdditionalRawData, int? mtu, int? vlanId, long? fabricAsn, long? peerAsn, BfdConfiguration bfdConfiguration, ResourceIdentifier ingressAclId, ResourceIdentifier egressAclId) : base(primaryIPv4Prefix, primaryIPv6Prefix, secondaryIPv4Prefix, secondaryIPv6Prefix, serializedAdditionalRawData) + /// V4OverV6 BGP Session state. + /// V6OverV4 BGP Session state. + /// Native IPv4 prefix limits configuration. + /// Native IPv6 prefix limits configuration. + /// Keeps track of any properties unknown to the library. + internal ExternalNetworkOptionAProperties(string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix, int? mtu, int? vlanId, long? fabricAsn, long? peerAsn, BfdConfiguration bfdConfiguration, ResourceIdentifier ingressAclId, ExternalNetworkBmpProperties bmpConfiguration, ResourceIdentifier egressAclId, V4OverV6BgpSessionState? v4OverV6BgpSession, V6OverV4BgpSessionState? v6OverV4BgpSession, NativeIPv4PrefixLimitProperties nativeIPv4PrefixLimit, NativeIPv6PrefixLimitProperties nativeIPv6PrefixLimit, IDictionary serializedAdditionalRawData) { + PrimaryIPv4Prefix = primaryIPv4Prefix; + PrimaryIPv6Prefix = primaryIPv6Prefix; + SecondaryIPv4Prefix = secondaryIPv4Prefix; + SecondaryIPv6Prefix = secondaryIPv6Prefix; Mtu = mtu; VlanId = vlanId; FabricAsn = fabricAsn; PeerAsn = peerAsn; BfdConfiguration = bfdConfiguration; IngressAclId = ingressAclId; + BmpConfiguration = bmpConfiguration; EgressAclId = egressAclId; + V4OverV6BgpSession = v4OverV6BgpSession; + V6OverV4BgpSession = v6OverV4BgpSession; + NativeIPv4PrefixLimit = nativeIPv4PrefixLimit; + NativeIPv6PrefixLimit = nativeIPv6PrefixLimit; + _serializedAdditionalRawData = serializedAdditionalRawData; } + /// IPv4 Address Prefix. + public string PrimaryIPv4Prefix { get; set; } + /// IPv6 Address Prefix. + public string PrimaryIPv6Prefix { get; set; } + /// Secondary IPv4 Address Prefix. + public string SecondaryIPv4Prefix { get; set; } + /// Secondary IPv6 Address Prefix. + public string SecondaryIPv6Prefix { get; set; } /// MTU to use for option A peering. public int? Mtu { get; set; } /// Vlan identifier. Example : 501. @@ -55,7 +110,50 @@ internal ExternalNetworkOptionAProperties(string primaryIPv4Prefix, string prima public BfdConfiguration BfdConfiguration { get; set; } /// Ingress Acl. ARM resource ID of Access Control Lists. public ResourceIdentifier IngressAclId { get; set; } + /// BMP Monitor Configuration. + internal ExternalNetworkBmpProperties BmpConfiguration { get; set; } + /// BMP Configuration State. + public BmpConfigurationState? BmpConfigurationState + { + get => BmpConfiguration is null ? default : BmpConfiguration.ConfigurationState; + set + { + if (BmpConfiguration is null) + BmpConfiguration = new ExternalNetworkBmpProperties(); + BmpConfiguration.ConfigurationState = value; + } + } + /// Egress Acl. ARM resource ID of Access Control Lists. public ResourceIdentifier EgressAclId { get; set; } + /// V4OverV6 BGP Session state. + public V4OverV6BgpSessionState? V4OverV6BgpSession { get; set; } + /// V6OverV4 BGP Session state. + public V6OverV4BgpSessionState? V6OverV4BgpSession { get; set; } + /// Native IPv4 prefix limits configuration. + internal NativeIPv4PrefixLimitProperties NativeIPv4PrefixLimit { get; set; } + /// Prefix limits. + public IList NativeIPv4PrefixLimits + { + get + { + if (NativeIPv4PrefixLimit is null) + NativeIPv4PrefixLimit = new NativeIPv4PrefixLimitProperties(); + return NativeIPv4PrefixLimit.PrefixLimits; + } + } + + /// Native IPv6 prefix limits configuration. + internal NativeIPv6PrefixLimitProperties NativeIPv6PrefixLimit { get; set; } + /// Prefix limits. + public IList NativeIPv6PrefixLimits + { + get + { + if (NativeIPv6PrefixLimit is null) + NativeIPv6PrefixLimit = new NativeIPv6PrefixLimitProperties(); + return NativeIPv6PrefixLimit.PrefixLimits; + } + } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkPatchOptionAProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkPatchOptionAProperties.Serialization.cs index 871b9b6c4e44..c18cee34c54a 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkPatchOptionAProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkPatchOptionAProperties.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,7 +34,26 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(ExternalNetworkPatchOptionAProperties)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(PrimaryIPv4Prefix)) + { + writer.WritePropertyName("primaryIpv4Prefix"u8); + writer.WriteStringValue(PrimaryIPv4Prefix); + } + if (Optional.IsDefined(PrimaryIPv6Prefix)) + { + writer.WritePropertyName("primaryIpv6Prefix"u8); + writer.WriteStringValue(PrimaryIPv6Prefix); + } + if (Optional.IsDefined(SecondaryIPv4Prefix)) + { + writer.WritePropertyName("secondaryIpv4Prefix"u8); + writer.WriteStringValue(SecondaryIPv4Prefix); + } + if (Optional.IsDefined(SecondaryIPv6Prefix)) + { + writer.WritePropertyName("secondaryIpv6Prefix"u8); + writer.WriteStringValue(SecondaryIPv6Prefix); + } if (Optional.IsDefined(Mtu)) { writer.WritePropertyName("mtu"u8); @@ -70,6 +89,46 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("egressAclId"u8); writer.WriteStringValue(EgressAclId); } + if (Optional.IsDefined(BmpConfiguration)) + { + writer.WritePropertyName("bmpConfiguration"u8); + writer.WriteObjectValue(BmpConfiguration, options); + } + if (Optional.IsDefined(V4OverV6BgpSession)) + { + writer.WritePropertyName("v4OverV6BgpSession"u8); + writer.WriteStringValue(V4OverV6BgpSession.Value.ToString()); + } + if (Optional.IsDefined(V6OverV4BgpSession)) + { + writer.WritePropertyName("v6OverV4BgpSession"u8); + writer.WriteStringValue(V6OverV4BgpSession.Value.ToString()); + } + if (Optional.IsDefined(NativeIPv4PrefixLimit)) + { + writer.WritePropertyName("nativeIpv4PrefixLimit"u8); + writer.WriteObjectValue(NativeIPv4PrefixLimit, options); + } + if (Optional.IsDefined(NativeIPv6PrefixLimit)) + { + writer.WritePropertyName("nativeIpv6PrefixLimit"u8); + writer.WriteObjectValue(NativeIPv6PrefixLimit, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } ExternalNetworkPatchOptionAProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -92,21 +151,46 @@ internal static ExternalNetworkPatchOptionAProperties DeserializeExternalNetwork { return null; } + string primaryIPv4Prefix = default; + string primaryIPv6Prefix = default; + string secondaryIPv4Prefix = default; + string secondaryIPv6Prefix = default; int? mtu = default; int? vlanId = default; long? fabricAsn = default; long? peerAsn = default; - BfdConfiguration bfdConfiguration = default; + BfdPatchConfiguration bfdConfiguration = default; ResourceIdentifier ingressAclId = default; ResourceIdentifier egressAclId = default; - string primaryIPv4Prefix = default; - string primaryIPv6Prefix = default; - string secondaryIPv4Prefix = default; - string secondaryIPv6Prefix = default; + ExternalNetworkBmpPatchProperties bmpConfiguration = default; + V4OverV6BgpSessionState? v4OverV6BgpSession = default; + V6OverV4BgpSessionState? v6OverV4BgpSession = default; + NativeIPv4PrefixLimitPatchProperties nativeIPv4PrefixLimit = default; + NativeIPv6PrefixLimitPatchProperties nativeIPv6PrefixLimit = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("primaryIpv4Prefix"u8)) + { + primaryIPv4Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("primaryIpv6Prefix"u8)) + { + primaryIPv6Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("secondaryIpv4Prefix"u8)) + { + secondaryIPv4Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("secondaryIpv6Prefix"u8)) + { + secondaryIPv6Prefix = property.Value.GetString(); + continue; + } if (property.NameEquals("mtu"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -149,7 +233,7 @@ internal static ExternalNetworkPatchOptionAProperties DeserializeExternalNetwork { continue; } - bfdConfiguration = BfdConfiguration.DeserializeBfdConfiguration(property.Value, options); + bfdConfiguration = BfdPatchConfiguration.DeserializeBfdPatchConfiguration(property.Value, options); continue; } if (property.NameEquals("ingressAclId"u8)) @@ -170,24 +254,49 @@ internal static ExternalNetworkPatchOptionAProperties DeserializeExternalNetwork egressAclId = new ResourceIdentifier(property.Value.GetString()); continue; } - if (property.NameEquals("primaryIpv4Prefix"u8)) + if (property.NameEquals("bmpConfiguration"u8)) { - primaryIPv4Prefix = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bmpConfiguration = ExternalNetworkBmpPatchProperties.DeserializeExternalNetworkBmpPatchProperties(property.Value, options); continue; } - if (property.NameEquals("primaryIpv6Prefix"u8)) + if (property.NameEquals("v4OverV6BgpSession"u8)) { - primaryIPv6Prefix = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + v4OverV6BgpSession = new V4OverV6BgpSessionState(property.Value.GetString()); continue; } - if (property.NameEquals("secondaryIpv4Prefix"u8)) + if (property.NameEquals("v6OverV4BgpSession"u8)) { - secondaryIPv4Prefix = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + v6OverV4BgpSession = new V6OverV4BgpSessionState(property.Value.GetString()); continue; } - if (property.NameEquals("secondaryIpv6Prefix"u8)) + if (property.NameEquals("nativeIpv4PrefixLimit"u8)) { - secondaryIPv6Prefix = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nativeIPv4PrefixLimit = NativeIPv4PrefixLimitPatchProperties.DeserializeNativeIPv4PrefixLimitPatchProperties(property.Value, options); + continue; + } + if (property.NameEquals("nativeIpv6PrefixLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nativeIPv6PrefixLimit = NativeIPv6PrefixLimitPatchProperties.DeserializeNativeIPv6PrefixLimitPatchProperties(property.Value, options); continue; } if (options.Format != "W") @@ -201,14 +310,19 @@ internal static ExternalNetworkPatchOptionAProperties DeserializeExternalNetwork primaryIPv6Prefix, secondaryIPv4Prefix, secondaryIPv6Prefix, - serializedAdditionalRawData, mtu, vlanId, fabricAsn, peerAsn, bfdConfiguration, ingressAclId, - egressAclId); + egressAclId, + bmpConfiguration, + v4OverV6BgpSession, + v6OverV4BgpSession, + nativeIPv4PrefixLimit, + nativeIPv6PrefixLimit, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkPatchOptionAProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkPatchOptionAProperties.cs index 91586eedb3dc..b5a736c33063 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkPatchOptionAProperties.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkPatchOptionAProperties.cs @@ -12,8 +12,40 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// option A properties object. - public partial class ExternalNetworkPatchOptionAProperties : Layer3IPPrefixProperties + public partial class ExternalNetworkPatchOptionAProperties { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public ExternalNetworkPatchOptionAProperties() { @@ -24,7 +56,6 @@ public ExternalNetworkPatchOptionAProperties() /// IPv6 Address Prefix. /// Secondary IPv4 Address Prefix. /// Secondary IPv6 Address Prefix. - /// Keeps track of any properties unknown to the library. /// MTU to use for option A peering. /// Vlan identifier. Example : 501. /// Fabric ASN number. Example 65001. @@ -32,8 +63,18 @@ public ExternalNetworkPatchOptionAProperties() /// BFD configuration properties. /// Ingress Acl. ARM resource ID of Access Control Lists. /// Egress Acl. ARM resource ID of Access Control Lists. - internal ExternalNetworkPatchOptionAProperties(string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix, IDictionary serializedAdditionalRawData, int? mtu, int? vlanId, long? fabricAsn, long? peerAsn, BfdConfiguration bfdConfiguration, ResourceIdentifier ingressAclId, ResourceIdentifier egressAclId) : base(primaryIPv4Prefix, primaryIPv6Prefix, secondaryIPv4Prefix, secondaryIPv6Prefix, serializedAdditionalRawData) + /// BMP Monitor Configuration. + /// V4OverV6 BGP Session state. + /// V6OverV4 BGP Session state. + /// Native IPv4 prefix limit configuration. + /// Native IPv6 prefix limit configuration. + /// Keeps track of any properties unknown to the library. + internal ExternalNetworkPatchOptionAProperties(string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix, int? mtu, int? vlanId, long? fabricAsn, long? peerAsn, BfdPatchConfiguration bfdConfiguration, ResourceIdentifier ingressAclId, ResourceIdentifier egressAclId, ExternalNetworkBmpPatchProperties bmpConfiguration, V4OverV6BgpSessionState? v4OverV6BgpSession, V6OverV4BgpSessionState? v6OverV4BgpSession, NativeIPv4PrefixLimitPatchProperties nativeIPv4PrefixLimit, NativeIPv6PrefixLimitPatchProperties nativeIPv6PrefixLimit, IDictionary serializedAdditionalRawData) { + PrimaryIPv4Prefix = primaryIPv4Prefix; + PrimaryIPv6Prefix = primaryIPv6Prefix; + SecondaryIPv4Prefix = secondaryIPv4Prefix; + SecondaryIPv6Prefix = secondaryIPv6Prefix; Mtu = mtu; VlanId = vlanId; FabricAsn = fabricAsn; @@ -41,8 +82,22 @@ internal ExternalNetworkPatchOptionAProperties(string primaryIPv4Prefix, string BfdConfiguration = bfdConfiguration; IngressAclId = ingressAclId; EgressAclId = egressAclId; + BmpConfiguration = bmpConfiguration; + V4OverV6BgpSession = v4OverV6BgpSession; + V6OverV4BgpSession = v6OverV4BgpSession; + NativeIPv4PrefixLimit = nativeIPv4PrefixLimit; + NativeIPv6PrefixLimit = nativeIPv6PrefixLimit; + _serializedAdditionalRawData = serializedAdditionalRawData; } + /// IPv4 Address Prefix. + public string PrimaryIPv4Prefix { get; set; } + /// IPv6 Address Prefix. + public string PrimaryIPv6Prefix { get; set; } + /// Secondary IPv4 Address Prefix. + public string SecondaryIPv4Prefix { get; set; } + /// Secondary IPv6 Address Prefix. + public string SecondaryIPv6Prefix { get; set; } /// MTU to use for option A peering. public int? Mtu { get; set; } /// Vlan identifier. Example : 501. @@ -52,10 +107,53 @@ internal ExternalNetworkPatchOptionAProperties(string primaryIPv4Prefix, string /// Peer ASN number.Example : 28. public long? PeerAsn { get; set; } /// BFD configuration properties. - public BfdConfiguration BfdConfiguration { get; set; } + public BfdPatchConfiguration BfdConfiguration { get; set; } /// Ingress Acl. ARM resource ID of Access Control Lists. public ResourceIdentifier IngressAclId { get; set; } /// Egress Acl. ARM resource ID of Access Control Lists. public ResourceIdentifier EgressAclId { get; set; } + /// BMP Monitor Configuration. + internal ExternalNetworkBmpPatchProperties BmpConfiguration { get; set; } + /// BMP Configuration State. + public BmpConfigurationState? BmpConfigurationState + { + get => BmpConfiguration is null ? default : BmpConfiguration.ConfigurationState; + set + { + if (BmpConfiguration is null) + BmpConfiguration = new ExternalNetworkBmpPatchProperties(); + BmpConfiguration.ConfigurationState = value; + } + } + + /// V4OverV6 BGP Session state. + public V4OverV6BgpSessionState? V4OverV6BgpSession { get; set; } + /// V6OverV4 BGP Session state. + public V6OverV4BgpSessionState? V6OverV4BgpSession { get; set; } + /// Native IPv4 prefix limit configuration. + internal NativeIPv4PrefixLimitPatchProperties NativeIPv4PrefixLimit { get; set; } + /// Prefix limits. + public IList NativeIPv4PrefixLimits + { + get + { + if (NativeIPv4PrefixLimit is null) + NativeIPv4PrefixLimit = new NativeIPv4PrefixLimitPatchProperties(); + return NativeIPv4PrefixLimit.PrefixLimits; + } + } + + /// Native IPv6 prefix limit configuration. + internal NativeIPv6PrefixLimitPatchProperties NativeIPv6PrefixLimit { get; set; } + /// Prefix limits. + public IList NativeIPv6PrefixLimits + { + get + { + if (NativeIPv6PrefixLimit is null) + NativeIPv6PrefixLimit = new NativeIPv6PrefixLimitPatchProperties(); + return NativeIPv6PrefixLimit.PrefixLimits; + } + } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkPatchProperties.Serialization.cs new file mode 100644 index 000000000000..30b203538399 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkPatchProperties.Serialization.cs @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class ExternalNetworkPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExternalNetworkPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (Optional.IsDefined(NetworkToNetworkInterconnectId)) + { + writer.WritePropertyName("networkToNetworkInterconnectId"u8); + writer.WriteStringValue(NetworkToNetworkInterconnectId); + } + if (Optional.IsDefined(ImportRoutePolicy)) + { + writer.WritePropertyName("importRoutePolicy"u8); + writer.WriteObjectValue(ImportRoutePolicy, options); + } + if (Optional.IsDefined(ExportRoutePolicy)) + { + writer.WritePropertyName("exportRoutePolicy"u8); + writer.WriteObjectValue(ExportRoutePolicy, options); + } + if (Optional.IsDefined(PeeringOption)) + { + writer.WritePropertyName("peeringOption"u8); + writer.WriteStringValue(PeeringOption.Value.ToString()); + } + if (Optional.IsDefined(OptionBProperties)) + { + writer.WritePropertyName("optionBProperties"u8); + writer.WriteObjectValue(OptionBProperties, options); + } + if (Optional.IsDefined(OptionAProperties)) + { + writer.WritePropertyName("optionAProperties"u8); + writer.WriteObjectValue(OptionAProperties, options); + } + if (Optional.IsDefined(StaticRouteConfiguration)) + { + writer.WritePropertyName("staticRouteConfiguration"u8); + writer.WriteObjectValue(StaticRouteConfiguration, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExternalNetworkPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExternalNetworkPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExternalNetworkPatchProperties(document.RootElement, options); + } + + internal static ExternalNetworkPatchProperties DeserializeExternalNetworkPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + ResourceIdentifier networkToNetworkInterconnectId = default; + ImportRoutePolicyPatch importRoutePolicy = default; + ExportRoutePolicyPatch exportRoutePolicy = default; + PeeringOption? peeringOption = default; + L3OptionBPatchProperties optionBProperties = default; + ExternalNetworkPatchOptionAProperties optionAProperties = default; + ExternalNetworkStaticRoutePatchConfiguration staticRouteConfiguration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkToNetworkInterconnectId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkToNetworkInterconnectId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("importRoutePolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + importRoutePolicy = ImportRoutePolicyPatch.DeserializeImportRoutePolicyPatch(property.Value, options); + continue; + } + if (property.NameEquals("exportRoutePolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exportRoutePolicy = ExportRoutePolicyPatch.DeserializeExportRoutePolicyPatch(property.Value, options); + continue; + } + if (property.NameEquals("peeringOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peeringOption = new PeeringOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("optionBProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + optionBProperties = L3OptionBPatchProperties.DeserializeL3OptionBPatchProperties(property.Value, options); + continue; + } + if (property.NameEquals("optionAProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + optionAProperties = ExternalNetworkPatchOptionAProperties.DeserializeExternalNetworkPatchOptionAProperties(property.Value, options); + continue; + } + if (property.NameEquals("staticRouteConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + staticRouteConfiguration = ExternalNetworkStaticRoutePatchConfiguration.DeserializeExternalNetworkStaticRoutePatchConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExternalNetworkPatchProperties( + annotation, + networkToNetworkInterconnectId, + importRoutePolicy, + exportRoutePolicy, + peeringOption, + optionBProperties, + optionAProperties, + staticRouteConfiguration, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(ExternalNetworkPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + ExternalNetworkPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeExternalNetworkPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExternalNetworkPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkPatchProperties.cs new file mode 100644 index 000000000000..7b3d09b1bfb9 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkPatchProperties.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// External Network Patch properties. + public partial class ExternalNetworkPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExternalNetworkPatchProperties() + { + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// ARM Resource ID of the networkToNetworkInterconnectId of the ExternalNetwork resource. + /// Import Route Policy either IPv4 or IPv6. + /// Export Route Policy either IPv4 or IPv6. + /// Peering option list. + /// option B properties object. + /// option A properties object. + /// Static Route Configuration. + /// Keeps track of any properties unknown to the library. + internal ExternalNetworkPatchProperties(string annotation, ResourceIdentifier networkToNetworkInterconnectId, ImportRoutePolicyPatch importRoutePolicy, ExportRoutePolicyPatch exportRoutePolicy, PeeringOption? peeringOption, L3OptionBPatchProperties optionBProperties, ExternalNetworkPatchOptionAProperties optionAProperties, ExternalNetworkStaticRoutePatchConfiguration staticRouteConfiguration, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + NetworkToNetworkInterconnectId = networkToNetworkInterconnectId; + ImportRoutePolicy = importRoutePolicy; + ExportRoutePolicy = exportRoutePolicy; + PeeringOption = peeringOption; + OptionBProperties = optionBProperties; + OptionAProperties = optionAProperties; + StaticRouteConfiguration = staticRouteConfiguration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// ARM Resource ID of the networkToNetworkInterconnectId of the ExternalNetwork resource. + public ResourceIdentifier NetworkToNetworkInterconnectId { get; set; } + /// Import Route Policy either IPv4 or IPv6. + public ImportRoutePolicyPatch ImportRoutePolicy { get; set; } + /// Export Route Policy either IPv4 or IPv6. + public ExportRoutePolicyPatch ExportRoutePolicy { get; set; } + /// Peering option list. + public PeeringOption? PeeringOption { get; set; } + /// option B properties object. + public L3OptionBPatchProperties OptionBProperties { get; set; } + /// option A properties object. + public ExternalNetworkPatchOptionAProperties OptionAProperties { get; set; } + /// Static Route Configuration. + public ExternalNetworkStaticRoutePatchConfiguration StaticRouteConfiguration { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkRouteType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkRouteType.cs new file mode 100644 index 000000000000..305b42164ca0 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkRouteType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// External Network RouteType. + public readonly partial struct ExternalNetworkRouteType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ExternalNetworkRouteType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StaticValue = "Static"; + private const string OptionAValue = "OptionA"; + + /// ExternalNetwork Static. + public static ExternalNetworkRouteType Static { get; } = new ExternalNetworkRouteType(StaticValue); + /// ExternalNetwork OptionA. + public static ExternalNetworkRouteType OptionA { get; } = new ExternalNetworkRouteType(OptionAValue); + /// Determines if two values are the same. + public static bool operator ==(ExternalNetworkRouteType left, ExternalNetworkRouteType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ExternalNetworkRouteType left, ExternalNetworkRouteType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ExternalNetworkRouteType(string value) => new ExternalNetworkRouteType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ExternalNetworkRouteType other && Equals(other); + /// + public bool Equals(ExternalNetworkRouteType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkStaticRouteConfiguration.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkStaticRouteConfiguration.Serialization.cs similarity index 65% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkStaticRouteConfiguration.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkStaticRouteConfiguration.Serialization.cs index fa010cd69a49..8beb28ecc46b 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkStaticRouteConfiguration.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkStaticRouteConfiguration.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - public partial class InternalNetworkStaticRouteConfiguration : IUtf8JsonSerializable, IJsonModel + public partial class ExternalNetworkStaticRouteConfiguration : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -26,35 +26,69 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InternalNetworkStaticRouteConfiguration)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ExternalNetworkStaticRouteConfiguration)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Extension)) + if (Optional.IsDefined(BfdConfiguration)) { - writer.WritePropertyName("extension"u8); - writer.WriteStringValue(Extension.Value.ToString()); + writer.WritePropertyName("bfdConfiguration"u8); + writer.WriteObjectValue(BfdConfiguration, options); + } + if (Optional.IsCollectionDefined(IPv4Routes)) + { + writer.WritePropertyName("ipv4Routes"u8); + writer.WriteStartArray(); + foreach (var item in IPv4Routes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(IPv6Routes)) + { + writer.WritePropertyName("ipv6Routes"u8); + writer.WriteStartArray(); + foreach (var item in IPv6Routes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } } } - InternalNetworkStaticRouteConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ExternalNetworkStaticRouteConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InternalNetworkStaticRouteConfiguration)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ExternalNetworkStaticRouteConfiguration)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalNetworkStaticRouteConfiguration(document.RootElement, options); + return DeserializeExternalNetworkStaticRouteConfiguration(document.RootElement, options); } - internal static InternalNetworkStaticRouteConfiguration DeserializeInternalNetworkStaticRouteConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + internal static ExternalNetworkStaticRouteConfiguration DeserializeExternalNetworkStaticRouteConfiguration(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -62,7 +96,6 @@ internal static InternalNetworkStaticRouteConfiguration DeserializeInternalNetwo { return null; } - StaticRouteConfigurationExtension? extension = default; BfdConfiguration bfdConfiguration = default; IList ipv4Routes = default; IList ipv6Routes = default; @@ -70,15 +103,6 @@ internal static InternalNetworkStaticRouteConfiguration DeserializeInternalNetwo Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("extension"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - extension = new StaticRouteConfigurationExtension(property.Value.GetString()); - continue; - } if (property.NameEquals("bfdConfiguration"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -122,38 +146,38 @@ internal static InternalNetworkStaticRouteConfiguration DeserializeInternalNetwo } } serializedAdditionalRawData = rawDataDictionary; - return new InternalNetworkStaticRouteConfiguration(bfdConfiguration, ipv4Routes ?? new ChangeTrackingList(), ipv6Routes ?? new ChangeTrackingList(), serializedAdditionalRawData, extension); + return new ExternalNetworkStaticRouteConfiguration(bfdConfiguration, ipv4Routes ?? new ChangeTrackingList(), ipv6Routes ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(InternalNetworkStaticRouteConfiguration)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExternalNetworkStaticRouteConfiguration)} does not support writing '{options.Format}' format."); } } - InternalNetworkStaticRouteConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ExternalNetworkStaticRouteConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeInternalNetworkStaticRouteConfiguration(document.RootElement, options); + return DeserializeExternalNetworkStaticRouteConfiguration(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(InternalNetworkStaticRouteConfiguration)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExternalNetworkStaticRouteConfiguration)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkStaticRouteConfiguration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkStaticRouteConfiguration.cs new file mode 100644 index 000000000000..842dd948f0d4 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkStaticRouteConfiguration.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Static Route Configuration properties for ExternalNetwork. + public partial class ExternalNetworkStaticRouteConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExternalNetworkStaticRouteConfiguration() + { + IPv4Routes = new ChangeTrackingList(); + IPv6Routes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// BFD configuration properties. + /// List of IPv4 Routes. + /// List of IPv6 Routes. + /// Keeps track of any properties unknown to the library. + internal ExternalNetworkStaticRouteConfiguration(BfdConfiguration bfdConfiguration, IList ipv4Routes, IList ipv6Routes, IDictionary serializedAdditionalRawData) + { + BfdConfiguration = bfdConfiguration; + IPv4Routes = ipv4Routes; + IPv6Routes = ipv6Routes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// BFD configuration properties. + public BfdConfiguration BfdConfiguration { get; set; } + /// List of IPv4 Routes. + public IList IPv4Routes { get; } + /// List of IPv6 Routes. + public IList IPv6Routes { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkStaticRoutePatchConfiguration.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkStaticRoutePatchConfiguration.Serialization.cs new file mode 100644 index 000000000000..8a9e8c5fd787 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkStaticRoutePatchConfiguration.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class ExternalNetworkStaticRoutePatchConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExternalNetworkStaticRoutePatchConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(BfdConfiguration)) + { + writer.WritePropertyName("bfdConfiguration"u8); + writer.WriteObjectValue(BfdConfiguration, options); + } + if (Optional.IsCollectionDefined(IPv4Routes)) + { + writer.WritePropertyName("ipv4Routes"u8); + writer.WriteStartArray(); + foreach (var item in IPv4Routes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(IPv6Routes)) + { + writer.WritePropertyName("ipv6Routes"u8); + writer.WriteStartArray(); + foreach (var item in IPv6Routes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExternalNetworkStaticRoutePatchConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExternalNetworkStaticRoutePatchConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExternalNetworkStaticRoutePatchConfiguration(document.RootElement, options); + } + + internal static ExternalNetworkStaticRoutePatchConfiguration DeserializeExternalNetworkStaticRoutePatchConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BfdPatchConfiguration bfdConfiguration = default; + IList ipv4Routes = default; + IList ipv6Routes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("bfdConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bfdConfiguration = BfdPatchConfiguration.DeserializeBfdPatchConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("ipv4Routes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StaticRoutePatchProperties.DeserializeStaticRoutePatchProperties(item, options)); + } + ipv4Routes = array; + continue; + } + if (property.NameEquals("ipv6Routes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StaticRoutePatchProperties.DeserializeStaticRoutePatchProperties(item, options)); + } + ipv6Routes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExternalNetworkStaticRoutePatchConfiguration(bfdConfiguration, ipv4Routes ?? new ChangeTrackingList(), ipv6Routes ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(ExternalNetworkStaticRoutePatchConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ExternalNetworkStaticRoutePatchConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeExternalNetworkStaticRoutePatchConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExternalNetworkStaticRoutePatchConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkStaticRoutePatchConfiguration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkStaticRoutePatchConfiguration.cs new file mode 100644 index 000000000000..c59615f43dfb --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworkStaticRoutePatchConfiguration.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Static Route Configuration properties for External Network. + public partial class ExternalNetworkStaticRoutePatchConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExternalNetworkStaticRoutePatchConfiguration() + { + IPv4Routes = new ChangeTrackingList(); + IPv6Routes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// BFD configuration properties. + /// List of IPv4 Routes. + /// List of IPv6 Routes. + /// Keeps track of any properties unknown to the library. + internal ExternalNetworkStaticRoutePatchConfiguration(BfdPatchConfiguration bfdConfiguration, IList ipv4Routes, IList ipv6Routes, IDictionary serializedAdditionalRawData) + { + BfdConfiguration = bfdConfiguration; + IPv4Routes = ipv4Routes; + IPv6Routes = ipv6Routes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// BFD configuration properties. + public BfdPatchConfiguration BfdConfiguration { get; set; } + /// List of IPv4 Routes. + public IList IPv4Routes { get; } + /// List of IPv6 Routes. + public IList IPv6Routes { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworksList.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/FabricLockProperties.Serialization.cs similarity index 60% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworksList.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/FabricLockProperties.Serialization.cs index cc218c158ac3..3345e2ad330b 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ExternalNetworksList.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/FabricLockProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class ExternalNetworksList : IUtf8JsonSerializable, IJsonModel + public partial class FabricLockProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExternalNetworksList)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FabricLockProperties)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + if (Optional.IsDefined(LockState)) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WritePropertyName("lockState"u8); + writer.WriteStringValue(LockState.Value.ToString()); } - if (Optional.IsDefined(NextLink)) + if (Optional.IsDefined(LockType)) { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WritePropertyName("lockType"u8); + writer.WriteStringValue(LockType.Value.ToString()); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExternalNetworksList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FabricLockProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExternalNetworksList)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FabricLockProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExternalNetworksList(document.RootElement, options); + return DeserializeFabricLockProperties(document.RootElement, options); } - internal static ExternalNetworksList DeserializeExternalNetworksList(JsonElement element, ModelReaderWriterOptions options = null) + internal static FabricLockProperties DeserializeFabricLockProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,29 +81,28 @@ internal static ExternalNetworksList DeserializeExternalNetworksList(JsonElement { return null; } - IReadOnlyList value = default; - string nextLink = default; + LockConfigurationState? lockState = default; + NetworkFabricLockType? lockType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (property.NameEquals("lockState"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NetworkFabricExternalNetworkData.DeserializeNetworkFabricExternalNetworkData(item, options)); - } - value = array; + lockState = new LockConfigurationState(property.Value.GetString()); continue; } - if (property.NameEquals("nextLink"u8)) + if (property.NameEquals("lockType"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lockType = new NetworkFabricLockType(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +111,38 @@ internal static ExternalNetworksList DeserializeExternalNetworksList(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new ExternalNetworksList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new FabricLockProperties(lockState, lockType, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(ExternalNetworksList)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FabricLockProperties)} does not support writing '{options.Format}' format."); } } - ExternalNetworksList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FabricLockProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeExternalNetworksList(document.RootElement, options); + return DeserializeFabricLockProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExternalNetworksList)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FabricLockProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/FabricLockProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/FabricLockProperties.cs new file mode 100644 index 000000000000..e56aceccb7c4 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/FabricLockProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Network Fabric Lock Configuration. + public partial class FabricLockProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal FabricLockProperties() + { + } + + /// Initializes a new instance of . + /// NetworkFabric Lock State. + /// NetworkFabric Lock Type. + /// Keeps track of any properties unknown to the library. + internal FabricLockProperties(LockConfigurationState? lockState, NetworkFabricLockType? lockType, IDictionary serializedAdditionalRawData) + { + LockState = lockState; + LockType = lockType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// NetworkFabric Lock State. + public LockConfigurationState? LockState { get; } + /// NetworkFabric Lock Type. + public NetworkFabricLockType? LockType { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/FeatureFlagProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/FeatureFlagProperties.Serialization.cs new file mode 100644 index 000000000000..0d0af92be8ab --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/FeatureFlagProperties.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class FeatureFlagProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FeatureFlagProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(FeatureFlagName)) + { + writer.WritePropertyName("featureFlagName"u8); + writer.WriteStringValue(FeatureFlagName); + } + if (Optional.IsDefined(FeatureFlagValue)) + { + writer.WritePropertyName("featureFlagValue"u8); + writer.WriteStringValue(FeatureFlagValue); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FeatureFlagProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FeatureFlagProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFeatureFlagProperties(document.RootElement, options); + } + + internal static FeatureFlagProperties DeserializeFeatureFlagProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string featureFlagName = default; + string featureFlagValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("featureFlagName"u8)) + { + featureFlagName = property.Value.GetString(); + continue; + } + if (property.NameEquals("featureFlagValue"u8)) + { + featureFlagValue = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FeatureFlagProperties(featureFlagName, featureFlagValue, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(FeatureFlagProperties)} does not support writing '{options.Format}' format."); + } + } + + FeatureFlagProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFeatureFlagProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FeatureFlagProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/FeatureFlagProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/FeatureFlagProperties.cs new file mode 100644 index 000000000000..f74646730367 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/FeatureFlagProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Feature flag properties. + public partial class FeatureFlagProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal FeatureFlagProperties() + { + } + + /// Initializes a new instance of . + /// Feature flag name. + /// Feature flag value. + /// Keeps track of any properties unknown to the library. + internal FeatureFlagProperties(string featureFlagName, string featureFlagValue, IDictionary serializedAdditionalRawData) + { + FeatureFlagName = featureFlagName; + FeatureFlagValue = featureFlagValue; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Feature flag name. + public string FeatureFlagName { get; } + /// Feature flag value. + public string FeatureFlagValue { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalAccessControlListActionPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalAccessControlListActionPatchProperties.Serialization.cs new file mode 100644 index 000000000000..a402c441c856 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalAccessControlListActionPatchProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class GlobalAccessControlListActionPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GlobalAccessControlListActionPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(EnableCount)) + { + writer.WritePropertyName("enableCount"u8); + writer.WriteStringValue(EnableCount.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GlobalAccessControlListActionPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GlobalAccessControlListActionPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGlobalAccessControlListActionPatchProperties(document.RootElement, options); + } + + internal static GlobalAccessControlListActionPatchProperties DeserializeGlobalAccessControlListActionPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NetworkFabricBooleanValue? enableCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enableCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableCount = new NetworkFabricBooleanValue(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GlobalAccessControlListActionPatchProperties(enableCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(GlobalAccessControlListActionPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + GlobalAccessControlListActionPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGlobalAccessControlListActionPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GlobalAccessControlListActionPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalAccessControlListActionPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalAccessControlListActionPatchProperties.cs new file mode 100644 index 000000000000..2ec189118f83 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalAccessControlListActionPatchProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Global Access Control List actions patch properties. + internal partial class GlobalAccessControlListActionPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public GlobalAccessControlListActionPatchProperties() + { + } + + /// Initializes a new instance of . + /// Configuration to enable or disable ACL action count. + /// Keeps track of any properties unknown to the library. + internal GlobalAccessControlListActionPatchProperties(NetworkFabricBooleanValue? enableCount, IDictionary serializedAdditionalRawData) + { + EnableCount = enableCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Configuration to enable or disable ACL action count. + public NetworkFabricBooleanValue? EnableCount { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalAccessControlListActionProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalAccessControlListActionProperties.Serialization.cs new file mode 100644 index 000000000000..1118f264e750 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalAccessControlListActionProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class GlobalAccessControlListActionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GlobalAccessControlListActionProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(EnableCount)) + { + writer.WritePropertyName("enableCount"u8); + writer.WriteStringValue(EnableCount.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GlobalAccessControlListActionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GlobalAccessControlListActionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGlobalAccessControlListActionProperties(document.RootElement, options); + } + + internal static GlobalAccessControlListActionProperties DeserializeGlobalAccessControlListActionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NetworkFabricBooleanValue? enableCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enableCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableCount = new NetworkFabricBooleanValue(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GlobalAccessControlListActionProperties(enableCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(GlobalAccessControlListActionProperties)} does not support writing '{options.Format}' format."); + } + } + + GlobalAccessControlListActionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGlobalAccessControlListActionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GlobalAccessControlListActionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalAccessControlListActionProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalAccessControlListActionProperties.cs new file mode 100644 index 000000000000..50919952c53e --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalAccessControlListActionProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Global Access Control List actions properties. + internal partial class GlobalAccessControlListActionProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public GlobalAccessControlListActionProperties() + { + } + + /// Initializes a new instance of . + /// Configuration to enable or disable ACL action count. + /// Keeps track of any properties unknown to the library. + internal GlobalAccessControlListActionProperties(NetworkFabricBooleanValue? enableCount, IDictionary serializedAdditionalRawData) + { + EnableCount = enableCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Configuration to enable or disable ACL action count. + public NetworkFabricBooleanValue? EnableCount { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityAddOperationProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalNetworkTapRuleActionPatchProperties.Serialization.cs similarity index 62% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityAddOperationProperties.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalNetworkTapRuleActionPatchProperties.Serialization.cs index 4b8bc4b11ab7..e3f719d664e6 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityAddOperationProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalNetworkTapRuleActionPatchProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - public partial class IPExtendedCommunityAddOperationProperties : IUtf8JsonSerializable, IJsonModel + public partial class GlobalNetworkTapRuleActionPatchProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,16 +28,21 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IPExtendedCommunityAddOperationProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(GlobalNetworkTapRuleActionPatchProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Add)) + if (Optional.IsDefined(EnableCount)) { - writer.WritePropertyName("add"u8); - writer.WriteObjectValue(Add, options); + writer.WritePropertyName("enableCount"u8); + writer.WriteStringValue(EnableCount.Value.ToString()); + } + if (Optional.IsDefined(Truncate)) + { + writer.WritePropertyName("truncate"u8); + writer.WriteStringValue(Truncate); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -56,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - IPExtendedCommunityAddOperationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + GlobalNetworkTapRuleActionPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IPExtendedCommunityAddOperationProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(GlobalNetworkTapRuleActionPatchProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeIPExtendedCommunityAddOperationProperties(document.RootElement, options); + return DeserializeGlobalNetworkTapRuleActionPatchProperties(document.RootElement, options); } - internal static IPExtendedCommunityAddOperationProperties DeserializeIPExtendedCommunityAddOperationProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static GlobalNetworkTapRuleActionPatchProperties DeserializeGlobalNetworkTapRuleActionPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -76,18 +81,24 @@ internal static IPExtendedCommunityAddOperationProperties DeserializeIPExtendedC { return null; } - IPExtendedCommunityIdList @add = default; + NetworkFabricBooleanValue? enableCount = default; + string truncate = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("add"u8)) + if (property.NameEquals("enableCount"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - @add = IPExtendedCommunityIdList.DeserializeIPExtendedCommunityIdList(property.Value, options); + enableCount = new NetworkFabricBooleanValue(property.Value.GetString()); + continue; + } + if (property.NameEquals("truncate"u8)) + { + truncate = property.Value.GetString(); continue; } if (options.Format != "W") @@ -96,38 +107,38 @@ internal static IPExtendedCommunityAddOperationProperties DeserializeIPExtendedC } } serializedAdditionalRawData = rawDataDictionary; - return new IPExtendedCommunityAddOperationProperties(@add, serializedAdditionalRawData); + return new GlobalNetworkTapRuleActionPatchProperties(enableCount, truncate, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(IPExtendedCommunityAddOperationProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(GlobalNetworkTapRuleActionPatchProperties)} does not support writing '{options.Format}' format."); } } - IPExtendedCommunityAddOperationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + GlobalNetworkTapRuleActionPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeIPExtendedCommunityAddOperationProperties(document.RootElement, options); + return DeserializeGlobalNetworkTapRuleActionPatchProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(IPExtendedCommunityAddOperationProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(GlobalNetworkTapRuleActionPatchProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokersListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalNetworkTapRuleActionPatchProperties.cs similarity index 62% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokersListResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalNetworkTapRuleActionPatchProperties.cs index a5b3ad4556f6..ecf626a5e989 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokersListResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalNetworkTapRuleActionPatchProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of NetworkPacketBrokers. - internal partial class NetworkPacketBrokersListResult + /// Global network tap rule actions patch properties. + public partial class GlobalNetworkTapRuleActionPatchProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,25 @@ internal partial class NetworkPacketBrokersListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal NetworkPacketBrokersListResult() + /// Initializes a new instance of . + public GlobalNetworkTapRuleActionPatchProperties() { - Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of NetworkPacketBroker resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// Configuration to enable network tap rule counter. + /// Truncate. 0 indicates do not truncate. /// Keeps track of any properties unknown to the library. - internal NetworkPacketBrokersListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal GlobalNetworkTapRuleActionPatchProperties(NetworkFabricBooleanValue? enableCount, string truncate, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + EnableCount = enableCount; + Truncate = truncate; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of NetworkPacketBroker resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// Configuration to enable network tap rule counter. + public NetworkFabricBooleanValue? EnableCount { get; set; } + /// Truncate. 0 indicates do not truncate. + public string Truncate { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalNetworkTapRuleActionProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalNetworkTapRuleActionProperties.Serialization.cs new file mode 100644 index 000000000000..21f0434b6e71 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalNetworkTapRuleActionProperties.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class GlobalNetworkTapRuleActionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GlobalNetworkTapRuleActionProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(EnableCount)) + { + writer.WritePropertyName("enableCount"u8); + writer.WriteStringValue(EnableCount.Value.ToString()); + } + if (Optional.IsDefined(Truncate)) + { + writer.WritePropertyName("truncate"u8); + writer.WriteStringValue(Truncate); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GlobalNetworkTapRuleActionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GlobalNetworkTapRuleActionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGlobalNetworkTapRuleActionProperties(document.RootElement, options); + } + + internal static GlobalNetworkTapRuleActionProperties DeserializeGlobalNetworkTapRuleActionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NetworkFabricBooleanValue? enableCount = default; + string truncate = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enableCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableCount = new NetworkFabricBooleanValue(property.Value.GetString()); + continue; + } + if (property.NameEquals("truncate"u8)) + { + truncate = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GlobalNetworkTapRuleActionProperties(enableCount, truncate, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(GlobalNetworkTapRuleActionProperties)} does not support writing '{options.Format}' format."); + } + } + + GlobalNetworkTapRuleActionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGlobalNetworkTapRuleActionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GlobalNetworkTapRuleActionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceInterfacesList.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalNetworkTapRuleActionProperties.cs similarity index 64% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceInterfacesList.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalNetworkTapRuleActionProperties.cs index 46c5e7c2f054..c2b7c372d14e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceInterfacesList.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/GlobalNetworkTapRuleActionProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of NetworkInterfaces. - internal partial class NetworkDeviceInterfacesList + /// Global network tap rule actions properties. + public partial class GlobalNetworkTapRuleActionProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,25 @@ internal partial class NetworkDeviceInterfacesList /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal NetworkDeviceInterfacesList() + /// Initializes a new instance of . + public GlobalNetworkTapRuleActionProperties() { - Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of NetworkInterfaces resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// Configuration to enable network tap rule counter. + /// Truncate. 0 indicates do not truncate. /// Keeps track of any properties unknown to the library. - internal NetworkDeviceInterfacesList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal GlobalNetworkTapRuleActionProperties(NetworkFabricBooleanValue? enableCount, string truncate, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + EnableCount = enableCount; + Truncate = truncate; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of NetworkInterfaces resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// Configuration to enable network tap rule counter. + public NetworkFabricBooleanValue? EnableCount { get; set; } + /// Truncate. 0 indicates do not truncate. + public string Truncate { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/HeaderAddressProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/HeaderAddressProperties.Serialization.cs new file mode 100644 index 000000000000..2f65f8dd074f --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/HeaderAddressProperties.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class HeaderAddressProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HeaderAddressProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(HeaderName)) + { + writer.WritePropertyName("headerName"u8); + writer.WriteStringValue(HeaderName); + } + if (Optional.IsCollectionDefined(AddressList)) + { + writer.WritePropertyName("addressList"u8); + writer.WriteStartArray(); + foreach (var item in AddressList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HeaderAddressProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HeaderAddressProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHeaderAddressProperties(document.RootElement, options); + } + + internal static HeaderAddressProperties DeserializeHeaderAddressProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string headerName = default; + IList addressList = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("headerName"u8)) + { + headerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("addressList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + addressList = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HeaderAddressProperties(headerName, addressList ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(HeaderAddressProperties)} does not support writing '{options.Format}' format."); + } + } + + HeaderAddressProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHeaderAddressProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HeaderAddressProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/HeaderAddressProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/HeaderAddressProperties.cs new file mode 100644 index 000000000000..87aa2318c0db --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/HeaderAddressProperties.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Header name and source addresses associated with the header. + public partial class HeaderAddressProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public HeaderAddressProperties() + { + AddressList = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Name of the header. + /// List of source remote IP to be allowed or denied. + /// Keeps track of any properties unknown to the library. + internal HeaderAddressProperties(string headerName, IList addressList, IDictionary serializedAdditionalRawData) + { + HeaderName = headerName; + AddressList = addressList; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of the header. + public string HeaderName { get; set; } + /// List of source remote IP to be allowed or denied. + public IList AddressList { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityIdList.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityIdList.Serialization.cs index 9597af19f868..26afe08a7657 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityIdList.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityIdList.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - public partial class IPCommunityIdList : IUtf8JsonSerializable, IJsonModel + internal partial class IPCommunityIdList : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityIdList.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityIdList.cs index 4727dd0953e1..c923738b1fe7 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityIdList.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityIdList.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// IP Community ID list properties. - public partial class IPCommunityIdList + internal partial class IPCommunityIdList { /// /// Keeps track of any properties unknown to the library. @@ -44,7 +44,7 @@ public partial class IPCommunityIdList /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . public IPCommunityIdList() diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityListResult.Serialization.cs new file mode 100644 index 000000000000..0f96eca8b1b2 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class IPCommunityListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPCommunityListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IPCommunityListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPCommunityListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIPCommunityListResult(document.RootElement, options); + } + + internal static IPCommunityListResult DeserializeIPCommunityListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkFabricIPCommunityData.DeserializeNetworkFabricIPCommunityData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IPCommunityListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(IPCommunityListResult)} does not support writing '{options.Format}' format."); + } + } + + IPCommunityListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIPCommunityListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IPCommunityListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityListResult.cs new file mode 100644 index 000000000000..0684d9bfe3da --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a IpCommunity list operation. + internal partial class IPCommunityListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The IpCommunity items on this page. + /// is null. + internal IPCommunityListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The IpCommunity items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal IPCommunityListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IPCommunityListResult() + { + } + + /// The IpCommunity items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityPatchableProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityPatchableProperties.Serialization.cs new file mode 100644 index 000000000000..bfcfbce06185 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityPatchableProperties.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class IPCommunityPatchableProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPCommunityPatchableProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(IPCommunityRules)) + { + writer.WritePropertyName("ipCommunityRules"u8); + writer.WriteStartArray(); + foreach (var item in IPCommunityRules) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IPCommunityPatchableProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPCommunityPatchableProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIPCommunityPatchableProperties(document.RootElement, options); + } + + internal static IPCommunityPatchableProperties DeserializeIPCommunityPatchableProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList ipCommunityRules = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipCommunityRules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IPCommunityRule.DeserializeIPCommunityRule(item, options)); + } + ipCommunityRules = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IPCommunityPatchableProperties(ipCommunityRules ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(IPCommunityPatchableProperties)} does not support writing '{options.Format}' format."); + } + } + + IPCommunityPatchableProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIPCommunityPatchableProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IPCommunityPatchableProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixesListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityPatchableProperties.cs similarity index 68% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixesListResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityPatchableProperties.cs index 75c4ab83c577..aba0b5c3b068 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixesListResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityPatchableProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of IP Prefixes. - internal partial class IPPrefixesListResult + /// IP Community patchable properties. + internal partial class IPCommunityPatchableProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,22 @@ internal partial class IPPrefixesListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal IPPrefixesListResult() + /// Initializes a new instance of . + public IPCommunityPatchableProperties() { - Value = new ChangeTrackingList(); + IPCommunityRules = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of IP Prefix resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// List of IP Community Rules. /// Keeps track of any properties unknown to the library. - internal IPPrefixesListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal IPCommunityPatchableProperties(IList ipCommunityRules, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + IPCommunityRules = ipCommunityRules; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of IP Prefix resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// List of IP Community Rules. + public IList IPCommunityRules { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityProperties.Serialization.cs new file mode 100644 index 000000000000..4f41f516ec59 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityProperties.Serialization.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class IPCommunityProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPCommunityProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (options.Format != "W" && Optional.IsDefined(NetworkFabricId)) + { + writer.WritePropertyName("networkFabricId"u8); + writer.WriteStringValue(NetworkFabricId); + } + writer.WritePropertyName("ipCommunityRules"u8); + writer.WriteStartArray(); + foreach (var item in IPCommunityRules) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } + if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) + { + writer.WritePropertyName("configurationState"u8); + writer.WriteStringValue(ConfigurationState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) + { + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IPCommunityProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPCommunityProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIPCommunityProperties(document.RootElement, options); + } + + internal static IPCommunityProperties DeserializeIPCommunityProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + ResourceIdentifier networkFabricId = default; + IList ipCommunityRules = default; + LastOperationProperties lastOperation = default; + NetworkFabricConfigurationState? configurationState = default; + NetworkFabricProvisioningState? provisioningState = default; + NetworkFabricAdministrativeState? administrativeState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkFabricId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkFabricId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("ipCommunityRules"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IPCommunityRule.DeserializeIPCommunityRule(item, options)); + } + ipCommunityRules = array; + continue; + } + if (property.NameEquals("lastOperation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property.Value, options); + continue; + } + if (property.NameEquals("configurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configurationState = new NetworkFabricConfigurationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NetworkFabricProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("administrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeState = new NetworkFabricAdministrativeState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IPCommunityProperties( + annotation, + networkFabricId, + ipCommunityRules, + lastOperation, + configurationState, + provisioningState, + administrativeState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(IPCommunityProperties)} does not support writing '{options.Format}' format."); + } + } + + IPCommunityProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIPCommunityProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IPCommunityProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityProperties.cs new file mode 100644 index 000000000000..7099cdf34eec --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunityProperties.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// IP Community Properties defines the resource properties. + public partial class IPCommunityProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// List of IP Community Rules. + /// is null. + public IPCommunityProperties(IEnumerable ipCommunityRules) + { + Argument.AssertNotNull(ipCommunityRules, nameof(ipCommunityRules)); + + IPCommunityRules = ipCommunityRules.ToList(); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// ARM Resource ID of the Network Fabric. + /// List of IP Community Rules. + /// Details of the last operation performed on the resource. + /// Configuration state of the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// Keeps track of any properties unknown to the library. + internal IPCommunityProperties(string annotation, ResourceIdentifier networkFabricId, IList ipCommunityRules, LastOperationProperties lastOperation, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + NetworkFabricId = networkFabricId; + IPCommunityRules = ipCommunityRules; + LastOperation = lastOperation; + ConfigurationState = configurationState; + ProvisioningState = provisioningState; + AdministrativeState = administrativeState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IPCommunityProperties() + { + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// ARM Resource ID of the Network Fabric. + public ResourceIdentifier NetworkFabricId { get; } + /// List of IP Community Rules. + public IList IPCommunityRules { get; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + + /// Configuration state of the resource. + public NetworkFabricConfigurationState? ConfigurationState { get; } + /// Provisioning state of the resource. + public NetworkFabricProvisioningState? ProvisioningState { get; } + /// Administrative state of the resource. + public NetworkFabricAdministrativeState? AdministrativeState { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityIdList.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityIdList.cs index 9f827d32e04b..0911a52aac9c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityIdList.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityIdList.cs @@ -44,7 +44,7 @@ internal partial class IPExtendedCommunityIdList /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . public IPExtendedCommunityIdList() diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityListResult.Serialization.cs index 0b241621468d..b46a4b98870d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityListResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityListResult.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(IPExtendedCommunityListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static IPExtendedCommunityListResult DeserializeIPExtendedCommunityList return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static IPExtendedCommunityListResult DeserializeIPExtendedCommunityList } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static IPExtendedCommunityListResult DeserializeIPExtendedCommunityList } } serializedAdditionalRawData = rawDataDictionary; - return new IPExtendedCommunityListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new IPExtendedCommunityListResult(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityListResult.cs index 3d86ca40057f..9af60ac8e36f 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityListResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityListResult.cs @@ -7,10 +7,11 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of IP Extended Communities. + /// The response of a IpExtendedCommunity list operation. internal partial class IPExtendedCommunityListResult { /// @@ -46,25 +47,34 @@ internal partial class IPExtendedCommunityListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal IPExtendedCommunityListResult() + /// The IpExtendedCommunity items on this page. + /// is null. + internal IPExtendedCommunityListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// List of IP Extended Communities resources. - /// Url to follow for getting next page of resources. + /// The IpExtendedCommunity items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal IPExtendedCommunityListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal IPExtendedCommunityListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of IP Extended Communities resources. + /// Initializes a new instance of for deserialization. + internal IPExtendedCommunityListResult() + { + } + + /// The IpExtendedCommunity items on this page. public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityPatchProperties.Serialization.cs new file mode 100644 index 000000000000..7de1a6f71157 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityPatchProperties.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class IPExtendedCommunityPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPExtendedCommunityPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (Optional.IsCollectionDefined(IPExtendedCommunityRules)) + { + writer.WritePropertyName("ipExtendedCommunityRules"u8); + writer.WriteStartArray(); + foreach (var item in IPExtendedCommunityRules) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IPExtendedCommunityPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPExtendedCommunityPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIPExtendedCommunityPatchProperties(document.RootElement, options); + } + + internal static IPExtendedCommunityPatchProperties DeserializeIPExtendedCommunityPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + IList ipExtendedCommunityRules = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipExtendedCommunityRules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IPExtendedCommunityRule.DeserializeIPExtendedCommunityRule(item, options)); + } + ipExtendedCommunityRules = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IPExtendedCommunityPatchProperties(annotation, ipExtendedCommunityRules ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(IPExtendedCommunityPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + IPExtendedCommunityPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIPExtendedCommunityPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IPExtendedCommunityPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityPatchProperties.cs new file mode 100644 index 000000000000..45d20984e3f1 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityPatchProperties.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// IP Extended Community patchable properties. + public partial class IPExtendedCommunityPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public IPExtendedCommunityPatchProperties() + { + IPExtendedCommunityRules = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// List of IP Extended Community Rules. + /// Keeps track of any properties unknown to the library. + internal IPExtendedCommunityPatchProperties(string annotation, IList ipExtendedCommunityRules, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + IPExtendedCommunityRules = ipExtendedCommunityRules; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// List of IP Extended Community Rules. + public IList IPExtendedCommunityRules { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityProperties.Serialization.cs new file mode 100644 index 000000000000..fa4ded54e984 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityProperties.Serialization.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class IPExtendedCommunityProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPExtendedCommunityProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (options.Format != "W" && Optional.IsDefined(NetworkFabricId)) + { + writer.WritePropertyName("networkFabricId"u8); + writer.WriteStringValue(NetworkFabricId); + } + writer.WritePropertyName("ipExtendedCommunityRules"u8); + writer.WriteStartArray(); + foreach (var item in IPExtendedCommunityRules) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } + if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) + { + writer.WritePropertyName("configurationState"u8); + writer.WriteStringValue(ConfigurationState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) + { + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IPExtendedCommunityProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPExtendedCommunityProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIPExtendedCommunityProperties(document.RootElement, options); + } + + internal static IPExtendedCommunityProperties DeserializeIPExtendedCommunityProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + ResourceIdentifier networkFabricId = default; + IList ipExtendedCommunityRules = default; + LastOperationProperties lastOperation = default; + NetworkFabricConfigurationState? configurationState = default; + NetworkFabricProvisioningState? provisioningState = default; + NetworkFabricAdministrativeState? administrativeState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkFabricId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkFabricId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("ipExtendedCommunityRules"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IPExtendedCommunityRule.DeserializeIPExtendedCommunityRule(item, options)); + } + ipExtendedCommunityRules = array; + continue; + } + if (property.NameEquals("lastOperation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property.Value, options); + continue; + } + if (property.NameEquals("configurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configurationState = new NetworkFabricConfigurationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NetworkFabricProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("administrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeState = new NetworkFabricAdministrativeState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IPExtendedCommunityProperties( + annotation, + networkFabricId, + ipExtendedCommunityRules, + lastOperation, + configurationState, + provisioningState, + administrativeState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(IPExtendedCommunityProperties)} does not support writing '{options.Format}' format."); + } + } + + IPExtendedCommunityProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIPExtendedCommunityProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IPExtendedCommunityProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityProperties.cs new file mode 100644 index 000000000000..6115006ac7c2 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPExtendedCommunityProperties.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// IP Extended Community Properties defines the resource properties. + public partial class IPExtendedCommunityProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// List of IP Extended Community Rules. + /// is null. + public IPExtendedCommunityProperties(IEnumerable ipExtendedCommunityRules) + { + Argument.AssertNotNull(ipExtendedCommunityRules, nameof(ipExtendedCommunityRules)); + + IPExtendedCommunityRules = ipExtendedCommunityRules.ToList(); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// ARM Resource ID of the Network Fabric. + /// List of IP Extended Community Rules. + /// Details of the last operation performed on the resource. + /// Configuration state of the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// Keeps track of any properties unknown to the library. + internal IPExtendedCommunityProperties(string annotation, ResourceIdentifier networkFabricId, IList ipExtendedCommunityRules, LastOperationProperties lastOperation, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + NetworkFabricId = networkFabricId; + IPExtendedCommunityRules = ipExtendedCommunityRules; + LastOperation = lastOperation; + ConfigurationState = configurationState; + ProvisioningState = provisioningState; + AdministrativeState = administrativeState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IPExtendedCommunityProperties() + { + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// ARM Resource ID of the Network Fabric. + public ResourceIdentifier NetworkFabricId { get; } + /// List of IP Extended Community Rules. + public IList IPExtendedCommunityRules { get; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + + /// Configuration state of the resource. + public NetworkFabricConfigurationState? ConfigurationState { get; } + /// Provisioning state of the resource. + public NetworkFabricProvisioningState? ProvisioningState { get; } + /// Administrative state of the resource. + public NetworkFabricAdministrativeState? AdministrativeState { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPGroupPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPGroupPatchProperties.Serialization.cs new file mode 100644 index 000000000000..0ba677cb19be --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPGroupPatchProperties.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class IPGroupPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPGroupPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(IPAddressType)) + { + writer.WritePropertyName("ipAddressType"u8); + writer.WriteStringValue(IPAddressType.Value.ToString()); + } + if (Optional.IsCollectionDefined(IPPrefixes)) + { + writer.WritePropertyName("ipPrefixes"u8); + writer.WriteStartArray(); + foreach (var item in IPPrefixes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IPGroupPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPGroupPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIPGroupPatchProperties(document.RootElement, options); + } + + internal static IPGroupPatchProperties DeserializeIPGroupPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + NetworkFabricIPAddressType? ipAddressType = default; + IList ipPrefixes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddressType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ipAddressType = new NetworkFabricIPAddressType(property.Value.GetString()); + continue; + } + if (property.NameEquals("ipPrefixes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipPrefixes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IPGroupPatchProperties(name, ipAddressType, ipPrefixes ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(IPGroupPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + IPGroupPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIPGroupPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IPGroupPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPGroupPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPGroupPatchProperties.cs new file mode 100644 index 000000000000..a013f7cc0bee --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPGroupPatchProperties.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// IP Group properties. + public partial class IPGroupPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public IPGroupPatchProperties() + { + IPPrefixes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// IP Group name. + /// IP Address type. + /// List of IP Prefixes. + /// Keeps track of any properties unknown to the library. + internal IPGroupPatchProperties(string name, NetworkFabricIPAddressType? ipAddressType, IList ipPrefixes, IDictionary serializedAdditionalRawData) + { + Name = name; + IPAddressType = ipAddressType; + IPPrefixes = ipPrefixes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// IP Group name. + public string Name { get; set; } + /// IP Address type. + public NetworkFabricIPAddressType? IPAddressType { get; set; } + /// List of IP Prefixes. + public IList IPPrefixes { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPMatchConditionPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPMatchConditionPatch.Serialization.cs new file mode 100644 index 000000000000..794bed87056c --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPMatchConditionPatch.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class IPMatchConditionPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPMatchConditionPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SourceDestinationType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(SourceDestinationType.Value.ToString()); + } + if (Optional.IsDefined(PrefixType)) + { + writer.WritePropertyName("prefixType"u8); + writer.WriteStringValue(PrefixType.Value.ToString()); + } + if (Optional.IsCollectionDefined(IPPrefixValues)) + { + writer.WritePropertyName("ipPrefixValues"u8); + writer.WriteStartArray(); + foreach (var item in IPPrefixValues) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(IPGroupNames)) + { + writer.WritePropertyName("ipGroupNames"u8); + writer.WriteStartArray(); + foreach (var item in IPGroupNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IPMatchConditionPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPMatchConditionPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIPMatchConditionPatch(document.RootElement, options); + } + + internal static IPMatchConditionPatch DeserializeIPMatchConditionPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SourceDestinationType? type = default; + IPMatchConditionPrefixType? prefixType = default; + IList ipPrefixValues = default; + IList ipGroupNames = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new SourceDestinationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("prefixType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + prefixType = new IPMatchConditionPrefixType(property.Value.GetString()); + continue; + } + if (property.NameEquals("ipPrefixValues"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipPrefixValues = array; + continue; + } + if (property.NameEquals("ipGroupNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipGroupNames = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IPMatchConditionPatch(type, prefixType, ipPrefixValues ?? new ChangeTrackingList(), ipGroupNames ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(IPMatchConditionPatch)} does not support writing '{options.Format}' format."); + } + } + + IPMatchConditionPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIPMatchConditionPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IPMatchConditionPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPMatchConditionPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPMatchConditionPatch.cs new file mode 100644 index 000000000000..38888452ae95 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPMatchConditionPatch.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Defines the condition that can be filtered using the selected IPs. + public partial class IPMatchConditionPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public IPMatchConditionPatch() + { + IPPrefixValues = new ChangeTrackingList(); + IPGroupNames = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// IP Address type that needs to be matched. + /// IP Prefix Type that needs to be matched. + /// The list of IP Prefixes that need to be matched. + /// The List of IP Group Names that need to be matched. + /// Keeps track of any properties unknown to the library. + internal IPMatchConditionPatch(SourceDestinationType? sourceDestinationType, IPMatchConditionPrefixType? prefixType, IList ipPrefixValues, IList ipGroupNames, IDictionary serializedAdditionalRawData) + { + SourceDestinationType = sourceDestinationType; + PrefixType = prefixType; + IPPrefixValues = ipPrefixValues; + IPGroupNames = ipGroupNames; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// IP Address type that needs to be matched. + public SourceDestinationType? SourceDestinationType { get; set; } + /// IP Prefix Type that needs to be matched. + public IPMatchConditionPrefixType? PrefixType { get; set; } + /// The list of IP Prefixes that need to be matched. + public IList IPPrefixValues { get; } + /// The List of IP Group Names that need to be matched. + public IList IPGroupNames { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPMatchConditionPrefixType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPMatchConditionPrefixType.cs index 03dc72a3127d..d26eba31e883 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPMatchConditionPrefixType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPMatchConditionPrefixType.cs @@ -25,9 +25,9 @@ public IPMatchConditionPrefixType(string value) private const string PrefixValue = "Prefix"; private const string LongestPrefixValue = "LongestPrefix"; - /// Prefix. + /// PrefixType Prefix. public static IPMatchConditionPrefixType Prefix { get; } = new IPMatchConditionPrefixType(PrefixValue); - /// LongestPrefix. + /// PrefixType LongestPrefix. public static IPMatchConditionPrefixType LongestPrefix { get; } = new IPMatchConditionPrefixType(LongestPrefixValue); /// Determines if two values are the same. public static bool operator ==(IPMatchConditionPrefixType left, IPMatchConditionPrefixType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixListResult.Serialization.cs new file mode 100644 index 000000000000..4a9feb27551c --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class IPPrefixListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPPrefixListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IPPrefixListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPPrefixListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIPPrefixListResult(document.RootElement, options); + } + + internal static IPPrefixListResult DeserializeIPPrefixListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkFabricIPPrefixData.DeserializeNetworkFabricIPPrefixData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IPPrefixListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(IPPrefixListResult)} does not support writing '{options.Format}' format."); + } + } + + IPPrefixListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIPPrefixListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IPPrefixListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixListResult.cs new file mode 100644 index 000000000000..1de8b25abc51 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a IpPrefix list operation. + internal partial class IPPrefixListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The IpPrefix items on this page. + /// is null. + internal IPPrefixListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The IpPrefix items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal IPPrefixListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IPPrefixListResult() + { + } + + /// The IpPrefix items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixPatchProperties.Serialization.cs new file mode 100644 index 000000000000..d66122ebbd9b --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixPatchProperties.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class IPPrefixPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPPrefixPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (Optional.IsCollectionDefined(IPPrefixRules)) + { + writer.WritePropertyName("ipPrefixRules"u8); + writer.WriteStartArray(); + foreach (var item in IPPrefixRules) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IPPrefixPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPPrefixPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIPPrefixPatchProperties(document.RootElement, options); + } + + internal static IPPrefixPatchProperties DeserializeIPPrefixPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + IList ipPrefixRules = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipPrefixRules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IPPrefixRule.DeserializeIPPrefixRule(item, options)); + } + ipPrefixRules = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IPPrefixPatchProperties(annotation, ipPrefixRules ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(IPPrefixPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + IPPrefixPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIPPrefixPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IPPrefixPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AnnotationResourceProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixPatchProperties.cs similarity index 69% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AnnotationResourceProperties.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixPatchProperties.cs index 3229a53f581b..723458bd4a2e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AnnotationResourceProperties.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixPatchProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// Switch configuration entries require a description to discern between configuration groups. - public partial class AnnotationResourceProperties + /// IP Prefix patchable properties. + public partial class IPPrefixPatchProperties { /// /// Keeps track of any properties unknown to the library. @@ -43,23 +43,28 @@ public partial class AnnotationResourceProperties /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public AnnotationResourceProperties() + /// Initializes a new instance of . + public IPPrefixPatchProperties() { + IPPrefixRules = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Switch configuration description. + /// The list of IP Prefix Rules. /// Keeps track of any properties unknown to the library. - internal AnnotationResourceProperties(string annotation, IDictionary serializedAdditionalRawData) + internal IPPrefixPatchProperties(string annotation, IList ipPrefixRules, IDictionary serializedAdditionalRawData) { Annotation = annotation; + IPPrefixRules = ipPrefixRules; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Switch configuration description. public string Annotation { get; set; } + /// The list of IP Prefix Rules. + public IList IPPrefixRules { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixProperties.Serialization.cs new file mode 100644 index 000000000000..34e145b39d8c --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixProperties.Serialization.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class IPPrefixProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPPrefixProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (options.Format != "W" && Optional.IsDefined(NetworkFabricId)) + { + writer.WritePropertyName("networkFabricId"u8); + writer.WriteStringValue(NetworkFabricId); + } + writer.WritePropertyName("ipPrefixRules"u8); + writer.WriteStartArray(); + foreach (var item in IPPrefixRules) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } + if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) + { + writer.WritePropertyName("configurationState"u8); + writer.WriteStringValue(ConfigurationState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) + { + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IPPrefixProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPPrefixProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIPPrefixProperties(document.RootElement, options); + } + + internal static IPPrefixProperties DeserializeIPPrefixProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + ResourceIdentifier networkFabricId = default; + IList ipPrefixRules = default; + LastOperationProperties lastOperation = default; + NetworkFabricConfigurationState? configurationState = default; + NetworkFabricProvisioningState? provisioningState = default; + NetworkFabricAdministrativeState? administrativeState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkFabricId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkFabricId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("ipPrefixRules"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IPPrefixRule.DeserializeIPPrefixRule(item, options)); + } + ipPrefixRules = array; + continue; + } + if (property.NameEquals("lastOperation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property.Value, options); + continue; + } + if (property.NameEquals("configurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configurationState = new NetworkFabricConfigurationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NetworkFabricProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("administrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeState = new NetworkFabricAdministrativeState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IPPrefixProperties( + annotation, + networkFabricId, + ipPrefixRules, + lastOperation, + configurationState, + provisioningState, + administrativeState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(IPPrefixProperties)} does not support writing '{options.Format}' format."); + } + } + + IPPrefixProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIPPrefixProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IPPrefixProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixProperties.cs new file mode 100644 index 000000000000..a74103feb95d --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixProperties.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// IP Prefix Properties defines the properties of the resource. + public partial class IPPrefixProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The list of IP Prefix Rules. + /// is null. + public IPPrefixProperties(IEnumerable ipPrefixRules) + { + Argument.AssertNotNull(ipPrefixRules, nameof(ipPrefixRules)); + + IPPrefixRules = ipPrefixRules.ToList(); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// ARM Resource ID of the Network Fabric. + /// The list of IP Prefix Rules. + /// Details of the last operation performed on the resource. + /// Configuration state of the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// Keeps track of any properties unknown to the library. + internal IPPrefixProperties(string annotation, ResourceIdentifier networkFabricId, IList ipPrefixRules, LastOperationProperties lastOperation, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + NetworkFabricId = networkFabricId; + IPPrefixRules = ipPrefixRules; + LastOperation = lastOperation; + ConfigurationState = configurationState; + ProvisioningState = provisioningState; + AdministrativeState = administrativeState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IPPrefixProperties() + { + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// ARM Resource ID of the Network Fabric. + public ResourceIdentifier NetworkFabricId { get; } + /// The list of IP Prefix Rules. + public IList IPPrefixRules { get; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + + /// Configuration state of the resource. + public NetworkFabricConfigurationState? ConfigurationState { get; } + /// Provisioning state of the resource. + public NetworkFabricProvisioningState? ProvisioningState { get; } + /// Administrative state of the resource. + public NetworkFabricAdministrativeState? AdministrativeState { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixRuleCondition.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixRuleCondition.cs index 9bb061440f52..9eb680d3cc6e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixRuleCondition.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixRuleCondition.cs @@ -27,13 +27,13 @@ public IPPrefixRuleCondition(string value) private const string LesserThanOrEqualToValue = "LesserThanOrEqualTo"; private const string RangeValue = "Range"; - /// EqualTo. + /// Condition-EqualTo. public static IPPrefixRuleCondition EqualTo { get; } = new IPPrefixRuleCondition(EqualToValue); - /// GreaterThanOrEqualTo. + /// Condition-GreaterThanOrEqualTo. public static IPPrefixRuleCondition GreaterThanOrEqualTo { get; } = new IPPrefixRuleCondition(GreaterThanOrEqualToValue); - /// LesserThanOrEqualTo. + /// Condition-LesserThanOrEqualTo. public static IPPrefixRuleCondition LesserThanOrEqualTo { get; } = new IPPrefixRuleCondition(LesserThanOrEqualToValue); - /// Range. + /// Condition-Range. public static IPPrefixRuleCondition Range { get; } = new IPPrefixRuleCondition(RangeValue); /// Determines if two values are the same. public static bool operator ==(IPPrefixRuleCondition left, IPPrefixRuleCondition right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IcmpConfigurationPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IcmpConfigurationPatchProperties.Serialization.cs new file mode 100644 index 000000000000..2390400e0a00 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IcmpConfigurationPatchProperties.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class IcmpConfigurationPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IcmpConfigurationPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(IcmpTypes)) + { + writer.WritePropertyName("icmpTypes"u8); + writer.WriteStartArray(); + foreach (var item in IcmpTypes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IcmpConfigurationPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IcmpConfigurationPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIcmpConfigurationPatchProperties(document.RootElement, options); + } + + internal static IcmpConfigurationPatchProperties DeserializeIcmpConfigurationPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList icmpTypes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("icmpTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + icmpTypes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IcmpConfigurationPatchProperties(icmpTypes ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(IcmpConfigurationPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + IcmpConfigurationPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIcmpConfigurationPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IcmpConfigurationPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunitiesListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IcmpConfigurationPatchProperties.cs similarity index 67% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunitiesListResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IcmpConfigurationPatchProperties.cs index 8cc13ddd72fd..a2065a77db13 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunitiesListResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IcmpConfigurationPatchProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of IP Communities. - internal partial class IPCommunitiesListResult + /// Internet Control Message Protocol (ICMP) configuration patch properties. + internal partial class IcmpConfigurationPatchProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,22 @@ internal partial class IPCommunitiesListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal IPCommunitiesListResult() + /// Initializes a new instance of . + public IcmpConfigurationPatchProperties() { - Value = new ChangeTrackingList(); + IcmpTypes = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of IP Community resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// Internet Control Message Protocol (ICMP) types. /// Keeps track of any properties unknown to the library. - internal IPCommunitiesListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal IcmpConfigurationPatchProperties(IList icmpTypes, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + IcmpTypes = icmpTypes; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of IP Community resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// Internet Control Message Protocol (ICMP) types. + public IList IcmpTypes { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IcmpConfigurationProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IcmpConfigurationProperties.Serialization.cs new file mode 100644 index 000000000000..25f2b00b6bfd --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IcmpConfigurationProperties.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class IcmpConfigurationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IcmpConfigurationProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(IcmpTypes)) + { + writer.WritePropertyName("icmpTypes"u8); + writer.WriteStartArray(); + foreach (var item in IcmpTypes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IcmpConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IcmpConfigurationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIcmpConfigurationProperties(document.RootElement, options); + } + + internal static IcmpConfigurationProperties DeserializeIcmpConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList icmpTypes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("icmpTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + icmpTypes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IcmpConfigurationProperties(icmpTypes ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(IcmpConfigurationProperties)} does not support writing '{options.Format}' format."); + } + } + + IcmpConfigurationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIcmpConfigurationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IcmpConfigurationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworksList.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IcmpConfigurationProperties.cs similarity index 67% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworksList.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IcmpConfigurationProperties.cs index a838dcfed312..e8fbabf7222c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworksList.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IcmpConfigurationProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of Internal Networks. - internal partial class InternalNetworksList + /// Internet Control Message Protocol (ICMP) configuration. + internal partial class IcmpConfigurationProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,22 @@ internal partial class InternalNetworksList /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal InternalNetworksList() + /// Initializes a new instance of . + public IcmpConfigurationProperties() { - Value = new ChangeTrackingList(); + IcmpTypes = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of Internal Network resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// Internet Control Message Protocol (ICMP) types. /// Keeps track of any properties unknown to the library. - internal InternalNetworksList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal IcmpConfigurationProperties(IList icmpTypes, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + IcmpTypes = icmpTypes; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of Internal Network resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// Internet Control Message Protocol (ICMP) types. + public IList IcmpTypes { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IdentitySelector.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IdentitySelector.Serialization.cs new file mode 100644 index 000000000000..7e685bd597aa --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IdentitySelector.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class IdentitySelector : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IdentitySelector)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("identityType"u8); + writer.WriteStringValue(IdentityType.ToString()); + if (Optional.IsDefined(UserAssignedIdentityResourceId)) + { + writer.WritePropertyName("userAssignedIdentityResourceId"u8); + writer.WriteStringValue(UserAssignedIdentityResourceId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IdentitySelector IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IdentitySelector)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIdentitySelector(document.RootElement, options); + } + + internal static IdentitySelector DeserializeIdentitySelector(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentitySelectorType identityType = default; + ResourceIdentifier userAssignedIdentityResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identityType"u8)) + { + identityType = new ManagedServiceIdentitySelectorType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userAssignedIdentityResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userAssignedIdentityResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IdentitySelector(identityType, userAssignedIdentityResourceId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(IdentitySelector)} does not support writing '{options.Format}' format."); + } + } + + IdentitySelector IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIdentitySelector(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IdentitySelector)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IdentitySelector.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IdentitySelector.cs new file mode 100644 index 000000000000..245f35e9cd02 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IdentitySelector.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// IdentitySelector represents the selection of a managed identity for use. + public partial class IdentitySelector + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The type of managed identity that is being selected. + public IdentitySelector(ManagedServiceIdentitySelectorType identityType) + { + IdentityType = identityType; + } + + /// Initializes a new instance of . + /// The type of managed identity that is being selected. + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// Keeps track of any properties unknown to the library. + internal IdentitySelector(ManagedServiceIdentitySelectorType identityType, ResourceIdentifier userAssignedIdentityResourceId, IDictionary serializedAdditionalRawData) + { + IdentityType = identityType; + UserAssignedIdentityResourceId = userAssignedIdentityResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IdentitySelector() + { + } + + /// The type of managed identity that is being selected. + public ManagedServiceIdentitySelectorType IdentityType { get; set; } + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + public ResourceIdentifier UserAssignedIdentityResourceId { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IdentitySelectorPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IdentitySelectorPatch.Serialization.cs new file mode 100644 index 000000000000..3b83a263379d --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IdentitySelectorPatch.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class IdentitySelectorPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IdentitySelectorPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IdentityType)) + { + writer.WritePropertyName("identityType"u8); + writer.WriteStringValue(IdentityType.Value.ToString()); + } + if (Optional.IsDefined(UserAssignedIdentityResourceId)) + { + writer.WritePropertyName("userAssignedIdentityResourceId"u8); + writer.WriteStringValue(UserAssignedIdentityResourceId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IdentitySelectorPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IdentitySelectorPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIdentitySelectorPatch(document.RootElement, options); + } + + internal static IdentitySelectorPatch DeserializeIdentitySelectorPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentitySelectorType? identityType = default; + ResourceIdentifier userAssignedIdentityResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identityType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identityType = new ManagedServiceIdentitySelectorType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userAssignedIdentityResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userAssignedIdentityResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IdentitySelectorPatch(identityType, userAssignedIdentityResourceId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(IdentitySelectorPatch)} does not support writing '{options.Format}' format."); + } + } + + IdentitySelectorPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIdentitySelectorPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IdentitySelectorPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IdentitySelectorPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IdentitySelectorPatch.cs new file mode 100644 index 000000000000..97dee9843dcb --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IdentitySelectorPatch.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// IdentitySelector represents the selection of a managed identity for use. + public partial class IdentitySelectorPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public IdentitySelectorPatch() + { + } + + /// Initializes a new instance of . + /// The type of managed identity that is being selected. + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// Keeps track of any properties unknown to the library. + internal IdentitySelectorPatch(ManagedServiceIdentitySelectorType? identityType, ResourceIdentifier userAssignedIdentityResourceId, IDictionary serializedAdditionalRawData) + { + IdentityType = identityType; + UserAssignedIdentityResourceId = userAssignedIdentityResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of managed identity that is being selected. + public ManagedServiceIdentitySelectorType? IdentityType { get; set; } + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + public ResourceIdentifier UserAssignedIdentityResourceId { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ImportRoutePolicyInformationPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ImportRoutePolicyInformationPatch.Serialization.cs new file mode 100644 index 000000000000..0dee49142f4c --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ImportRoutePolicyInformationPatch.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class ImportRoutePolicyInformationPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImportRoutePolicyInformationPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ImportIPv4RoutePolicyId)) + { + writer.WritePropertyName("importIpv4RoutePolicyId"u8); + writer.WriteStringValue(ImportIPv4RoutePolicyId); + } + if (Optional.IsDefined(ImportIPv6RoutePolicyId)) + { + writer.WritePropertyName("importIpv6RoutePolicyId"u8); + writer.WriteStringValue(ImportIPv6RoutePolicyId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImportRoutePolicyInformationPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImportRoutePolicyInformationPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImportRoutePolicyInformationPatch(document.RootElement, options); + } + + internal static ImportRoutePolicyInformationPatch DeserializeImportRoutePolicyInformationPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier importIPv4RoutePolicyId = default; + ResourceIdentifier importIPv6RoutePolicyId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("importIpv4RoutePolicyId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + importIPv4RoutePolicyId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("importIpv6RoutePolicyId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + importIPv6RoutePolicyId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImportRoutePolicyInformationPatch(importIPv4RoutePolicyId, importIPv6RoutePolicyId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(ImportRoutePolicyInformationPatch)} does not support writing '{options.Format}' format."); + } + } + + ImportRoutePolicyInformationPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeImportRoutePolicyInformationPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImportRoutePolicyInformationPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ImportRoutePolicyInformationPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ImportRoutePolicyInformationPatch.cs new file mode 100644 index 000000000000..73b5dc4e2efa --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ImportRoutePolicyInformationPatch.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Import Route Policy Configuration. + public partial class ImportRoutePolicyInformationPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ImportRoutePolicyInformationPatch() + { + } + + /// Initializes a new instance of . + /// Import IPv4 Route Policy Id. + /// Import IPv6 Route Policy Id. + /// Keeps track of any properties unknown to the library. + internal ImportRoutePolicyInformationPatch(ResourceIdentifier importIPv4RoutePolicyId, ResourceIdentifier importIPv6RoutePolicyId, IDictionary serializedAdditionalRawData) + { + ImportIPv4RoutePolicyId = importIPv4RoutePolicyId; + ImportIPv6RoutePolicyId = importIPv6RoutePolicyId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Import IPv4 Route Policy Id. + public ResourceIdentifier ImportIPv4RoutePolicyId { get; set; } + /// Import IPv6 Route Policy Id. + public ResourceIdentifier ImportIPv6RoutePolicyId { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ImportRoutePolicyPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ImportRoutePolicyPatch.Serialization.cs new file mode 100644 index 000000000000..8e80e31815cd --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ImportRoutePolicyPatch.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class ImportRoutePolicyPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImportRoutePolicyPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ImportIPv4RoutePolicyId)) + { + writer.WritePropertyName("importIpv4RoutePolicyId"u8); + writer.WriteStringValue(ImportIPv4RoutePolicyId); + } + if (Optional.IsDefined(ImportIPv6RoutePolicyId)) + { + writer.WritePropertyName("importIpv6RoutePolicyId"u8); + writer.WriteStringValue(ImportIPv6RoutePolicyId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImportRoutePolicyPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImportRoutePolicyPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImportRoutePolicyPatch(document.RootElement, options); + } + + internal static ImportRoutePolicyPatch DeserializeImportRoutePolicyPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier importIPv4RoutePolicyId = default; + ResourceIdentifier importIPv6RoutePolicyId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("importIpv4RoutePolicyId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + importIPv4RoutePolicyId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("importIpv6RoutePolicyId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + importIPv6RoutePolicyId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImportRoutePolicyPatch(importIPv4RoutePolicyId, importIPv6RoutePolicyId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(ImportRoutePolicyPatch)} does not support writing '{options.Format}' format."); + } + } + + ImportRoutePolicyPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeImportRoutePolicyPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImportRoutePolicyPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ImportRoutePolicyPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ImportRoutePolicyPatch.cs new file mode 100644 index 000000000000..5d8c2842393a --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ImportRoutePolicyPatch.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Import Route Policy either IPv4 or IPv6. + public partial class ImportRoutePolicyPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ImportRoutePolicyPatch() + { + } + + /// Initializes a new instance of . + /// ARM resource ID of RoutePolicy. + /// ARM resource ID of RoutePolicy. + /// Keeps track of any properties unknown to the library. + internal ImportRoutePolicyPatch(ResourceIdentifier importIPv4RoutePolicyId, ResourceIdentifier importIPv6RoutePolicyId, IDictionary serializedAdditionalRawData) + { + ImportIPv4RoutePolicyId = importIPv4RoutePolicyId; + ImportIPv6RoutePolicyId = importIPv6RoutePolicyId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// ARM resource ID of RoutePolicy. + public ResourceIdentifier ImportIPv4RoutePolicyId { get; set; } + /// ARM resource ID of RoutePolicy. + public ResourceIdentifier ImportIPv6RoutePolicyId { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBfdAdministrativeStateContent.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBfdAdministrativeStateContent.Serialization.cs new file mode 100644 index 000000000000..b7b36f9006af --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBfdAdministrativeStateContent.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class InternalNetworkBfdAdministrativeStateContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternalNetworkBfdAdministrativeStateContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RouteType)) + { + writer.WritePropertyName("routeType"u8); + writer.WriteStringValue(RouteType.Value.ToString()); + } + if (Optional.IsDefined(NeighborAddress)) + { + writer.WritePropertyName("neighborAddress"u8); + writer.WriteStringValue(NeighborAddress); + } + if (Optional.IsDefined(AdministrativeState)) + { + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InternalNetworkBfdAdministrativeStateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternalNetworkBfdAdministrativeStateContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInternalNetworkBfdAdministrativeStateContent(document.RootElement, options); + } + + internal static InternalNetworkBfdAdministrativeStateContent DeserializeInternalNetworkBfdAdministrativeStateContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + InternalNetworkRouteType? routeType = default; + string neighborAddress = default; + BfdAdministrativeState? administrativeState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("routeType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + routeType = new InternalNetworkRouteType(property.Value.GetString()); + continue; + } + if (property.NameEquals("neighborAddress"u8)) + { + neighborAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("administrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeState = new BfdAdministrativeState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InternalNetworkBfdAdministrativeStateContent(routeType, neighborAddress, administrativeState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(InternalNetworkBfdAdministrativeStateContent)} does not support writing '{options.Format}' format."); + } + } + + InternalNetworkBfdAdministrativeStateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeInternalNetworkBfdAdministrativeStateContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InternalNetworkBfdAdministrativeStateContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBfdAdministrativeStateContent.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBfdAdministrativeStateContent.cs new file mode 100644 index 000000000000..0a4572a168ab --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBfdAdministrativeStateContent.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Internal Network BFD Administrative State request. + public partial class InternalNetworkBfdAdministrativeStateContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public InternalNetworkBfdAdministrativeStateContent() + { + } + + /// Initializes a new instance of . + /// Route Type that helps to know which bfd we are updating. + /// NeighborAddress - Input should be either All or Specific Ipv4 Address or Specific Ipv6 Address. + /// BFD Administrative state. + /// Keeps track of any properties unknown to the library. + internal InternalNetworkBfdAdministrativeStateContent(InternalNetworkRouteType? routeType, string neighborAddress, BfdAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) + { + RouteType = routeType; + NeighborAddress = neighborAddress; + AdministrativeState = administrativeState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Route Type that helps to know which bfd we are updating. + public InternalNetworkRouteType? RouteType { get; set; } + /// NeighborAddress - Input should be either All or Specific Ipv4 Address or Specific Ipv6 Address. + public string NeighborAddress { get; set; } + /// BFD Administrative state. + public BfdAdministrativeState? AdministrativeState { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBfdAdministrativeStateResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBfdAdministrativeStateResult.Serialization.cs new file mode 100644 index 000000000000..4da527c23582 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBfdAdministrativeStateResult.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class InternalNetworkBfdAdministrativeStateResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternalNetworkBfdAdministrativeStateResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(NeighborAddressAdministrativeStatus)) + { + writer.WritePropertyName("neighborAddressAdministrativeStatus"u8); + writer.WriteStartArray(); + foreach (var item in NeighborAddressAdministrativeStatus) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + ((IJsonModel)Error).Write(writer, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InternalNetworkBfdAdministrativeStateResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternalNetworkBfdAdministrativeStateResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInternalNetworkBfdAdministrativeStateResult(document.RootElement, options); + } + + internal static InternalNetworkBfdAdministrativeStateResult DeserializeInternalNetworkBfdAdministrativeStateResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList neighborAddressAdministrativeStatus = default; + ResponseError error = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("neighborAddressAdministrativeStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeighborAddressBfdAdministrativeStatus.DeserializeNeighborAddressBfdAdministrativeStatus(item, options)); + } + neighborAddressAdministrativeStatus = array; + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerManagedNetworkFabricContext.Default); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InternalNetworkBfdAdministrativeStateResult(neighborAddressAdministrativeStatus ?? new ChangeTrackingList(), error, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(InternalNetworkBfdAdministrativeStateResult)} does not support writing '{options.Format}' format."); + } + } + + InternalNetworkBfdAdministrativeStateResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeInternalNetworkBfdAdministrativeStateResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InternalNetworkBfdAdministrativeStateResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBfdAdministrativeStateResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBfdAdministrativeStateResult.cs new file mode 100644 index 000000000000..60eb40d28bae --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBfdAdministrativeStateResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Internal Network BFD Administrative State response. + public partial class InternalNetworkBfdAdministrativeStateResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal InternalNetworkBfdAdministrativeStateResult() + { + NeighborAddressAdministrativeStatus = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// NeighborAddress administrative status. + /// The error object. + /// Keeps track of any properties unknown to the library. + internal InternalNetworkBfdAdministrativeStateResult(IReadOnlyList neighborAddressAdministrativeStatus, ResponseError error, IDictionary serializedAdditionalRawData) + { + NeighborAddressAdministrativeStatus = neighborAddressAdministrativeStatus; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// NeighborAddress administrative status. + public IReadOnlyList NeighborAddressAdministrativeStatus { get; } + /// The error object. + public ResponseError Error { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBgpAdministrativeStateContent.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBgpAdministrativeStateContent.Serialization.cs new file mode 100644 index 000000000000..68c44d0273c2 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBgpAdministrativeStateContent.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class InternalNetworkBgpAdministrativeStateContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternalNetworkBgpAdministrativeStateContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NeighborAddress)) + { + writer.WritePropertyName("neighborAddress"u8); + writer.WriteStringValue(NeighborAddress); + } + if (Optional.IsDefined(AdministrativeState)) + { + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InternalNetworkBgpAdministrativeStateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternalNetworkBgpAdministrativeStateContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInternalNetworkBgpAdministrativeStateContent(document.RootElement, options); + } + + internal static InternalNetworkBgpAdministrativeStateContent DeserializeInternalNetworkBgpAdministrativeStateContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string neighborAddress = default; + BgpAdministrativeState? administrativeState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("neighborAddress"u8)) + { + neighborAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("administrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeState = new BgpAdministrativeState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InternalNetworkBgpAdministrativeStateContent(neighborAddress, administrativeState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(InternalNetworkBgpAdministrativeStateContent)} does not support writing '{options.Format}' format."); + } + } + + InternalNetworkBgpAdministrativeStateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeInternalNetworkBgpAdministrativeStateContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InternalNetworkBgpAdministrativeStateContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBgpAdministrativeStateContent.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBgpAdministrativeStateContent.cs new file mode 100644 index 000000000000..db676c12feb2 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBgpAdministrativeStateContent.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Internal Network Administrative State Request. + public partial class InternalNetworkBgpAdministrativeStateContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public InternalNetworkBgpAdministrativeStateContent() + { + } + + /// Initializes a new instance of . + /// NeighborAddress - Input should be either All or Specific Ipv4 Address or Specific Ipv6 Address. + /// BGP Administrative state. + /// Keeps track of any properties unknown to the library. + internal InternalNetworkBgpAdministrativeStateContent(string neighborAddress, BgpAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) + { + NeighborAddress = neighborAddress; + AdministrativeState = administrativeState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// NeighborAddress - Input should be either All or Specific Ipv4 Address or Specific Ipv6 Address. + public string NeighborAddress { get; set; } + /// BGP Administrative state. + public BgpAdministrativeState? AdministrativeState { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBgpAdministrativeStateResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBgpAdministrativeStateResult.Serialization.cs new file mode 100644 index 000000000000..c55bbf8666e5 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBgpAdministrativeStateResult.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class InternalNetworkBgpAdministrativeStateResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternalNetworkBgpAdministrativeStateResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(NeighborAddressAdministrativeStatus)) + { + writer.WritePropertyName("neighborAddressAdministrativeStatus"u8); + writer.WriteStartArray(); + foreach (var item in NeighborAddressAdministrativeStatus) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + ((IJsonModel)Error).Write(writer, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InternalNetworkBgpAdministrativeStateResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternalNetworkBgpAdministrativeStateResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInternalNetworkBgpAdministrativeStateResult(document.RootElement, options); + } + + internal static InternalNetworkBgpAdministrativeStateResult DeserializeInternalNetworkBgpAdministrativeStateResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList neighborAddressAdministrativeStatus = default; + ResponseError error = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("neighborAddressAdministrativeStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeighborAddressBgpAdministrativeStatus.DeserializeNeighborAddressBgpAdministrativeStatus(item, options)); + } + neighborAddressAdministrativeStatus = array; + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerManagedNetworkFabricContext.Default); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InternalNetworkBgpAdministrativeStateResult(neighborAddressAdministrativeStatus ?? new ChangeTrackingList(), error, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(InternalNetworkBgpAdministrativeStateResult)} does not support writing '{options.Format}' format."); + } + } + + InternalNetworkBgpAdministrativeStateResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeInternalNetworkBgpAdministrativeStateResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InternalNetworkBgpAdministrativeStateResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBgpAdministrativeStateResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBgpAdministrativeStateResult.cs new file mode 100644 index 000000000000..031818be83ca --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBgpAdministrativeStateResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Internal Network Administrative State Response. + public partial class InternalNetworkBgpAdministrativeStateResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal InternalNetworkBgpAdministrativeStateResult() + { + NeighborAddressAdministrativeStatus = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// NeighborAddress administrative status. + /// The error object. + /// Keeps track of any properties unknown to the library. + internal InternalNetworkBgpAdministrativeStateResult(IReadOnlyList neighborAddressAdministrativeStatus, ResponseError error, IDictionary serializedAdditionalRawData) + { + NeighborAddressAdministrativeStatus = neighborAddressAdministrativeStatus; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// NeighborAddress administrative status. + public IReadOnlyList NeighborAddressAdministrativeStatus { get; } + /// The error object. + public ResponseError Error { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBgpConfiguration.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBgpConfiguration.Serialization.cs deleted file mode 100644 index 8f837168364c..000000000000 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBgpConfiguration.Serialization.cs +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ManagedNetworkFabric.Models -{ - public partial class InternalNetworkBgpConfiguration : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalNetworkBgpConfiguration)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - } - - InternalNetworkBgpConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalNetworkBgpConfiguration)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalNetworkBgpConfiguration(document.RootElement, options); - } - - internal static InternalNetworkBgpConfiguration DeserializeInternalNetworkBgpConfiguration(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - BfdConfiguration bfdConfiguration = default; - NetworkFabricBooleanValue? defaultRouteOriginate = default; - int? allowAS = default; - AllowASOverride? allowASOverride = default; - long? fabricAsn = default; - long? peerAsn = default; - IList ipv4ListenRangePrefixes = default; - IList ipv6ListenRangePrefixes = default; - IList ipv4NeighborAddress = default; - IList ipv6NeighborAddress = default; - string annotation = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("bfdConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - bfdConfiguration = BfdConfiguration.DeserializeBfdConfiguration(property.Value, options); - continue; - } - if (property.NameEquals("defaultRouteOriginate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - defaultRouteOriginate = new NetworkFabricBooleanValue(property.Value.GetString()); - continue; - } - if (property.NameEquals("allowAS"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - allowAS = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("allowASOverride"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - allowASOverride = new AllowASOverride(property.Value.GetString()); - continue; - } - if (property.NameEquals("fabricASN"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - fabricAsn = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("peerASN"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - peerAsn = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("ipv4ListenRangePrefixes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - ipv4ListenRangePrefixes = array; - continue; - } - if (property.NameEquals("ipv6ListenRangePrefixes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - ipv6ListenRangePrefixes = array; - continue; - } - if (property.NameEquals("ipv4NeighborAddress"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NeighborAddress.DeserializeNeighborAddress(item, options)); - } - ipv4NeighborAddress = array; - continue; - } - if (property.NameEquals("ipv6NeighborAddress"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NeighborAddress.DeserializeNeighborAddress(item, options)); - } - ipv6NeighborAddress = array; - continue; - } - if (property.NameEquals("annotation"u8)) - { - annotation = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalNetworkBgpConfiguration( - annotation, - serializedAdditionalRawData, - bfdConfiguration, - defaultRouteOriginate, - allowAS, - allowASOverride, - fabricAsn, - peerAsn, - ipv4ListenRangePrefixes ?? new ChangeTrackingList(), - ipv6ListenRangePrefixes ?? new ChangeTrackingList(), - ipv4NeighborAddress ?? new ChangeTrackingList(), - ipv6NeighborAddress ?? new ChangeTrackingList()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); - default: - throw new FormatException($"The model {nameof(InternalNetworkBgpConfiguration)} does not support writing '{options.Format}' format."); - } - } - - InternalNetworkBgpConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeInternalNetworkBgpConfiguration(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InternalNetworkBgpConfiguration)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBgpConfiguration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBgpConfiguration.cs deleted file mode 100644 index 6b55a42ac34b..000000000000 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBgpConfiguration.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ManagedNetworkFabric.Models -{ - /// BGP configuration properties. - public partial class InternalNetworkBgpConfiguration : BgpConfiguration - { - /// Initializes a new instance of . - public InternalNetworkBgpConfiguration() - { - } - - /// Initializes a new instance of . - /// Switch configuration description. - /// Keeps track of any properties unknown to the library. - /// BFD configuration properties. - /// Originate a defaultRoute. Ex: "True" | "False". - /// Allows for routes to be received and processed even if the router detects its own ASN in the AS-Path. 0 is disable, Possible values are 1-10, default is 2. - /// Enable Or Disable state. - /// ASN of Network Fabric. Example: 65048. - /// Peer ASN. Example: 65047. - /// List of BGP IPv4 Listen Range prefixes. - /// List of BGP IPv6 Listen Ranges prefixes. - /// List with stringified IPv4 Neighbor Addresses. - /// List with stringified IPv6 Neighbor Address. - internal InternalNetworkBgpConfiguration(string annotation, IDictionary serializedAdditionalRawData, BfdConfiguration bfdConfiguration, NetworkFabricBooleanValue? defaultRouteOriginate, int? allowAS, AllowASOverride? allowASOverride, long? fabricAsn, long? peerAsn, IList ipv4ListenRangePrefixes, IList ipv6ListenRangePrefixes, IList ipv4NeighborAddress, IList ipv6NeighborAddress) : base(annotation, serializedAdditionalRawData, bfdConfiguration, defaultRouteOriginate, allowAS, allowASOverride, fabricAsn, peerAsn, ipv4ListenRangePrefixes, ipv6ListenRangePrefixes, ipv4NeighborAddress, ipv6NeighborAddress) - { - } - } -} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBmpPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBmpPatchProperties.Serialization.cs new file mode 100644 index 000000000000..8e907952e68d --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBmpPatchProperties.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class InternalNetworkBmpPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternalNetworkBmpPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(NeighborIPExclusions)) + { + writer.WritePropertyName("neighborIpExclusions"u8); + writer.WriteStartArray(); + foreach (var item in NeighborIPExclusions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(BmpConfigurationState)) + { + writer.WritePropertyName("bmpConfigurationState"u8); + writer.WriteStringValue(BmpConfigurationState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InternalNetworkBmpPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternalNetworkBmpPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInternalNetworkBmpPatchProperties(document.RootElement, options); + } + + internal static InternalNetworkBmpPatchProperties DeserializeInternalNetworkBmpPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList neighborIPExclusions = default; + BmpConfigurationState? bmpConfigurationState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("neighborIpExclusions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + neighborIPExclusions = array; + continue; + } + if (property.NameEquals("bmpConfigurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bmpConfigurationState = new BmpConfigurationState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InternalNetworkBmpPatchProperties(neighborIPExclusions ?? new ChangeTrackingList(), bmpConfigurationState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(InternalNetworkBmpPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + InternalNetworkBmpPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeInternalNetworkBmpPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InternalNetworkBmpPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBmpPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBmpPatchProperties.cs new file mode 100644 index 000000000000..b60dbad30fea --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBmpPatchProperties.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Internal Network BMP Configuration. + public partial class InternalNetworkBmpPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public InternalNetworkBmpPatchProperties() + { + NeighborIPExclusions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// BMP Collector Address. + /// BMP Monitoring configuration state. + /// Keeps track of any properties unknown to the library. + internal InternalNetworkBmpPatchProperties(IList neighborIPExclusions, BmpConfigurationState? bmpConfigurationState, IDictionary serializedAdditionalRawData) + { + NeighborIPExclusions = neighborIPExclusions; + BmpConfigurationState = bmpConfigurationState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// BMP Collector Address. + public IList NeighborIPExclusions { get; } + /// BMP Monitoring configuration state. + public BmpConfigurationState? BmpConfigurationState { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainsListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBmpProperties.Serialization.cs similarity index 59% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainsListResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBmpProperties.Serialization.cs index a0f5197982e3..fdbb5af1a4d4 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainsListResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBmpProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class L3IsolationDomainsListResult : IUtf8JsonSerializable, IJsonModel + public partial class InternalNetworkBmpProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,26 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(L3IsolationDomainsListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(InternalNetworkBmpProperties)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + if (Optional.IsCollectionDefined(NeighborIPExclusions)) { - writer.WritePropertyName("value"u8); + writer.WritePropertyName("neighborIpExclusions"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (var item in NeighborIPExclusions) { - writer.WriteObjectValue(item, options); + writer.WriteStringValue(item); } writer.WriteEndArray(); } - if (Optional.IsDefined(NextLink)) + if (Optional.IsDefined(BmpConfigurationState)) { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WritePropertyName("bmpConfigurationState"u8); + writer.WriteStringValue(BmpConfigurationState.Value.ToString()); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - L3IsolationDomainsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalNetworkBmpProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(L3IsolationDomainsListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(InternalNetworkBmpProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeL3IsolationDomainsListResult(document.RootElement, options); + return DeserializeInternalNetworkBmpProperties(document.RootElement, options); } - internal static L3IsolationDomainsListResult DeserializeL3IsolationDomainsListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalNetworkBmpProperties DeserializeInternalNetworkBmpProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,29 +86,33 @@ internal static L3IsolationDomainsListResult DeserializeL3IsolationDomainsListRe { return null; } - IReadOnlyList value = default; - string nextLink = default; + IList neighborIPExclusions = default; + BmpConfigurationState? bmpConfigurationState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (property.NameEquals("neighborIpExclusions"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(NetworkFabricL3IsolationDomainData.DeserializeNetworkFabricL3IsolationDomainData(item, options)); + array.Add(item.GetString()); } - value = array; + neighborIPExclusions = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (property.NameEquals("bmpConfigurationState"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bmpConfigurationState = new BmpConfigurationState(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +121,38 @@ internal static L3IsolationDomainsListResult DeserializeL3IsolationDomainsListRe } } serializedAdditionalRawData = rawDataDictionary; - return new L3IsolationDomainsListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new InternalNetworkBmpProperties(neighborIPExclusions ?? new ChangeTrackingList(), bmpConfigurationState, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(L3IsolationDomainsListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(InternalNetworkBmpProperties)} does not support writing '{options.Format}' format."); } } - L3IsolationDomainsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + InternalNetworkBmpProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeL3IsolationDomainsListResult(document.RootElement, options); + return DeserializeInternalNetworkBmpProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(L3IsolationDomainsListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(InternalNetworkBmpProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBmpProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBmpProperties.cs new file mode 100644 index 000000000000..f1ac84a0b89b --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkBmpProperties.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Internal Network BMP Configuration. + public partial class InternalNetworkBmpProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public InternalNetworkBmpProperties() + { + NeighborIPExclusions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// BMP Collector Address. + /// BMP Monitoring configuration state. + /// Keeps track of any properties unknown to the library. + internal InternalNetworkBmpProperties(IList neighborIPExclusions, BmpConfigurationState? bmpConfigurationState, IDictionary serializedAdditionalRawData) + { + NeighborIPExclusions = neighborIPExclusions; + BmpConfigurationState = bmpConfigurationState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// BMP Collector Address. + public IList NeighborIPExclusions { get; } + /// BMP Monitoring configuration state. + public BmpConfigurationState? BmpConfigurationState { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworksList.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkListResult.Serialization.cs similarity index 65% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworksList.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkListResult.Serialization.cs index 87361a4ed4c4..62ee4ba1ef1e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworksList.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class InternalNetworksList : IUtf8JsonSerializable, IJsonModel + internal partial class InternalNetworkListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InternalNetworksList)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(InternalNetworkListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - InternalNetworksList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalNetworkListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InternalNetworksList)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(InternalNetworkListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalNetworksList(document.RootElement, options); + return DeserializeInternalNetworkListResult(document.RootElement, options); } - internal static InternalNetworksList DeserializeInternalNetworksList(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalNetworkListResult DeserializeInternalNetworkListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -87,17 +84,13 @@ internal static InternalNetworksList DeserializeInternalNetworksList(JsonElement return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static InternalNetworksList DeserializeInternalNetworksList(JsonElement } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +114,38 @@ internal static InternalNetworksList DeserializeInternalNetworksList(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new InternalNetworksList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new InternalNetworkListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(InternalNetworksList)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(InternalNetworkListResult)} does not support writing '{options.Format}' format."); } } - InternalNetworksList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + InternalNetworkListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeInternalNetworksList(document.RootElement, options); + return DeserializeInternalNetworkListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(InternalNetworksList)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(InternalNetworkListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkListResult.cs new file mode 100644 index 000000000000..3f48bbf9609d --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a InternalNetwork list operation. + internal partial class InternalNetworkListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The InternalNetwork items on this page. + /// is null. + internal InternalNetworkListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The InternalNetwork items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal InternalNetworkListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InternalNetworkListResult() + { + } + + /// The InternalNetwork items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkPatchProperties.Serialization.cs new file mode 100644 index 000000000000..ffd3bf6bf48c --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkPatchProperties.Serialization.cs @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class InternalNetworkPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternalNetworkPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (Optional.IsDefined(Mtu)) + { + writer.WritePropertyName("mtu"u8); + writer.WriteNumberValue(Mtu.Value); + } + if (Optional.IsCollectionDefined(ConnectedIPv4Subnets)) + { + writer.WritePropertyName("connectedIPv4Subnets"u8); + writer.WriteStartArray(); + foreach (var item in ConnectedIPv4Subnets) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ConnectedIPv6Subnets)) + { + writer.WritePropertyName("connectedIPv6Subnets"u8); + writer.WriteStartArray(); + foreach (var item in ConnectedIPv6Subnets) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ImportRoutePolicy)) + { + writer.WritePropertyName("importRoutePolicy"u8); + writer.WriteObjectValue(ImportRoutePolicy, options); + } + if (Optional.IsDefined(ExportRoutePolicy)) + { + writer.WritePropertyName("exportRoutePolicy"u8); + writer.WriteObjectValue(ExportRoutePolicy, options); + } + if (Optional.IsDefined(IngressAclId)) + { + writer.WritePropertyName("ingressAclId"u8); + writer.WriteStringValue(IngressAclId); + } + if (Optional.IsDefined(EgressAclId)) + { + writer.WritePropertyName("egressAclId"u8); + writer.WriteStringValue(EgressAclId); + } + if (Optional.IsDefined(IsMonitoringEnabled)) + { + writer.WritePropertyName("isMonitoringEnabled"u8); + writer.WriteStringValue(IsMonitoringEnabled.Value.ToString()); + } + if (Optional.IsDefined(BgpConfiguration)) + { + writer.WritePropertyName("bgpConfiguration"u8); + writer.WriteObjectValue(BgpConfiguration, options); + } + if (Optional.IsDefined(StaticRouteConfiguration)) + { + writer.WritePropertyName("staticRouteConfiguration"u8); + writer.WriteObjectValue(StaticRouteConfiguration, options); + } + if (Optional.IsDefined(NativeIPv4PrefixLimit)) + { + writer.WritePropertyName("nativeIpv4PrefixLimit"u8); + writer.WriteObjectValue(NativeIPv4PrefixLimit, options); + } + if (Optional.IsDefined(NativeIPv6PrefixLimit)) + { + writer.WritePropertyName("nativeIpv6PrefixLimit"u8); + writer.WriteObjectValue(NativeIPv6PrefixLimit, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InternalNetworkPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternalNetworkPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInternalNetworkPatchProperties(document.RootElement, options); + } + + internal static InternalNetworkPatchProperties DeserializeInternalNetworkPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + int? mtu = default; + IList connectedIPv4Subnets = default; + IList connectedIPv6Subnets = default; + ImportRoutePolicy importRoutePolicy = default; + ExportRoutePolicy exportRoutePolicy = default; + ResourceIdentifier ingressAclId = default; + ResourceIdentifier egressAclId = default; + IsMonitoringEnabled? isMonitoringEnabled = default; + BgpPatchConfiguration bgpConfiguration = default; + StaticRoutePatchConfiguration staticRouteConfiguration = default; + NativeIPv4PrefixLimitPatchProperties nativeIPv4PrefixLimit = default; + NativeIPv6PrefixLimitPatchProperties nativeIPv6PrefixLimit = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("mtu"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mtu = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("connectedIPv4Subnets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ConnectedSubnetPatch.DeserializeConnectedSubnetPatch(item, options)); + } + connectedIPv4Subnets = array; + continue; + } + if (property.NameEquals("connectedIPv6Subnets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ConnectedSubnetPatch.DeserializeConnectedSubnetPatch(item, options)); + } + connectedIPv6Subnets = array; + continue; + } + if (property.NameEquals("importRoutePolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + importRoutePolicy = ImportRoutePolicy.DeserializeImportRoutePolicy(property.Value, options); + continue; + } + if (property.NameEquals("exportRoutePolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exportRoutePolicy = ExportRoutePolicy.DeserializeExportRoutePolicy(property.Value, options); + continue; + } + if (property.NameEquals("ingressAclId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ingressAclId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("egressAclId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + egressAclId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("isMonitoringEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isMonitoringEnabled = new IsMonitoringEnabled(property.Value.GetString()); + continue; + } + if (property.NameEquals("bgpConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bgpConfiguration = BgpPatchConfiguration.DeserializeBgpPatchConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("staticRouteConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + staticRouteConfiguration = StaticRoutePatchConfiguration.DeserializeStaticRoutePatchConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("nativeIpv4PrefixLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nativeIPv4PrefixLimit = NativeIPv4PrefixLimitPatchProperties.DeserializeNativeIPv4PrefixLimitPatchProperties(property.Value, options); + continue; + } + if (property.NameEquals("nativeIpv6PrefixLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nativeIPv6PrefixLimit = NativeIPv6PrefixLimitPatchProperties.DeserializeNativeIPv6PrefixLimitPatchProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InternalNetworkPatchProperties( + annotation, + mtu, + connectedIPv4Subnets ?? new ChangeTrackingList(), + connectedIPv6Subnets ?? new ChangeTrackingList(), + importRoutePolicy, + exportRoutePolicy, + ingressAclId, + egressAclId, + isMonitoringEnabled, + bgpConfiguration, + staticRouteConfiguration, + nativeIPv4PrefixLimit, + nativeIPv6PrefixLimit, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(InternalNetworkPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + InternalNetworkPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeInternalNetworkPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InternalNetworkPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkPatchProperties.cs new file mode 100644 index 000000000000..9b54a3c65d5c --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkPatchProperties.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// InternalNetwork Patch properties. + public partial class InternalNetworkPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public InternalNetworkPatchProperties() + { + ConnectedIPv4Subnets = new ChangeTrackingList(); + ConnectedIPv6Subnets = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Maximum transmission unit. Default value is 1500. + /// List of Connected IPv4 Subnets. + /// List of connected IPv6 Subnets. + /// Import Route Policy either IPv4 or IPv6. + /// Export Route Policy either IPv4 or IPv6. + /// Ingress Acl. ARM resource ID of Access Control Lists. + /// Egress Acl. ARM resource ID of Access Control Lists. + /// To check whether monitoring of internal network is enabled or not. + /// BGP configuration properties. + /// Static Route Configuration properties. + /// Native IPv4 Prefix Limit Configuration properties. + /// Native IPv6 Prefix Limit Configuration properties. + /// Keeps track of any properties unknown to the library. + internal InternalNetworkPatchProperties(string annotation, int? mtu, IList connectedIPv4Subnets, IList connectedIPv6Subnets, ImportRoutePolicy importRoutePolicy, ExportRoutePolicy exportRoutePolicy, ResourceIdentifier ingressAclId, ResourceIdentifier egressAclId, IsMonitoringEnabled? isMonitoringEnabled, BgpPatchConfiguration bgpConfiguration, StaticRoutePatchConfiguration staticRouteConfiguration, NativeIPv4PrefixLimitPatchProperties nativeIPv4PrefixLimit, NativeIPv6PrefixLimitPatchProperties nativeIPv6PrefixLimit, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + Mtu = mtu; + ConnectedIPv4Subnets = connectedIPv4Subnets; + ConnectedIPv6Subnets = connectedIPv6Subnets; + ImportRoutePolicy = importRoutePolicy; + ExportRoutePolicy = exportRoutePolicy; + IngressAclId = ingressAclId; + EgressAclId = egressAclId; + IsMonitoringEnabled = isMonitoringEnabled; + BgpConfiguration = bgpConfiguration; + StaticRouteConfiguration = staticRouteConfiguration; + NativeIPv4PrefixLimit = nativeIPv4PrefixLimit; + NativeIPv6PrefixLimit = nativeIPv6PrefixLimit; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// Maximum transmission unit. Default value is 1500. + public int? Mtu { get; set; } + /// List of Connected IPv4 Subnets. + public IList ConnectedIPv4Subnets { get; } + /// List of connected IPv6 Subnets. + public IList ConnectedIPv6Subnets { get; } + /// Import Route Policy either IPv4 or IPv6. + public ImportRoutePolicy ImportRoutePolicy { get; set; } + /// Export Route Policy either IPv4 or IPv6. + public ExportRoutePolicy ExportRoutePolicy { get; set; } + /// Ingress Acl. ARM resource ID of Access Control Lists. + public ResourceIdentifier IngressAclId { get; set; } + /// Egress Acl. ARM resource ID of Access Control Lists. + public ResourceIdentifier EgressAclId { get; set; } + /// To check whether monitoring of internal network is enabled or not. + public IsMonitoringEnabled? IsMonitoringEnabled { get; set; } + /// BGP configuration properties. + public BgpPatchConfiguration BgpConfiguration { get; set; } + /// Static Route Configuration properties. + public StaticRoutePatchConfiguration StaticRouteConfiguration { get; set; } + /// Native IPv4 Prefix Limit Configuration properties. + internal NativeIPv4PrefixLimitPatchProperties NativeIPv4PrefixLimit { get; set; } + /// Prefix limits. + public IList NativeIPv4PrefixLimits + { + get + { + if (NativeIPv4PrefixLimit is null) + NativeIPv4PrefixLimit = new NativeIPv4PrefixLimitPatchProperties(); + return NativeIPv4PrefixLimit.PrefixLimits; + } + } + + /// Native IPv6 Prefix Limit Configuration properties. + internal NativeIPv6PrefixLimitPatchProperties NativeIPv6PrefixLimit { get; set; } + /// Prefix limits. + public IList NativeIPv6PrefixLimits + { + get + { + if (NativeIPv6PrefixLimit is null) + NativeIPv6PrefixLimit = new NativeIPv6PrefixLimitPatchProperties(); + return NativeIPv6PrefixLimit.PrefixLimits; + } + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkRouteType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkRouteType.cs new file mode 100644 index 000000000000..4bff68836614 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkRouteType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Internal Network RouteType. + public readonly partial struct InternalNetworkRouteType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public InternalNetworkRouteType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StaticValue = "Static"; + private const string BgpValue = "Bgp"; + + /// InternalNetwork Static. + public static InternalNetworkRouteType Static { get; } = new InternalNetworkRouteType(StaticValue); + /// InternalNetwork Bgp. + public static InternalNetworkRouteType Bgp { get; } = new InternalNetworkRouteType(BgpValue); + /// Determines if two values are the same. + public static bool operator ==(InternalNetworkRouteType left, InternalNetworkRouteType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(InternalNetworkRouteType left, InternalNetworkRouteType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator InternalNetworkRouteType(string value) => new InternalNetworkRouteType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is InternalNetworkRouteType other && Equals(other); + /// + public bool Equals(InternalNetworkRouteType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkStaticRouteConfiguration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkStaticRouteConfiguration.cs deleted file mode 100644 index 11505a4f7288..000000000000 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternalNetworkStaticRouteConfiguration.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ManagedNetworkFabric.Models -{ - /// Static Route Configuration properties. - public partial class InternalNetworkStaticRouteConfiguration : StaticRouteConfiguration - { - /// Initializes a new instance of . - public InternalNetworkStaticRouteConfiguration() - { - } - - /// Initializes a new instance of . - /// BFD configuration properties. - /// List of IPv4 Routes. - /// List of IPv6 Routes. - /// Keeps track of any properties unknown to the library. - /// Extension. Example: NoExtension | NPB. - internal InternalNetworkStaticRouteConfiguration(BfdConfiguration bfdConfiguration, IList ipv4Routes, IList ipv6Routes, IDictionary serializedAdditionalRawData, StaticRouteConfigurationExtension? extension) : base(bfdConfiguration, ipv4Routes, ipv6Routes, serializedAdditionalRawData) - { - Extension = extension; - } - - /// Extension. Example: NoExtension | NPB. - public StaticRouteConfigurationExtension? Extension { get; set; } - } -} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayListResult.Serialization.cs new file mode 100644 index 000000000000..a74bea8452ae --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class InternetGatewayListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternetGatewayListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InternetGatewayListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternetGatewayListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInternetGatewayListResult(document.RootElement, options); + } + + internal static InternetGatewayListResult DeserializeInternetGatewayListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkFabricInternetGatewayData.DeserializeNetworkFabricInternetGatewayData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InternetGatewayListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(InternetGatewayListResult)} does not support writing '{options.Format}' format."); + } + } + + InternetGatewayListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeInternetGatewayListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InternetGatewayListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayListResult.cs new file mode 100644 index 000000000000..2b5b40cf15aa --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a InternetGateway list operation. + internal partial class InternetGatewayListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The InternetGateway items on this page. + /// is null. + internal InternetGatewayListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The InternetGateway items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal InternetGatewayListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InternetGatewayListResult() + { + } + + /// The InternetGateway items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayPatchProperties.Serialization.cs new file mode 100644 index 000000000000..8d78033aec65 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayPatchProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class InternetGatewayPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternetGatewayPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(InternetGatewayRuleId)) + { + writer.WritePropertyName("internetGatewayRuleId"u8); + writer.WriteStringValue(InternetGatewayRuleId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InternetGatewayPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternetGatewayPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInternetGatewayPatchProperties(document.RootElement, options); + } + + internal static InternetGatewayPatchProperties DeserializeInternetGatewayPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier internetGatewayRuleId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("internetGatewayRuleId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + internetGatewayRuleId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InternetGatewayPatchProperties(internetGatewayRuleId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(InternetGatewayPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + InternetGatewayPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeInternetGatewayPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InternetGatewayPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewaysListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayPatchProperties.cs similarity index 66% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewaysListResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayPatchProperties.cs index 87efd02d0b8f..a20bd80b2a77 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewaysListResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayPatchProperties.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of InternetGateways. - internal partial class InternetGatewaysListResult + /// PatchProperties for InternetGateway. + internal partial class InternetGatewayPatchProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +46,21 @@ internal partial class InternetGatewaysListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal InternetGatewaysListResult() + /// Initializes a new instance of . + public InternetGatewayPatchProperties() { - Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Displays list of Internet Gateway resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// ARM Resource ID of the Internet Gateway Rule. /// Keeps track of any properties unknown to the library. - internal InternetGatewaysListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal InternetGatewayPatchProperties(ResourceIdentifier internetGatewayRuleId, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + InternetGatewayRuleId = internetGatewayRuleId; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Displays list of Internet Gateway resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// ARM Resource ID of the Internet Gateway Rule. + public ResourceIdentifier InternetGatewayRuleId { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRuleAction.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRuleAction.cs index 1c6f57aca73e..98e1699edac0 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRuleAction.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRuleAction.cs @@ -25,9 +25,9 @@ public InternetGatewayRuleAction(string value) private const string AllowValue = "Allow"; private const string DenyValue = "Deny"; - /// Allow. + /// Action Allow. public static InternetGatewayRuleAction Allow { get; } = new InternetGatewayRuleAction(AllowValue); - /// Deny. + /// Action Deny. public static InternetGatewayRuleAction Deny { get; } = new InternetGatewayRuleAction(DenyValue); /// Determines if two values are the same. public static bool operator ==(InternetGatewayRuleAction left, InternetGatewayRuleAction right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRulesListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRuleListResult.Serialization.cs similarity index 63% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRulesListResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRuleListResult.Serialization.cs index 12415928f509..65a315d1d9c5 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRulesListResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRuleListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class InternetGatewayRulesListResult : IUtf8JsonSerializable, IJsonModel + internal partial class InternetGatewayRuleListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InternetGatewayRulesListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(InternetGatewayRuleListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - InternetGatewayRulesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternetGatewayRuleListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InternetGatewayRulesListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(InternetGatewayRuleListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternetGatewayRulesListResult(document.RootElement, options); + return DeserializeInternetGatewayRuleListResult(document.RootElement, options); } - internal static InternetGatewayRulesListResult DeserializeInternetGatewayRulesListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternetGatewayRuleListResult DeserializeInternetGatewayRuleListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -87,17 +84,13 @@ internal static InternetGatewayRulesListResult DeserializeInternetGatewayRulesLi return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static InternetGatewayRulesListResult DeserializeInternetGatewayRulesLi } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +114,38 @@ internal static InternetGatewayRulesListResult DeserializeInternetGatewayRulesLi } } serializedAdditionalRawData = rawDataDictionary; - return new InternetGatewayRulesListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new InternetGatewayRuleListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(InternetGatewayRulesListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(InternetGatewayRuleListResult)} does not support writing '{options.Format}' format."); } } - InternetGatewayRulesListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + InternetGatewayRuleListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeInternetGatewayRulesListResult(document.RootElement, options); + return DeserializeInternetGatewayRuleListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(InternetGatewayRulesListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(InternetGatewayRuleListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRuleListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRuleListResult.cs new file mode 100644 index 000000000000..30086167fac9 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRuleListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a InternetGatewayRule list operation. + internal partial class InternetGatewayRuleListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The InternetGatewayRule items on this page. + /// is null. + internal InternetGatewayRuleListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The InternetGatewayRule items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal InternetGatewayRuleListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InternetGatewayRuleListResult() + { + } + + /// The InternetGatewayRule items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRuleProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRuleProperties.Serialization.cs new file mode 100644 index 000000000000..ea422b36fcc4 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRuleProperties.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class InternetGatewayRuleProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternetGatewayRuleProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + writer.WritePropertyName("ruleProperties"u8); + writer.WriteObjectValue(RuleProperties, options); + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(InternetGatewayIds)) + { + writer.WritePropertyName("internetGatewayIds"u8); + writer.WriteStartArray(); + foreach (var item in InternetGatewayIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InternetGatewayRuleProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternetGatewayRuleProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInternetGatewayRuleProperties(document.RootElement, options); + } + + internal static InternetGatewayRuleProperties DeserializeInternetGatewayRuleProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + InternetGatewayRules ruleProperties = default; + LastOperationProperties lastOperation = default; + NetworkFabricProvisioningState? provisioningState = default; + IReadOnlyList internetGatewayIds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("ruleProperties"u8)) + { + ruleProperties = InternetGatewayRules.DeserializeInternetGatewayRules(property.Value, options); + continue; + } + if (property.NameEquals("lastOperation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NetworkFabricProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("internetGatewayIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + internetGatewayIds = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InternetGatewayRuleProperties( + annotation, + ruleProperties, + lastOperation, + provisioningState, + internetGatewayIds ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(InternetGatewayRuleProperties)} does not support writing '{options.Format}' format."); + } + } + + InternetGatewayRuleProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeInternetGatewayRuleProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InternetGatewayRuleProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRuleProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRuleProperties.cs new file mode 100644 index 000000000000..f6c2517a0845 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRuleProperties.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Internet Gateway Rule Properties defines the resource properties. + public partial class InternetGatewayRuleProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Rules for the InternetGateways. + /// is null. + public InternetGatewayRuleProperties(InternetGatewayRules ruleProperties) + { + Argument.AssertNotNull(ruleProperties, nameof(ruleProperties)); + + RuleProperties = ruleProperties; + InternetGatewayIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Rules for the InternetGateways. + /// Details of the last operation performed on the resource. + /// Provisioning state of the resource. + /// List of Internet Gateway resource Id. + /// Keeps track of any properties unknown to the library. + internal InternetGatewayRuleProperties(string annotation, InternetGatewayRules ruleProperties, LastOperationProperties lastOperation, NetworkFabricProvisioningState? provisioningState, IReadOnlyList internetGatewayIds, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + RuleProperties = ruleProperties; + LastOperation = lastOperation; + ProvisioningState = provisioningState; + InternetGatewayIds = internetGatewayIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InternetGatewayRuleProperties() + { + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// Rules for the InternetGateways. + public InternetGatewayRules RuleProperties { get; set; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + + /// Provisioning state of the resource. + public NetworkFabricProvisioningState? ProvisioningState { get; } + /// List of Internet Gateway resource Id. + public IReadOnlyList InternetGatewayIds { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRules.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRules.Serialization.cs index 8c05219112f9..ff256414d27f 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRules.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRules.Serialization.cs @@ -36,13 +36,51 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("action"u8); writer.WriteStringValue(Action.ToString()); - writer.WritePropertyName("addressList"u8); - writer.WriteStartArray(); - foreach (var item in AddressList) + if (Optional.IsCollectionDefined(AddressList)) { - writer.WriteStringValue(item); + writer.WritePropertyName("addressList"u8); + writer.WriteStartArray(); + foreach (var item in AddressList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Condition)) + { + writer.WritePropertyName("condition"u8); + writer.WriteStringValue(Condition.Value.ToString()); + } + if (Optional.IsCollectionDefined(DestinationAddressList)) + { + writer.WritePropertyName("destinationAddressList"u8); + writer.WriteStartArray(); + foreach (var item in DestinationAddressList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(SourceAddressList)) + { + writer.WritePropertyName("sourceAddressList"u8); + writer.WriteStartArray(); + foreach (var item in SourceAddressList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(HeaderAddressList)) + { + writer.WritePropertyName("headerAddressList"u8); + writer.WriteStartArray(); + foreach (var item in HeaderAddressList) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); } - writer.WriteEndArray(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -82,6 +120,10 @@ internal static InternetGatewayRules DeserializeInternetGatewayRules(JsonElement } InternetGatewayRuleAction action = default; IList addressList = default; + RuleCondition? condition = default; + IList destinationAddressList = default; + IList sourceAddressList = default; + IList headerAddressList = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -93,6 +135,10 @@ internal static InternetGatewayRules DeserializeInternetGatewayRules(JsonElement } if (property.NameEquals("addressList"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -101,13 +147,71 @@ internal static InternetGatewayRules DeserializeInternetGatewayRules(JsonElement addressList = array; continue; } + if (property.NameEquals("condition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + condition = new RuleCondition(property.Value.GetString()); + continue; + } + if (property.NameEquals("destinationAddressList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + destinationAddressList = array; + continue; + } + if (property.NameEquals("sourceAddressList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sourceAddressList = array; + continue; + } + if (property.NameEquals("headerAddressList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HeaderAddressProperties.DeserializeHeaderAddressProperties(item, options)); + } + headerAddressList = array; + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new InternetGatewayRules(action, addressList, serializedAdditionalRawData); + return new InternetGatewayRules( + action, + addressList ?? new ChangeTrackingList(), + condition, + destinationAddressList ?? new ChangeTrackingList(), + sourceAddressList ?? new ChangeTrackingList(), + headerAddressList ?? new ChangeTrackingList(), + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRules.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRules.cs index 2668a43d107a..e98a54e22b69 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRules.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRules.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using System.Linq; namespace Azure.ResourceManager.ManagedNetworkFabric.Models { @@ -48,24 +47,31 @@ public partial class InternetGatewayRules /// Initializes a new instance of . /// Specify action. - /// List of Addresses to be allowed or denied. - /// is null. - public InternetGatewayRules(InternetGatewayRuleAction action, IEnumerable addressList) + public InternetGatewayRules(InternetGatewayRuleAction action) { - Argument.AssertNotNull(addressList, nameof(addressList)); - Action = action; - AddressList = addressList.ToList(); + AddressList = new ChangeTrackingList(); + DestinationAddressList = new ChangeTrackingList(); + SourceAddressList = new ChangeTrackingList(); + HeaderAddressList = new ChangeTrackingList(); } /// Initializes a new instance of . /// Specify action. /// List of Addresses to be allowed or denied. + /// Specify rule condition. + /// List of Addresses to be allowed or denied. + /// List of source IPv4 and IPv6 address to be allowed or denied. + /// List of header Name and source addresses associated with the header. /// Keeps track of any properties unknown to the library. - internal InternetGatewayRules(InternetGatewayRuleAction action, IList addressList, IDictionary serializedAdditionalRawData) + internal InternetGatewayRules(InternetGatewayRuleAction action, IList addressList, RuleCondition? condition, IList destinationAddressList, IList sourceAddressList, IList headerAddressList, IDictionary serializedAdditionalRawData) { Action = action; AddressList = addressList; + Condition = condition; + DestinationAddressList = destinationAddressList; + SourceAddressList = sourceAddressList; + HeaderAddressList = headerAddressList; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -78,5 +84,13 @@ internal InternetGatewayRules() public InternetGatewayRuleAction Action { get; set; } /// List of Addresses to be allowed or denied. public IList AddressList { get; } + /// Specify rule condition. + public RuleCondition? Condition { get; set; } + /// List of Addresses to be allowed or denied. + public IList DestinationAddressList { get; } + /// List of source IPv4 and IPv6 address to be allowed or denied. + public IList SourceAddressList { get; } + /// List of header Name and source addresses associated with the header. + public IList HeaderAddressList { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayType.cs index 0d7d7f99040d..af833afff538 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayType.cs @@ -25,9 +25,9 @@ public InternetGatewayType(string value) private const string InfrastructureValue = "Infrastructure"; private const string WorkloadValue = "Workload"; - /// Infrastructure. + /// GatewayType Infrastructure. public static InternetGatewayType Infrastructure { get; } = new InternetGatewayType(InfrastructureValue); - /// Workload. + /// GatewayType Workload. public static InternetGatewayType Workload { get; } = new InternetGatewayType(WorkloadValue); /// Determines if two values are the same. public static bool operator ==(InternetGatewayType left, InternetGatewayType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsManagementType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsManagementType.cs index fb8b098f44a4..118e9d145546 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsManagementType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsManagementType.cs @@ -25,9 +25,9 @@ public IsManagementType(string value) private const string TrueValue = "True"; private const string FalseValue = "False"; - /// True. + /// IsManagementType-True. public static IsManagementType True { get; } = new IsManagementType(TrueValue); - /// False. + /// IsManagementType-False. public static IsManagementType False { get; } = new IsManagementType(FalseValue); /// Determines if two values are the same. public static bool operator ==(IsManagementType left, IsManagementType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsMonitoringEnabled.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsMonitoringEnabled.cs index 0dc93e75690d..65ed5abd2cfa 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsMonitoringEnabled.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsMonitoringEnabled.cs @@ -25,9 +25,9 @@ public IsMonitoringEnabled(string value) private const string TrueValue = "True"; private const string FalseValue = "False"; - /// True. + /// IsMonitoringEnabled-True. public static IsMonitoringEnabled True { get; } = new IsMonitoringEnabled(TrueValue); - /// False. + /// IsMonitoringEnabled-False. public static IsMonitoringEnabled False { get; } = new IsMonitoringEnabled(FalseValue); /// Determines if two values are the same. public static bool operator ==(IsMonitoringEnabled left, IsMonitoringEnabled right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsWorkloadManagementNetworkEnabled.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsWorkloadManagementNetworkEnabled.cs index b089cabed942..56467dedb7ab 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsWorkloadManagementNetworkEnabled.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsWorkloadManagementNetworkEnabled.cs @@ -25,9 +25,9 @@ public IsWorkloadManagementNetworkEnabled(string value) private const string TrueValue = "True"; private const string FalseValue = "False"; - /// True. + /// IsWorkloadManagementNetworkEnabled-True. public static IsWorkloadManagementNetworkEnabled True { get; } = new IsWorkloadManagementNetworkEnabled(TrueValue); - /// False. + /// IsWorkloadManagementNetworkEnabled-False. public static IsWorkloadManagementNetworkEnabled False { get; } = new IsWorkloadManagementNetworkEnabled(FalseValue); /// Determines if two values are the same. public static bool operator ==(IsWorkloadManagementNetworkEnabled left, IsWorkloadManagementNetworkEnabled right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsolationDomainEncapsulationType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsolationDomainEncapsulationType.cs index a0594e8d783e..eeaeef32a3f7 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsolationDomainEncapsulationType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsolationDomainEncapsulationType.cs @@ -25,9 +25,9 @@ public IsolationDomainEncapsulationType(string value) private const string NoneValue = "None"; private const string GreValue = "GRE"; - /// None. + /// Encapsulation-None. public static IsolationDomainEncapsulationType None { get; } = new IsolationDomainEncapsulationType(NoneValue); - /// GRE. + /// Encapsulation-GRE. public static IsolationDomainEncapsulationType Gre { get; } = new IsolationDomainEncapsulationType(GreValue); /// Determines if two values are the same. public static bool operator ==(IsolationDomainEncapsulationType left, IsolationDomainEncapsulationType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsolationDomainPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsolationDomainPatchProperties.Serialization.cs new file mode 100644 index 000000000000..15d93697d4c4 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsolationDomainPatchProperties.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class IsolationDomainPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IsolationDomainPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Encapsulation)) + { + writer.WritePropertyName("encapsulation"u8); + writer.WriteStringValue(Encapsulation.Value.ToString()); + } + if (Optional.IsCollectionDefined(NeighborGroupIds)) + { + writer.WritePropertyName("neighborGroupIds"u8); + writer.WriteStartArray(); + foreach (var item in NeighborGroupIds) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IsolationDomainPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IsolationDomainPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIsolationDomainPatchProperties(document.RootElement, options); + } + + internal static IsolationDomainPatchProperties DeserializeIsolationDomainPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IsolationDomainEncapsulationType? encapsulation = default; + IList neighborGroupIds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("encapsulation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encapsulation = new IsolationDomainEncapsulationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("neighborGroupIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + neighborGroupIds = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IsolationDomainPatchProperties(encapsulation, neighborGroupIds ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(IsolationDomainPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + IsolationDomainPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIsolationDomainPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IsolationDomainPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRulesListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsolationDomainPatchProperties.cs similarity index 65% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRulesListResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsolationDomainPatchProperties.cs index c6b5f6616c6b..a27dfec38154 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewayRulesListResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IsolationDomainPatchProperties.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of Internet Gateway Rules. - internal partial class InternetGatewayRulesListResult + /// Isolation Domain Properties. + public partial class IsolationDomainPatchProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +46,26 @@ internal partial class InternetGatewayRulesListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal InternetGatewayRulesListResult() + /// Initializes a new instance of . + public IsolationDomainPatchProperties() { - Value = new ChangeTrackingList(); + NeighborGroupIds = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of Internet Gateway Rule resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// Type of encapsulation. + /// List of Neighbor Group IDs. /// Keeps track of any properties unknown to the library. - internal InternetGatewayRulesListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal IsolationDomainPatchProperties(IsolationDomainEncapsulationType? encapsulation, IList neighborGroupIds, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + Encapsulation = encapsulation; + NeighborGroupIds = neighborGroupIds; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of Internet Gateway Rule resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// Type of encapsulation. + public IsolationDomainEncapsulationType? Encapsulation { get; set; } + /// List of Neighbor Group IDs. + public IList NeighborGroupIds { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceSkusListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainListResult.Serialization.cs similarity index 66% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceSkusListResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainListResult.Serialization.cs index 892923ea9b60..8444eabbe59b 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceSkusListResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class NetworkDeviceSkusListResult : IUtf8JsonSerializable, IJsonModel + internal partial class L2IsolationDomainListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkDeviceSkusListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(L2IsolationDomainListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NetworkDeviceSkusListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + L2IsolationDomainListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkDeviceSkusListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(L2IsolationDomainListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkDeviceSkusListResult(document.RootElement, options); + return DeserializeL2IsolationDomainListResult(document.RootElement, options); } - internal static NetworkDeviceSkusListResult DeserializeNetworkDeviceSkusListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static L2IsolationDomainListResult DeserializeL2IsolationDomainListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,29 +83,29 @@ internal static NetworkDeviceSkusListResult DeserializeNetworkDeviceSkusListResu { return null; } - IReadOnlyList value = default; - string nextLink = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(NetworkDeviceSkuData.DeserializeNetworkDeviceSkuData(item, options)); + array.Add(NetworkFabricL2IsolationDomainData.DeserializeNetworkFabricL2IsolationDomainData(item, options)); } value = array; continue; } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +114,38 @@ internal static NetworkDeviceSkusListResult DeserializeNetworkDeviceSkusListResu } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkDeviceSkusListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new L2IsolationDomainListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(NetworkDeviceSkusListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(L2IsolationDomainListResult)} does not support writing '{options.Format}' format."); } } - NetworkDeviceSkusListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + L2IsolationDomainListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkDeviceSkusListResult(document.RootElement, options); + return DeserializeL2IsolationDomainListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NetworkDeviceSkusListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(L2IsolationDomainListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainListResult.cs new file mode 100644 index 000000000000..176ba3b07c3e --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a L2IsolationDomain list operation. + internal partial class L2IsolationDomainListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The L2IsolationDomain items on this page. + /// is null. + internal L2IsolationDomainListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The L2IsolationDomain items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal L2IsolationDomainListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal L2IsolationDomainListResult() + { + } + + /// The L2IsolationDomain items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionAProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainPatchProperties.Serialization.cs similarity index 56% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionAProperties.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainPatchProperties.Serialization.cs index 802c0f6d1cbc..ddbd6c4076d7 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionAProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainPatchProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - public partial class OptionAProperties : IUtf8JsonSerializable, IJsonModel + public partial class L2IsolationDomainPatchProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,31 +28,31 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OptionAProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(L2IsolationDomainPatchProperties)} does not support writing '{format}' format."); } + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } if (Optional.IsDefined(Mtu)) { writer.WritePropertyName("mtu"u8); writer.WriteNumberValue(Mtu.Value); } - if (Optional.IsDefined(VlanId)) - { - writer.WritePropertyName("vlanId"u8); - writer.WriteNumberValue(VlanId.Value); - } - if (Optional.IsDefined(PeerAsn)) + if (Optional.IsDefined(ExtendedVlan)) { - writer.WritePropertyName("peerASN"u8); - writer.WriteNumberValue(PeerAsn.Value); + writer.WritePropertyName("extendedVlan"u8); + writer.WriteStringValue(ExtendedVlan.Value.ToString()); } - if (Optional.IsDefined(BfdConfiguration)) + if (Optional.IsDefined(NetworkToNetworkInterconnectId)) { - writer.WritePropertyName("bfdConfiguration"u8); - writer.WriteObjectValue(BfdConfiguration, options); + writer.WritePropertyName("networkToNetworkInterconnectId"u8); + writer.WriteStringValue(NetworkToNetworkInterconnectId); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -71,19 +71,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - OptionAProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + L2IsolationDomainPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OptionAProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(L2IsolationDomainPatchProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeOptionAProperties(document.RootElement, options); + return DeserializeL2IsolationDomainPatchProperties(document.RootElement, options); } - internal static OptionAProperties DeserializeOptionAProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static L2IsolationDomainPatchProperties DeserializeL2IsolationDomainPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -91,48 +91,44 @@ internal static OptionAProperties DeserializeOptionAProperties(JsonElement eleme { return null; } + string annotation = default; int? mtu = default; - int? vlanId = default; - long? peerAsn = default; - BfdConfiguration bfdConfiguration = default; + ExtendedVlan? extendedVlan = default; + ResourceIdentifier networkToNetworkInterconnectId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("mtu"u8)) + if (property.NameEquals("annotation"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mtu = property.Value.GetInt32(); + annotation = property.Value.GetString(); continue; } - if (property.NameEquals("vlanId"u8)) + if (property.NameEquals("mtu"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - vlanId = property.Value.GetInt32(); + mtu = property.Value.GetInt32(); continue; } - if (property.NameEquals("peerASN"u8)) + if (property.NameEquals("extendedVlan"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - peerAsn = property.Value.GetInt64(); + extendedVlan = new ExtendedVlan(property.Value.GetString()); continue; } - if (property.NameEquals("bfdConfiguration"u8)) + if (property.NameEquals("networkToNetworkInterconnectId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - bfdConfiguration = BfdConfiguration.DeserializeBfdConfiguration(property.Value, options); + networkToNetworkInterconnectId = new ResourceIdentifier(property.Value.GetString()); continue; } if (options.Format != "W") @@ -141,38 +137,38 @@ internal static OptionAProperties DeserializeOptionAProperties(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new OptionAProperties(mtu, vlanId, peerAsn, bfdConfiguration, serializedAdditionalRawData); + return new L2IsolationDomainPatchProperties(annotation, mtu, extendedVlan, networkToNetworkInterconnectId, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(OptionAProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(L2IsolationDomainPatchProperties)} does not support writing '{options.Format}' format."); } } - OptionAProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + L2IsolationDomainPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeOptionAProperties(document.RootElement, options); + return DeserializeL2IsolationDomainPatchProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(OptionAProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(L2IsolationDomainPatchProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainPatchProperties.cs new file mode 100644 index 000000000000..a1b55f3ddd6f --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainPatchProperties.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// L2 Isolation Domain Patch Properties defines the patchable properties of the resource. + public partial class L2IsolationDomainPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public L2IsolationDomainPatchProperties() + { + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Maximum transmission unit. Default value is 1500. + /// Extended VLAN status. + /// ARM Resource ID of the networkToNetworkInterconnectId of the L2 ISD resource. + /// Keeps track of any properties unknown to the library. + internal L2IsolationDomainPatchProperties(string annotation, int? mtu, ExtendedVlan? extendedVlan, ResourceIdentifier networkToNetworkInterconnectId, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + Mtu = mtu; + ExtendedVlan = extendedVlan; + NetworkToNetworkInterconnectId = networkToNetworkInterconnectId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// Maximum transmission unit. Default value is 1500. + public int? Mtu { get; set; } + /// Extended VLAN status. + public ExtendedVlan? ExtendedVlan { get; set; } + /// ARM Resource ID of the networkToNetworkInterconnectId of the L2 ISD resource. + public ResourceIdentifier NetworkToNetworkInterconnectId { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainProperties.Serialization.cs new file mode 100644 index 000000000000..9b01b4b91b12 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainProperties.Serialization.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class L2IsolationDomainProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(L2IsolationDomainProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + writer.WritePropertyName("networkFabricId"u8); + writer.WriteStringValue(NetworkFabricId); + writer.WritePropertyName("vlanId"u8); + writer.WriteNumberValue(VlanId); + if (Optional.IsDefined(Mtu)) + { + writer.WritePropertyName("mtu"u8); + writer.WriteNumberValue(Mtu.Value); + } + if (Optional.IsDefined(ExtendedVlan)) + { + writer.WritePropertyName("extendedVlan"u8); + writer.WriteStringValue(ExtendedVlan.Value.ToString()); + } + if (Optional.IsDefined(NetworkToNetworkInterconnectId)) + { + writer.WritePropertyName("networkToNetworkInterconnectId"u8); + writer.WriteStringValue(NetworkToNetworkInterconnectId); + } + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } + if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) + { + writer.WritePropertyName("configurationState"u8); + writer.WriteStringValue(ConfigurationState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) + { + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + L2IsolationDomainProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(L2IsolationDomainProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeL2IsolationDomainProperties(document.RootElement, options); + } + + internal static L2IsolationDomainProperties DeserializeL2IsolationDomainProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + ResourceIdentifier networkFabricId = default; + int vlanId = default; + int? mtu = default; + ExtendedVlan? extendedVlan = default; + ResourceIdentifier networkToNetworkInterconnectId = default; + LastOperationProperties lastOperation = default; + NetworkFabricConfigurationState? configurationState = default; + NetworkFabricProvisioningState? provisioningState = default; + NetworkFabricAdministrativeState? administrativeState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkFabricId"u8)) + { + networkFabricId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("vlanId"u8)) + { + vlanId = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("mtu"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mtu = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("extendedVlan"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + extendedVlan = new ExtendedVlan(property.Value.GetString()); + continue; + } + if (property.NameEquals("networkToNetworkInterconnectId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkToNetworkInterconnectId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("lastOperation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property.Value, options); + continue; + } + if (property.NameEquals("configurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configurationState = new NetworkFabricConfigurationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NetworkFabricProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("administrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeState = new NetworkFabricAdministrativeState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new L2IsolationDomainProperties( + annotation, + networkFabricId, + vlanId, + mtu, + extendedVlan, + networkToNetworkInterconnectId, + lastOperation, + configurationState, + provisioningState, + administrativeState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(L2IsolationDomainProperties)} does not support writing '{options.Format}' format."); + } + } + + L2IsolationDomainProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeL2IsolationDomainProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(L2IsolationDomainProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainProperties.cs new file mode 100644 index 000000000000..51833fa7d548 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainProperties.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// L2Isolation Domain Properties defines the properties of the resource. + public partial class L2IsolationDomainProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// ARM Resource ID of the Network Fabric. + /// Vlan Identifier of the Network Fabric. Example: 501. + /// is null. + public L2IsolationDomainProperties(ResourceIdentifier networkFabricId, int vlanId) + { + Argument.AssertNotNull(networkFabricId, nameof(networkFabricId)); + + NetworkFabricId = networkFabricId; + VlanId = vlanId; + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// ARM Resource ID of the Network Fabric. + /// Vlan Identifier of the Network Fabric. Example: 501. + /// Maximum transmission unit. Default value is 1500. + /// Extended VLAN status, default value is Disabled. + /// ARM Resource ID of the networkToNetworkInterconnectId of the L2 ISD resource. + /// Details of the last operation performed on the resource. + /// Configuration state of the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// Keeps track of any properties unknown to the library. + internal L2IsolationDomainProperties(string annotation, ResourceIdentifier networkFabricId, int vlanId, int? mtu, ExtendedVlan? extendedVlan, ResourceIdentifier networkToNetworkInterconnectId, LastOperationProperties lastOperation, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + NetworkFabricId = networkFabricId; + VlanId = vlanId; + Mtu = mtu; + ExtendedVlan = extendedVlan; + NetworkToNetworkInterconnectId = networkToNetworkInterconnectId; + LastOperation = lastOperation; + ConfigurationState = configurationState; + ProvisioningState = provisioningState; + AdministrativeState = administrativeState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal L2IsolationDomainProperties() + { + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// ARM Resource ID of the Network Fabric. + public ResourceIdentifier NetworkFabricId { get; set; } + /// Vlan Identifier of the Network Fabric. Example: 501. + public int VlanId { get; set; } + /// Maximum transmission unit. Default value is 1500. + public int? Mtu { get; set; } + /// Extended VLAN status, default value is Disabled. + public ExtendedVlan? ExtendedVlan { get; set; } + /// ARM Resource ID of the networkToNetworkInterconnectId of the L2 ISD resource. + public ResourceIdentifier NetworkToNetworkInterconnectId { get; set; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + + /// Configuration state of the resource. + public NetworkFabricConfigurationState? ConfigurationState { get; } + /// Provisioning state of the resource. + public NetworkFabricProvisioningState? ProvisioningState { get; } + /// Administrative state of the resource. + public NetworkFabricAdministrativeState? AdministrativeState { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3ExportRoutePolicyPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3ExportRoutePolicyPatch.Serialization.cs new file mode 100644 index 000000000000..50454522456a --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3ExportRoutePolicyPatch.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class L3ExportRoutePolicyPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(L3ExportRoutePolicyPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ExportIPv4RoutePolicyId)) + { + writer.WritePropertyName("exportIpv4RoutePolicyId"u8); + writer.WriteStringValue(ExportIPv4RoutePolicyId); + } + if (Optional.IsDefined(ExportIPv6RoutePolicyId)) + { + writer.WritePropertyName("exportIpv6RoutePolicyId"u8); + writer.WriteStringValue(ExportIPv6RoutePolicyId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + L3ExportRoutePolicyPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(L3ExportRoutePolicyPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeL3ExportRoutePolicyPatch(document.RootElement, options); + } + + internal static L3ExportRoutePolicyPatch DeserializeL3ExportRoutePolicyPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier exportIPv4RoutePolicyId = default; + ResourceIdentifier exportIPv6RoutePolicyId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("exportIpv4RoutePolicyId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exportIPv4RoutePolicyId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("exportIpv6RoutePolicyId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exportIPv6RoutePolicyId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new L3ExportRoutePolicyPatch(exportIPv4RoutePolicyId, exportIPv6RoutePolicyId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(L3ExportRoutePolicyPatch)} does not support writing '{options.Format}' format."); + } + } + + L3ExportRoutePolicyPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeL3ExportRoutePolicyPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(L3ExportRoutePolicyPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3ExportRoutePolicyPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3ExportRoutePolicyPatch.cs new file mode 100644 index 000000000000..ecd8901ac620 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3ExportRoutePolicyPatch.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Array of ARM Resource ID of the RoutePolicies. + public partial class L3ExportRoutePolicyPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public L3ExportRoutePolicyPatch() + { + } + + /// Initializes a new instance of . + /// ARM Resource ID of the RoutePolicy. + /// ARM Resource ID of the RoutePolicy. + /// Keeps track of any properties unknown to the library. + internal L3ExportRoutePolicyPatch(ResourceIdentifier exportIPv4RoutePolicyId, ResourceIdentifier exportIPv6RoutePolicyId, IDictionary serializedAdditionalRawData) + { + ExportIPv4RoutePolicyId = exportIPv4RoutePolicyId; + ExportIPv6RoutePolicyId = exportIPv6RoutePolicyId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// ARM Resource ID of the RoutePolicy. + public ResourceIdentifier ExportIPv4RoutePolicyId { get; set; } + /// ARM Resource ID of the RoutePolicy. + public ResourceIdentifier ExportIPv6RoutePolicyId { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkusListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainListResult.Serialization.cs similarity index 66% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkusListResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainListResult.Serialization.cs index 2c431a46a822..4abc922a3612 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkusListResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class NetworkFabricSkusListResult : IUtf8JsonSerializable, IJsonModel + internal partial class L3IsolationDomainListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkFabricSkusListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(L3IsolationDomainListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NetworkFabricSkusListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + L3IsolationDomainListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkFabricSkusListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(L3IsolationDomainListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkFabricSkusListResult(document.RootElement, options); + return DeserializeL3IsolationDomainListResult(document.RootElement, options); } - internal static NetworkFabricSkusListResult DeserializeNetworkFabricSkusListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static L3IsolationDomainListResult DeserializeL3IsolationDomainListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,29 +83,29 @@ internal static NetworkFabricSkusListResult DeserializeNetworkFabricSkusListResu { return null; } - IReadOnlyList value = default; - string nextLink = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(NetworkFabricSkuData.DeserializeNetworkFabricSkuData(item, options)); + array.Add(NetworkFabricL3IsolationDomainData.DeserializeNetworkFabricL3IsolationDomainData(item, options)); } value = array; continue; } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +114,38 @@ internal static NetworkFabricSkusListResult DeserializeNetworkFabricSkusListResu } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkFabricSkusListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new L3IsolationDomainListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(NetworkFabricSkusListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(L3IsolationDomainListResult)} does not support writing '{options.Format}' format."); } } - NetworkFabricSkusListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + L3IsolationDomainListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkFabricSkusListResult(document.RootElement, options); + return DeserializeL3IsolationDomainListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NetworkFabricSkusListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(L3IsolationDomainListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainListResult.cs new file mode 100644 index 000000000000..f302ddf6389e --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a L3IsolationDomain list operation. + internal partial class L3IsolationDomainListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The L3IsolationDomain items on this page. + /// is null. + internal L3IsolationDomainListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The L3IsolationDomain items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal L3IsolationDomainListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal L3IsolationDomainListResult() + { + } + + /// The L3IsolationDomain items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainPatchProperties.Serialization.cs new file mode 100644 index 000000000000..b33f5bc7e2a4 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainPatchProperties.Serialization.cs @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class L3IsolationDomainPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(L3IsolationDomainPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (Optional.IsDefined(RedistributeConnectedSubnets)) + { + writer.WritePropertyName("redistributeConnectedSubnets"u8); + writer.WriteStringValue(RedistributeConnectedSubnets.Value.ToString()); + } + if (Optional.IsDefined(RedistributeStaticRoutes)) + { + writer.WritePropertyName("redistributeStaticRoutes"u8); + writer.WriteStringValue(RedistributeStaticRoutes.Value.ToString()); + } + if (Optional.IsDefined(AggregateRouteConfiguration)) + { + writer.WritePropertyName("aggregateRouteConfiguration"u8); + writer.WriteObjectValue(AggregateRouteConfiguration, options); + } + if (Optional.IsDefined(ConnectedSubnetRoutePolicy)) + { + writer.WritePropertyName("connectedSubnetRoutePolicy"u8); + writer.WriteObjectValue(ConnectedSubnetRoutePolicy, options); + } + if (Optional.IsDefined(StaticRoutePolicy)) + { + writer.WritePropertyName("staticRouteRoutePolicy"u8); + writer.WriteObjectValue(StaticRoutePolicy, options); + } + if (Optional.IsDefined(RoutePrefixLimit)) + { + writer.WritePropertyName("routePrefixLimit"u8); + writer.WriteObjectValue(RoutePrefixLimit, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + L3IsolationDomainPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(L3IsolationDomainPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeL3IsolationDomainPatchProperties(document.RootElement, options); + } + + internal static L3IsolationDomainPatchProperties DeserializeL3IsolationDomainPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + RedistributeConnectedSubnet? redistributeConnectedSubnets = default; + RedistributeStaticRoute? redistributeStaticRoutes = default; + AggregateRoutePatchConfiguration aggregateRouteConfiguration = default; + ConnectedSubnetRoutePolicyPatch connectedSubnetRoutePolicy = default; + StaticRoutePolicyPatch staticRouteRoutePolicy = default; + RoutePrefixLimitPatchProperties routePrefixLimit = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("redistributeConnectedSubnets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + redistributeConnectedSubnets = new RedistributeConnectedSubnet(property.Value.GetString()); + continue; + } + if (property.NameEquals("redistributeStaticRoutes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + redistributeStaticRoutes = new RedistributeStaticRoute(property.Value.GetString()); + continue; + } + if (property.NameEquals("aggregateRouteConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + aggregateRouteConfiguration = AggregateRoutePatchConfiguration.DeserializeAggregateRoutePatchConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("connectedSubnetRoutePolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectedSubnetRoutePolicy = ConnectedSubnetRoutePolicyPatch.DeserializeConnectedSubnetRoutePolicyPatch(property.Value, options); + continue; + } + if (property.NameEquals("staticRouteRoutePolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + staticRouteRoutePolicy = StaticRoutePolicyPatch.DeserializeStaticRoutePolicyPatch(property.Value, options); + continue; + } + if (property.NameEquals("routePrefixLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + routePrefixLimit = RoutePrefixLimitPatchProperties.DeserializeRoutePrefixLimitPatchProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new L3IsolationDomainPatchProperties( + annotation, + redistributeConnectedSubnets, + redistributeStaticRoutes, + aggregateRouteConfiguration, + connectedSubnetRoutePolicy, + staticRouteRoutePolicy, + routePrefixLimit, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(L3IsolationDomainPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + L3IsolationDomainPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeL3IsolationDomainPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(L3IsolationDomainPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainPatchProperties.cs new file mode 100644 index 000000000000..43b3289c8a27 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainPatchProperties.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Resource properties. + public partial class L3IsolationDomainPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public L3IsolationDomainPatchProperties() + { + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Advertise Connected Subnets. Ex: "True" | "False". + /// Advertise Static Routes. Ex: "True" | "False". + /// Aggregate route configurations. + /// Connected Subnet RoutePolicy. + /// Static Route - route policy. + /// Virtual Routing and Forwarding (VRF) Limit configuration. + /// Keeps track of any properties unknown to the library. + internal L3IsolationDomainPatchProperties(string annotation, RedistributeConnectedSubnet? redistributeConnectedSubnets, RedistributeStaticRoute? redistributeStaticRoutes, AggregateRoutePatchConfiguration aggregateRouteConfiguration, ConnectedSubnetRoutePolicyPatch connectedSubnetRoutePolicy, StaticRoutePolicyPatch staticRoutePolicy, RoutePrefixLimitPatchProperties routePrefixLimit, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + RedistributeConnectedSubnets = redistributeConnectedSubnets; + RedistributeStaticRoutes = redistributeStaticRoutes; + AggregateRouteConfiguration = aggregateRouteConfiguration; + ConnectedSubnetRoutePolicy = connectedSubnetRoutePolicy; + StaticRoutePolicy = staticRoutePolicy; + RoutePrefixLimit = routePrefixLimit; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// Advertise Connected Subnets. Ex: "True" | "False". + public RedistributeConnectedSubnet? RedistributeConnectedSubnets { get; set; } + /// Advertise Static Routes. Ex: "True" | "False". + public RedistributeStaticRoute? RedistributeStaticRoutes { get; set; } + /// Aggregate route configurations. + public AggregateRoutePatchConfiguration AggregateRouteConfiguration { get; set; } + /// Connected Subnet RoutePolicy. + internal ConnectedSubnetRoutePolicyPatch ConnectedSubnetRoutePolicy { get; set; } + /// Array of ARM Resource ID of the RoutePolicies. + public L3ExportRoutePolicyPatch ConnectedExportRoutePolicy + { + get => ConnectedSubnetRoutePolicy is null ? default : ConnectedSubnetRoutePolicy.ConnectedExportRoutePolicy; + set + { + if (ConnectedSubnetRoutePolicy is null) + ConnectedSubnetRoutePolicy = new ConnectedSubnetRoutePolicyPatch(); + ConnectedSubnetRoutePolicy.ConnectedExportRoutePolicy = value; + } + } + + /// Static Route - route policy. + internal StaticRoutePolicyPatch StaticRoutePolicy { get; set; } + /// Array of ARM Resource ID of the RoutePolicies. + public L3ExportRoutePolicyPatch ExportRoutePolicy + { + get => StaticRoutePolicy is null ? default : StaticRoutePolicy.ExportRoutePolicy; + set + { + if (StaticRoutePolicy is null) + StaticRoutePolicy = new StaticRoutePolicyPatch(); + StaticRoutePolicy.ExportRoutePolicy = value; + } + } + + /// Virtual Routing and Forwarding (VRF) Limit configuration. + public RoutePrefixLimitPatchProperties RoutePrefixLimit { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainProperties.Serialization.cs new file mode 100644 index 000000000000..701f31dbaeae --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainProperties.Serialization.cs @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class L3IsolationDomainProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(L3IsolationDomainProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (Optional.IsDefined(RedistributeConnectedSubnets)) + { + writer.WritePropertyName("redistributeConnectedSubnets"u8); + writer.WriteStringValue(RedistributeConnectedSubnets.Value.ToString()); + } + if (Optional.IsDefined(RedistributeStaticRoutes)) + { + writer.WritePropertyName("redistributeStaticRoutes"u8); + writer.WriteStringValue(RedistributeStaticRoutes.Value.ToString()); + } + if (Optional.IsDefined(AggregateRouteConfiguration)) + { + writer.WritePropertyName("aggregateRouteConfiguration"u8); + writer.WriteObjectValue(AggregateRouteConfiguration, options); + } + if (Optional.IsDefined(ConnectedSubnetRoutePolicy)) + { + writer.WritePropertyName("connectedSubnetRoutePolicy"u8); + writer.WriteObjectValue(ConnectedSubnetRoutePolicy, options); + } + writer.WritePropertyName("networkFabricId"u8); + writer.WriteStringValue(NetworkFabricId); + if (Optional.IsDefined(StaticRoutePolicy)) + { + writer.WritePropertyName("staticRouteRoutePolicy"u8); + writer.WriteObjectValue(StaticRoutePolicy, options); + } + if (Optional.IsDefined(UniqueRdConfiguration)) + { + writer.WritePropertyName("uniqueRdConfiguration"u8); + writer.WriteObjectValue(UniqueRdConfiguration, options); + } + if (Optional.IsDefined(RoutePrefixLimit)) + { + writer.WritePropertyName("routePrefixLimit"u8); + writer.WriteObjectValue(RoutePrefixLimit, options); + } + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } + if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) + { + writer.WritePropertyName("configurationState"u8); + writer.WriteStringValue(ConfigurationState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) + { + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + L3IsolationDomainProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(L3IsolationDomainProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeL3IsolationDomainProperties(document.RootElement, options); + } + + internal static L3IsolationDomainProperties DeserializeL3IsolationDomainProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + RedistributeConnectedSubnet? redistributeConnectedSubnets = default; + RedistributeStaticRoute? redistributeStaticRoutes = default; + AggregateRouteConfiguration aggregateRouteConfiguration = default; + ConnectedSubnetRoutePolicy connectedSubnetRoutePolicy = default; + ResourceIdentifier networkFabricId = default; + StaticRoutePolicy staticRouteRoutePolicy = default; + L3UniqueRouteDistinguisherProperties uniqueRdConfiguration = default; + RoutePrefixLimitProperties routePrefixLimit = default; + LastOperationProperties lastOperation = default; + NetworkFabricConfigurationState? configurationState = default; + NetworkFabricProvisioningState? provisioningState = default; + NetworkFabricAdministrativeState? administrativeState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("redistributeConnectedSubnets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + redistributeConnectedSubnets = new RedistributeConnectedSubnet(property.Value.GetString()); + continue; + } + if (property.NameEquals("redistributeStaticRoutes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + redistributeStaticRoutes = new RedistributeStaticRoute(property.Value.GetString()); + continue; + } + if (property.NameEquals("aggregateRouteConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + aggregateRouteConfiguration = AggregateRouteConfiguration.DeserializeAggregateRouteConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("connectedSubnetRoutePolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectedSubnetRoutePolicy = ConnectedSubnetRoutePolicy.DeserializeConnectedSubnetRoutePolicy(property.Value, options); + continue; + } + if (property.NameEquals("networkFabricId"u8)) + { + networkFabricId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("staticRouteRoutePolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + staticRouteRoutePolicy = StaticRoutePolicy.DeserializeStaticRoutePolicy(property.Value, options); + continue; + } + if (property.NameEquals("uniqueRdConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uniqueRdConfiguration = L3UniqueRouteDistinguisherProperties.DeserializeL3UniqueRouteDistinguisherProperties(property.Value, options); + continue; + } + if (property.NameEquals("routePrefixLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + routePrefixLimit = RoutePrefixLimitProperties.DeserializeRoutePrefixLimitProperties(property.Value, options); + continue; + } + if (property.NameEquals("lastOperation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property.Value, options); + continue; + } + if (property.NameEquals("configurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configurationState = new NetworkFabricConfigurationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NetworkFabricProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("administrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeState = new NetworkFabricAdministrativeState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new L3IsolationDomainProperties( + annotation, + redistributeConnectedSubnets, + redistributeStaticRoutes, + aggregateRouteConfiguration, + connectedSubnetRoutePolicy, + networkFabricId, + staticRouteRoutePolicy, + uniqueRdConfiguration, + routePrefixLimit, + lastOperation, + configurationState, + provisioningState, + administrativeState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(L3IsolationDomainProperties)} does not support writing '{options.Format}' format."); + } + } + + L3IsolationDomainProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeL3IsolationDomainProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(L3IsolationDomainProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainProperties.cs new file mode 100644 index 000000000000..b477b09b3c3f --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainProperties.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// L3 Isolation Domain Properties defines the properties of the resource. + public partial class L3IsolationDomainProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// ARM Resource ID of the Network Fabric. + /// is null. + public L3IsolationDomainProperties(ResourceIdentifier networkFabricId) + { + Argument.AssertNotNull(networkFabricId, nameof(networkFabricId)); + + NetworkFabricId = networkFabricId; + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Advertise Connected Subnets. Ex: "True" | "False". + /// Advertise Static Routes. Ex: "True" | "False". + /// Aggregate route configurations. + /// Connected Subnet RoutePolicy. + /// ARM Resource ID of the Network Fabric. + /// Static Route - route policy. + /// Unique Route Distinguisher configuration. + /// VRF Limit configuration. + /// Details of the last operation performed on the resource. + /// Configuration state of the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// Keeps track of any properties unknown to the library. + internal L3IsolationDomainProperties(string annotation, RedistributeConnectedSubnet? redistributeConnectedSubnets, RedistributeStaticRoute? redistributeStaticRoutes, AggregateRouteConfiguration aggregateRouteConfiguration, ConnectedSubnetRoutePolicy connectedSubnetRoutePolicy, ResourceIdentifier networkFabricId, StaticRoutePolicy staticRoutePolicy, L3UniqueRouteDistinguisherProperties uniqueRdConfiguration, RoutePrefixLimitProperties routePrefixLimit, LastOperationProperties lastOperation, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + RedistributeConnectedSubnets = redistributeConnectedSubnets; + RedistributeStaticRoutes = redistributeStaticRoutes; + AggregateRouteConfiguration = aggregateRouteConfiguration; + ConnectedSubnetRoutePolicy = connectedSubnetRoutePolicy; + NetworkFabricId = networkFabricId; + StaticRoutePolicy = staticRoutePolicy; + UniqueRdConfiguration = uniqueRdConfiguration; + RoutePrefixLimit = routePrefixLimit; + LastOperation = lastOperation; + ConfigurationState = configurationState; + ProvisioningState = provisioningState; + AdministrativeState = administrativeState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal L3IsolationDomainProperties() + { + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// Advertise Connected Subnets. Ex: "True" | "False". + public RedistributeConnectedSubnet? RedistributeConnectedSubnets { get; set; } + /// Advertise Static Routes. Ex: "True" | "False". + public RedistributeStaticRoute? RedistributeStaticRoutes { get; set; } + /// Aggregate route configurations. + public AggregateRouteConfiguration AggregateRouteConfiguration { get; set; } + /// Connected Subnet RoutePolicy. + internal ConnectedSubnetRoutePolicy ConnectedSubnetRoutePolicy { get; set; } + /// Array of ARM Resource ID of the RoutePolicies. + public L3ExportRoutePolicy ConnectedExportRoutePolicy + { + get => ConnectedSubnetRoutePolicy is null ? default : ConnectedSubnetRoutePolicy.ConnectedExportRoutePolicy; + set + { + if (ConnectedSubnetRoutePolicy is null) + ConnectedSubnetRoutePolicy = new ConnectedSubnetRoutePolicy(); + ConnectedSubnetRoutePolicy.ConnectedExportRoutePolicy = value; + } + } + + /// ARM Resource ID of the Network Fabric. + public ResourceIdentifier NetworkFabricId { get; set; } + /// Static Route - route policy. + internal StaticRoutePolicy StaticRoutePolicy { get; set; } + /// Array of ARM Resource ID of the RoutePolicies. + public L3ExportRoutePolicy ExportRoutePolicy + { + get => StaticRoutePolicy is null ? default : StaticRoutePolicy.ExportRoutePolicy; + set + { + if (StaticRoutePolicy is null) + StaticRoutePolicy = new StaticRoutePolicy(); + StaticRoutePolicy.ExportRoutePolicy = value; + } + } + + /// Unique Route Distinguisher configuration. + internal L3UniqueRouteDistinguisherProperties UniqueRdConfiguration { get; set; } + /// List of Unique Route Distinguisher addresses. + public IReadOnlyList UniqueRds + { + get + { + if (UniqueRdConfiguration is null) + UniqueRdConfiguration = new L3UniqueRouteDistinguisherProperties(); + return UniqueRdConfiguration.UniqueRds; + } + } + + /// VRF Limit configuration. + public RoutePrefixLimitProperties RoutePrefixLimit { get; set; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + + /// Configuration state of the resource. + public NetworkFabricConfigurationState? ConfigurationState { get; } + /// Provisioning state of the resource. + public NetworkFabricProvisioningState? ProvisioningState { get; } + /// Administrative state of the resource. + public NetworkFabricAdministrativeState? AdministrativeState { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3OptionBPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3OptionBPatchProperties.Serialization.cs new file mode 100644 index 000000000000..b7fef25dd07b --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3OptionBPatchProperties.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class L3OptionBPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(L3OptionBPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(ImportRouteTargets)) + { + writer.WritePropertyName("importRouteTargets"u8); + writer.WriteStartArray(); + foreach (var item in ImportRouteTargets) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ExportRouteTargets)) + { + writer.WritePropertyName("exportRouteTargets"u8); + writer.WriteStartArray(); + foreach (var item in ExportRouteTargets) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(RouteTargets)) + { + writer.WritePropertyName("routeTargets"u8); + writer.WriteObjectValue(RouteTargets, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + L3OptionBPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(L3OptionBPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeL3OptionBPatchProperties(document.RootElement, options); + } + + internal static L3OptionBPatchProperties DeserializeL3OptionBPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList importRouteTargets = default; + IList exportRouteTargets = default; + RouteTargetPatchInformation routeTargets = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("importRouteTargets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + importRouteTargets = array; + continue; + } + if (property.NameEquals("exportRouteTargets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + exportRouteTargets = array; + continue; + } + if (property.NameEquals("routeTargets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + routeTargets = RouteTargetPatchInformation.DeserializeRouteTargetPatchInformation(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new L3OptionBPatchProperties(importRouteTargets ?? new ChangeTrackingList(), exportRouteTargets ?? new ChangeTrackingList(), routeTargets, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(L3OptionBPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + L3OptionBPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeL3OptionBPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(L3OptionBPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3OptionBPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3OptionBPatchProperties.cs new file mode 100644 index 000000000000..ffce9ace165b --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3OptionBPatchProperties.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Option B configuration. + public partial class L3OptionBPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public L3OptionBPatchProperties() + { + ImportRouteTargets = new ChangeTrackingList(); + ExportRouteTargets = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// RouteTargets to be applied. This is used for the backward compatibility. + /// RouteTargets to be applied. This is used for the backward compatibility. + /// RouteTargets to be applied. + /// Keeps track of any properties unknown to the library. + internal L3OptionBPatchProperties(IList importRouteTargets, IList exportRouteTargets, RouteTargetPatchInformation routeTargets, IDictionary serializedAdditionalRawData) + { + ImportRouteTargets = importRouteTargets; + ExportRouteTargets = exportRouteTargets; + RouteTargets = routeTargets; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// RouteTargets to be applied. This is used for the backward compatibility. + public IList ImportRouteTargets { get; } + /// RouteTargets to be applied. This is used for the backward compatibility. + public IList ExportRouteTargets { get; } + /// RouteTargets to be applied. + public RouteTargetPatchInformation RouteTargets { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateAdministrativeStateOnResources.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3UniqueRouteDistinguisherProperties.Serialization.cs similarity index 61% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateAdministrativeStateOnResources.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3UniqueRouteDistinguisherProperties.Serialization.cs index 47a6579a57b2..2ff56562d0bb 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateAdministrativeStateOnResources.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3UniqueRouteDistinguisherProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - public partial class UpdateAdministrativeStateOnResources : IUtf8JsonSerializable, IJsonModel + internal partial class L3UniqueRouteDistinguisherProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,23 +28,18 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(UpdateAdministrativeStateOnResources)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(L3UniqueRouteDistinguisherProperties)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(ResourceIds)) + if (options.Format != "W" && Optional.IsCollectionDefined(UniqueRds)) { - writer.WritePropertyName("resourceIds"u8); + writer.WritePropertyName("uniqueRds"u8); writer.WriteStartArray(); - foreach (var item in ResourceIds) + foreach (var item in UniqueRds) { - if (item == null) - { - writer.WriteNullValue(); - continue; - } writer.WriteStringValue(item); } writer.WriteEndArray(); @@ -66,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - UpdateAdministrativeStateOnResources IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + L3UniqueRouteDistinguisherProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(UpdateAdministrativeStateOnResources)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(L3UniqueRouteDistinguisherProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeUpdateAdministrativeStateOnResources(document.RootElement, options); + return DeserializeL3UniqueRouteDistinguisherProperties(document.RootElement, options); } - internal static UpdateAdministrativeStateOnResources DeserializeUpdateAdministrativeStateOnResources(JsonElement element, ModelReaderWriterOptions options = null) + internal static L3UniqueRouteDistinguisherProperties DeserializeL3UniqueRouteDistinguisherProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,30 +81,23 @@ internal static UpdateAdministrativeStateOnResources DeserializeUpdateAdministra { return null; } - IList resourceIds = default; + IReadOnlyList uniqueRds = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("resourceIds"u8)) + if (property.NameEquals("uniqueRds"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } + array.Add(item.GetString()); } - resourceIds = array; + uniqueRds = array; continue; } if (options.Format != "W") @@ -118,38 +106,38 @@ internal static UpdateAdministrativeStateOnResources DeserializeUpdateAdministra } } serializedAdditionalRawData = rawDataDictionary; - return new UpdateAdministrativeStateOnResources(resourceIds ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new L3UniqueRouteDistinguisherProperties(uniqueRds ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(UpdateAdministrativeStateOnResources)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(L3UniqueRouteDistinguisherProperties)} does not support writing '{options.Format}' format."); } } - UpdateAdministrativeStateOnResources IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + L3UniqueRouteDistinguisherProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeUpdateAdministrativeStateOnResources(document.RootElement, options); + return DeserializeL3UniqueRouteDistinguisherProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(UpdateAdministrativeStateOnResources)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(L3UniqueRouteDistinguisherProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainsListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3UniqueRouteDistinguisherProperties.cs similarity index 66% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainsListResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3UniqueRouteDistinguisherProperties.cs index a15e716ca56c..f957dffeac4c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3IsolationDomainsListResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L3UniqueRouteDistinguisherProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of L3 Isolation Domains. - internal partial class L3IsolationDomainsListResult + /// Unique Route Distinguisher properties. + internal partial class L3UniqueRouteDistinguisherProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,22 @@ internal partial class L3IsolationDomainsListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal L3IsolationDomainsListResult() + /// Initializes a new instance of . + public L3UniqueRouteDistinguisherProperties() { - Value = new ChangeTrackingList(); + UniqueRds = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of L3 Isolation Domain resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// List of Unique Route Distinguisher addresses. /// Keeps track of any properties unknown to the library. - internal L3IsolationDomainsListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal L3UniqueRouteDistinguisherProperties(IReadOnlyList uniqueRds, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + UniqueRds = uniqueRds; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of L3 Isolation Domain resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// List of Unique Route Distinguisher addresses. + public IReadOnlyList UniqueRds { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/LastOperationProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/LastOperationProperties.Serialization.cs new file mode 100644 index 000000000000..0f51db47113c --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/LastOperationProperties.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class LastOperationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LastOperationProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Details)) + { + writer.WritePropertyName("details"u8); + writer.WriteStringValue(Details); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LastOperationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LastOperationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLastOperationProperties(document.RootElement, options); + } + + internal static LastOperationProperties DeserializeLastOperationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string details = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("details"u8)) + { + details = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LastOperationProperties(details, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(LastOperationProperties)} does not support writing '{options.Format}' format."); + } + } + + LastOperationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLastOperationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LastOperationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainsListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/LastOperationProperties.cs similarity index 65% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainsListResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/LastOperationProperties.cs index cdd2c80d37d3..616f67ba5401 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/L2IsolationDomainsListResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/LastOperationProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of L2 Isolation Domains. - internal partial class L2IsolationDomainsListResult + /// Details of the last operations performed on the resource. + internal partial class LastOperationProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,21 @@ internal partial class L2IsolationDomainsListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal L2IsolationDomainsListResult() + /// Initializes a new instance of . + internal LastOperationProperties() { - Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Displays list of L2 Isolation Domain resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// Details status of the last operation performed on the resource. /// Keeps track of any properties unknown to the library. - internal L2IsolationDomainsListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal LastOperationProperties(string details, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + Details = details; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Displays list of L2 Isolation Domain resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// Details status of the last operation performed on the resource. + public string Details { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/Layer2ConfigurationPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/Layer2ConfigurationPatch.Serialization.cs new file mode 100644 index 000000000000..0c3ef70aec1b --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/Layer2ConfigurationPatch.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class Layer2ConfigurationPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Layer2ConfigurationPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Mtu)) + { + writer.WritePropertyName("mtu"u8); + writer.WriteNumberValue(Mtu.Value); + } + if (Optional.IsCollectionDefined(Interfaces)) + { + writer.WritePropertyName("interfaces"u8); + writer.WriteStartArray(); + foreach (var item in Interfaces) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Layer2ConfigurationPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Layer2ConfigurationPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLayer2ConfigurationPatch(document.RootElement, options); + } + + internal static Layer2ConfigurationPatch DeserializeLayer2ConfigurationPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? mtu = default; + IList interfaces = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mtu"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mtu = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("interfaces"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + interfaces = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Layer2ConfigurationPatch(mtu, interfaces ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(Layer2ConfigurationPatch)} does not support writing '{options.Format}' format."); + } + } + + Layer2ConfigurationPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLayer2ConfigurationPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Layer2ConfigurationPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/Layer2ConfigurationPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/Layer2ConfigurationPatch.cs new file mode 100644 index 000000000000..00b559e54268 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/Layer2ConfigurationPatch.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Common properties for Layer2 Configuration. + public partial class Layer2ConfigurationPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public Layer2ConfigurationPatch() + { + Interfaces = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// MTU of the packets between PE & CE. + /// List of network device interfaces resource IDs. + /// Keeps track of any properties unknown to the library. + internal Layer2ConfigurationPatch(int? mtu, IList interfaces, IDictionary serializedAdditionalRawData) + { + Mtu = mtu; + Interfaces = interfaces; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// MTU of the packets between PE & CE. + public int? Mtu { get; set; } + /// List of network device interfaces resource IDs. + public IList Interfaces { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/Layer4Protocol.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/Layer4Protocol.cs index 1e8b3f97ce75..be8095880a79 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/Layer4Protocol.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/Layer4Protocol.cs @@ -24,11 +24,14 @@ public Layer4Protocol(string value) private const string TcpValue = "TCP"; private const string UdpValue = "UDP"; + private const string SctpValue = "SCTP"; - /// TCP. + /// TCP(Transmission Control Protocol) Protocol. public static Layer4Protocol Tcp { get; } = new Layer4Protocol(TcpValue); - /// UDP. + /// UDP(User Datagram Protocol) Protocol. public static Layer4Protocol Udp { get; } = new Layer4Protocol(UdpValue); + /// SCTP(Streaming Control Transmission Protocol) Protocol. + public static Layer4Protocol Sctp { get; } = new Layer4Protocol(SctpValue); /// Determines if two values are the same. public static bool operator ==(Layer4Protocol left, Layer4Protocol right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/LockConfigurationState.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/LockConfigurationState.cs new file mode 100644 index 000000000000..6066ee0cd3a6 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/LockConfigurationState.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Lock Configuration State. + public readonly partial struct LockConfigurationState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public LockConfigurationState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// LockConfigurationState Enabled. + public static LockConfigurationState Enabled { get; } = new LockConfigurationState(EnabledValue); + /// LockConfigurationState Disabled. + public static LockConfigurationState Disabled { get; } = new LockConfigurationState(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(LockConfigurationState left, LockConfigurationState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(LockConfigurationState left, LockConfigurationState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator LockConfigurationState(string value) => new LockConfigurationState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is LockConfigurationState other && Equals(other); + /// + public bool Equals(LockConfigurationState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagedServiceIdentityPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagedServiceIdentityPatch.Serialization.cs new file mode 100644 index 000000000000..99f114a01e3a --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagedServiceIdentityPatch.Serialization.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class ManagedServiceIdentityPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedServiceIdentityPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IdentityType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(IdentityType.Value.ToString()); + } + if (Optional.IsCollectionDefined(UserAssignedIdentities)) + { + writer.WritePropertyName("userAssignedIdentities"u8); + writer.WriteStartObject(); + foreach (var item in UserAssignedIdentities) + { + writer.WritePropertyName(item.Key); + ((IJsonModel)item.Value).Write(writer, options); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedServiceIdentityPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedServiceIdentityPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedServiceIdentityPatch(document.RootElement, options); + } + + internal static ManagedServiceIdentityPatch DeserializeManagedServiceIdentityPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentityType? type = default; + IDictionary userAssignedIdentities = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ManagedServiceIdentityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userAssignedIdentities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property0.Value.GetRawText())), options, AzureResourceManagerManagedNetworkFabricContext.Default)); + } + userAssignedIdentities = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedServiceIdentityPatch(type, userAssignedIdentities ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(ManagedServiceIdentityPatch)} does not support writing '{options.Format}' format."); + } + } + + ManagedServiceIdentityPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagedServiceIdentityPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedServiceIdentityPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagedServiceIdentityPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagedServiceIdentityPatch.cs new file mode 100644 index 000000000000..10c1b91f787f --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagedServiceIdentityPatch.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The managed service identities assigned to this resource. + public partial class ManagedServiceIdentityPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ManagedServiceIdentityPatch() + { + UserAssignedIdentities = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The type of managed identity assigned to this resource. + /// The identities assigned to this resource by the user. + /// Keeps track of any properties unknown to the library. + internal ManagedServiceIdentityPatch(ManagedServiceIdentityType? identityType, IDictionary userAssignedIdentities, IDictionary serializedAdditionalRawData) + { + IdentityType = identityType; + UserAssignedIdentities = userAssignedIdentities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of managed identity assigned to this resource. + public ManagedServiceIdentityType? IdentityType { get; set; } + /// The identities assigned to this resource by the user. + public IDictionary UserAssignedIdentities { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagedServiceIdentitySelectorType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagedServiceIdentitySelectorType.cs new file mode 100644 index 000000000000..bdf30ab40405 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagedServiceIdentitySelectorType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The type of managed identity. + public readonly partial struct ManagedServiceIdentitySelectorType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedServiceIdentitySelectorType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SystemAssignedIdentityValue = "SystemAssignedIdentity"; + private const string UserAssignedIdentityValue = "UserAssignedIdentity"; + + /// System Assigned Identity. + public static ManagedServiceIdentitySelectorType SystemAssignedIdentity { get; } = new ManagedServiceIdentitySelectorType(SystemAssignedIdentityValue); + /// User Assigned Identity. + public static ManagedServiceIdentitySelectorType UserAssignedIdentity { get; } = new ManagedServiceIdentitySelectorType(UserAssignedIdentityValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedServiceIdentitySelectorType left, ManagedServiceIdentitySelectorType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedServiceIdentitySelectorType left, ManagedServiceIdentitySelectorType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ManagedServiceIdentitySelectorType(string value) => new ManagedServiceIdentitySelectorType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedServiceIdentitySelectorType other && Equals(other); + /// + public bool Equals(ManagedServiceIdentitySelectorType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagedServiceIdentityType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagedServiceIdentityType.cs new file mode 100644 index 000000000000..8d1cad6e446b --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagedServiceIdentityType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + public readonly partial struct ManagedServiceIdentityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedServiceIdentityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string SystemAssignedValue = "SystemAssigned"; + private const string UserAssignedValue = "UserAssigned"; + private const string SystemAssignedUserAssignedValue = "SystemAssigned,UserAssigned"; + + /// None. + public static ManagedServiceIdentityType None { get; } = new ManagedServiceIdentityType(NoneValue); + /// SystemAssigned. + public static ManagedServiceIdentityType SystemAssigned { get; } = new ManagedServiceIdentityType(SystemAssignedValue); + /// UserAssigned. + public static ManagedServiceIdentityType UserAssigned { get; } = new ManagedServiceIdentityType(UserAssignedValue); + /// SystemAssigned,UserAssigned. + public static ManagedServiceIdentityType SystemAssignedUserAssigned { get; } = new ManagedServiceIdentityType(SystemAssignedUserAssignedValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedServiceIdentityType left, ManagedServiceIdentityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedServiceIdentityType left, ManagedServiceIdentityType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ManagedServiceIdentityType(string value) => new ManagedServiceIdentityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedServiceIdentityType other && Equals(other); + /// + public bool Equals(ManagedServiceIdentityType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagementNetworkConfigurationPatchableProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagementNetworkPatchConfiguration.Serialization.cs similarity index 66% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagementNetworkConfigurationPatchableProperties.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagementNetworkPatchConfiguration.Serialization.cs index 9c9ca8d707ba..12950d122e44 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagementNetworkConfigurationPatchableProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagementNetworkPatchConfiguration.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - public partial class ManagementNetworkConfigurationPatchableProperties : IUtf8JsonSerializable, IJsonModel + public partial class ManagementNetworkPatchConfiguration : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8Jso /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagementNetworkConfigurationPatchableProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ManagementNetworkPatchConfiguration)} does not support writing '{format}' format."); } if (Optional.IsDefined(InfrastructureVpnConfiguration)) @@ -61,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ManagementNetworkConfigurationPatchableProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ManagementNetworkPatchConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagementNetworkConfigurationPatchableProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ManagementNetworkPatchConfiguration)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagementNetworkConfigurationPatchableProperties(document.RootElement, options); + return DeserializeManagementNetworkPatchConfiguration(document.RootElement, options); } - internal static ManagementNetworkConfigurationPatchableProperties DeserializeManagementNetworkConfigurationPatchableProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static ManagementNetworkPatchConfiguration DeserializeManagementNetworkPatchConfiguration(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,38 +111,38 @@ internal static ManagementNetworkConfigurationPatchableProperties DeserializeMan } } serializedAdditionalRawData = rawDataDictionary; - return new ManagementNetworkConfigurationPatchableProperties(infrastructureVpnConfiguration, workloadVpnConfiguration, serializedAdditionalRawData); + return new ManagementNetworkPatchConfiguration(infrastructureVpnConfiguration, workloadVpnConfiguration, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(ManagementNetworkConfigurationPatchableProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ManagementNetworkPatchConfiguration)} does not support writing '{options.Format}' format."); } } - ManagementNetworkConfigurationPatchableProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ManagementNetworkPatchConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeManagementNetworkConfigurationPatchableProperties(document.RootElement, options); + return DeserializeManagementNetworkPatchConfiguration(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ManagementNetworkConfigurationPatchableProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ManagementNetworkPatchConfiguration)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagementNetworkConfigurationPatchableProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagementNetworkPatchConfiguration.cs similarity index 83% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagementNetworkConfigurationPatchableProperties.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagementNetworkPatchConfiguration.cs index 6ada16412480..03e6b1527527 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagementNetworkConfigurationPatchableProperties.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ManagementNetworkPatchConfiguration.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// Configuration to be used to setup the management network. - public partial class ManagementNetworkConfigurationPatchableProperties + public partial class ManagementNetworkPatchConfiguration { /// /// Keeps track of any properties unknown to the library. @@ -45,16 +45,16 @@ public partial class ManagementNetworkConfigurationPatchableProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ManagementNetworkConfigurationPatchableProperties() + /// Initializes a new instance of . + public ManagementNetworkPatchConfiguration() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// VPN Configuration properties. /// VPN Configuration properties. /// Keeps track of any properties unknown to the library. - internal ManagementNetworkConfigurationPatchableProperties(VpnConfigurationPatchableProperties infrastructureVpnConfiguration, VpnConfigurationPatchableProperties workloadVpnConfiguration, IDictionary serializedAdditionalRawData) + internal ManagementNetworkPatchConfiguration(VpnConfigurationPatchableProperties infrastructureVpnConfiguration, VpnConfigurationPatchableProperties workloadVpnConfiguration, IDictionary serializedAdditionalRawData) { InfrastructureVpnConfiguration = infrastructureVpnConfiguration; WorkloadVpnConfiguration = workloadVpnConfiguration; diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/MicroBfdState.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/MicroBfdState.cs new file mode 100644 index 000000000000..744ce3ec1274 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/MicroBfdState.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Micro Bidirectional Forwarding Detection (BFD) enabled/disabled state. + public readonly partial struct MicroBfdState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MicroBfdState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// MicroBfdState-Enabled. + public static MicroBfdState Enabled { get; } = new MicroBfdState(EnabledValue); + /// MicroBfdState-Disabled. + public static MicroBfdState Disabled { get; } = new MicroBfdState(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(MicroBfdState left, MicroBfdState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MicroBfdState left, MicroBfdState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MicroBfdState(string value) => new MicroBfdState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MicroBfdState other && Equals(other); + /// + public bool Equals(MicroBfdState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NNIDerivedUniqueRouteDistinguisherConfigurationState.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NNIDerivedUniqueRouteDistinguisherConfigurationState.cs new file mode 100644 index 000000000000..2b0bc1aecf4e --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NNIDerivedUniqueRouteDistinguisherConfigurationState.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// NNI Derived Unique Route Distinguisher Configuration State. + public readonly partial struct NNIDerivedUniqueRouteDistinguisherConfigurationState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public NNIDerivedUniqueRouteDistinguisherConfigurationState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// NNI derived unique route distinguisher configuration state Enabled. + public static NNIDerivedUniqueRouteDistinguisherConfigurationState Enabled { get; } = new NNIDerivedUniqueRouteDistinguisherConfigurationState(EnabledValue); + /// NNI derived unique route distinguisher configuration state Disabled. + public static NNIDerivedUniqueRouteDistinguisherConfigurationState Disabled { get; } = new NNIDerivedUniqueRouteDistinguisherConfigurationState(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(NNIDerivedUniqueRouteDistinguisherConfigurationState left, NNIDerivedUniqueRouteDistinguisherConfigurationState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NNIDerivedUniqueRouteDistinguisherConfigurationState left, NNIDerivedUniqueRouteDistinguisherConfigurationState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator NNIDerivedUniqueRouteDistinguisherConfigurationState(string value) => new NNIDerivedUniqueRouteDistinguisherConfigurationState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NNIDerivedUniqueRouteDistinguisherConfigurationState other && Equals(other); + /// + public bool Equals(NNIDerivedUniqueRouteDistinguisherConfigurationState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv4PrefixLimitPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv4PrefixLimitPatchProperties.Serialization.cs new file mode 100644 index 000000000000..72c92a595462 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv4PrefixLimitPatchProperties.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class NativeIPv4PrefixLimitPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NativeIPv4PrefixLimitPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(PrefixLimits)) + { + writer.WritePropertyName("prefixLimits"u8); + writer.WriteStartArray(); + foreach (var item in PrefixLimits) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NativeIPv4PrefixLimitPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NativeIPv4PrefixLimitPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNativeIPv4PrefixLimitPatchProperties(document.RootElement, options); + } + + internal static NativeIPv4PrefixLimitPatchProperties DeserializeNativeIPv4PrefixLimitPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList prefixLimits = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("prefixLimits"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PrefixLimitPatchProperties.DeserializePrefixLimitPatchProperties(item, options)); + } + prefixLimits = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NativeIPv4PrefixLimitPatchProperties(prefixLimits ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NativeIPv4PrefixLimitPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + NativeIPv4PrefixLimitPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNativeIPv4PrefixLimitPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NativeIPv4PrefixLimitPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapsListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv4PrefixLimitPatchProperties.cs similarity index 68% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapsListResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv4PrefixLimitPatchProperties.cs index 7ffa804f9590..0e187d15143a 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapsListResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv4PrefixLimitPatchProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of NetworkTaps. - internal partial class NetworkTapsListResult + /// External Network native IPv4 prefix limits patch properties. + internal partial class NativeIPv4PrefixLimitPatchProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,22 @@ internal partial class NetworkTapsListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal NetworkTapsListResult() + /// Initializes a new instance of . + public NativeIPv4PrefixLimitPatchProperties() { - Value = new ChangeTrackingList(); + PrefixLimits = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of NetworkTap resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// Prefix limits. /// Keeps track of any properties unknown to the library. - internal NetworkTapsListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NativeIPv4PrefixLimitPatchProperties(IList prefixLimits, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + PrefixLimits = prefixLimits; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of NetworkTap resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// Prefix limits. + public IList PrefixLimits { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv4PrefixLimitProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv4PrefixLimitProperties.Serialization.cs new file mode 100644 index 000000000000..7b249c4b4f7c --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv4PrefixLimitProperties.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class NativeIPv4PrefixLimitProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NativeIPv4PrefixLimitProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(PrefixLimits)) + { + writer.WritePropertyName("prefixLimits"u8); + writer.WriteStartArray(); + foreach (var item in PrefixLimits) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NativeIPv4PrefixLimitProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NativeIPv4PrefixLimitProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNativeIPv4PrefixLimitProperties(document.RootElement, options); + } + + internal static NativeIPv4PrefixLimitProperties DeserializeNativeIPv4PrefixLimitProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList prefixLimits = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("prefixLimits"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PrefixLimitProperties.DeserializePrefixLimitProperties(item, options)); + } + prefixLimits = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NativeIPv4PrefixLimitProperties(prefixLimits ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NativeIPv4PrefixLimitProperties)} does not support writing '{options.Format}' format."); + } + } + + NativeIPv4PrefixLimitProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNativeIPv4PrefixLimitProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NativeIPv4PrefixLimitProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRacksListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv4PrefixLimitProperties.cs similarity index 68% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRacksListResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv4PrefixLimitProperties.cs index 5ba34a4a3c8b..47528fe97b17 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRacksListResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv4PrefixLimitProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of Network Racks. - internal partial class NetworkRacksListResult + /// External Network native IPv4 prefix limit properties. + internal partial class NativeIPv4PrefixLimitProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,22 @@ internal partial class NetworkRacksListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal NetworkRacksListResult() + /// Initializes a new instance of . + public NativeIPv4PrefixLimitProperties() { - Value = new ChangeTrackingList(); + PrefixLimits = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of Network Rack resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// Prefix limits. /// Keeps track of any properties unknown to the library. - internal NetworkRacksListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NativeIPv4PrefixLimitProperties(IList prefixLimits, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + PrefixLimits = prefixLimits; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of Network Rack resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// Prefix limits. + public IList PrefixLimits { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv6PrefixLimitPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv6PrefixLimitPatchProperties.Serialization.cs new file mode 100644 index 000000000000..73520af7b94f --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv6PrefixLimitPatchProperties.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class NativeIPv6PrefixLimitPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NativeIPv6PrefixLimitPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(PrefixLimits)) + { + writer.WritePropertyName("prefixLimits"u8); + writer.WriteStartArray(); + foreach (var item in PrefixLimits) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NativeIPv6PrefixLimitPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NativeIPv6PrefixLimitPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNativeIPv6PrefixLimitPatchProperties(document.RootElement, options); + } + + internal static NativeIPv6PrefixLimitPatchProperties DeserializeNativeIPv6PrefixLimitPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList prefixLimits = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("prefixLimits"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PrefixLimitPatchProperties.DeserializePrefixLimitPatchProperties(item, options)); + } + prefixLimits = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NativeIPv6PrefixLimitPatchProperties(prefixLimits ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NativeIPv6PrefixLimitPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + NativeIPv6PrefixLimitPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNativeIPv6PrefixLimitPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NativeIPv6PrefixLimitPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicesListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv6PrefixLimitPatchProperties.cs similarity index 68% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicesListResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv6PrefixLimitPatchProperties.cs index f91289102b23..ddbb983d8ac7 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicesListResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv6PrefixLimitPatchProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of NetworkDevices. - internal partial class NetworkDevicesListResult + /// External Network native IPv6 prefix limits patch properties. + internal partial class NativeIPv6PrefixLimitPatchProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,22 @@ internal partial class NetworkDevicesListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal NetworkDevicesListResult() + /// Initializes a new instance of . + public NativeIPv6PrefixLimitPatchProperties() { - Value = new ChangeTrackingList(); + PrefixLimits = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of NetworkDevice resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// Prefix limits. /// Keeps track of any properties unknown to the library. - internal NetworkDevicesListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NativeIPv6PrefixLimitPatchProperties(IList prefixLimits, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + PrefixLimits = prefixLimits; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of NetworkDevice resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// Prefix limits. + public IList PrefixLimits { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv6PrefixLimitProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv6PrefixLimitProperties.Serialization.cs new file mode 100644 index 000000000000..211d5b454541 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv6PrefixLimitProperties.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class NativeIPv6PrefixLimitProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NativeIPv6PrefixLimitProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(PrefixLimits)) + { + writer.WritePropertyName("prefixLimits"u8); + writer.WriteStartArray(); + foreach (var item in PrefixLimits) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NativeIPv6PrefixLimitProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NativeIPv6PrefixLimitProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNativeIPv6PrefixLimitProperties(document.RootElement, options); + } + + internal static NativeIPv6PrefixLimitProperties DeserializeNativeIPv6PrefixLimitProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList prefixLimits = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("prefixLimits"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PrefixLimitProperties.DeserializePrefixLimitProperties(item, options)); + } + prefixLimits = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NativeIPv6PrefixLimitProperties(prefixLimits ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NativeIPv6PrefixLimitProperties)} does not support writing '{options.Format}' format."); + } + } + + NativeIPv6PrefixLimitProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNativeIPv6PrefixLimitProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NativeIPv6PrefixLimitProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv6PrefixLimitProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv6PrefixLimitProperties.cs new file mode 100644 index 000000000000..c9693d10f591 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NativeIPv6PrefixLimitProperties.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// External Network native IPv6 prefix limit properties. + internal partial class NativeIPv6PrefixLimitProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NativeIPv6PrefixLimitProperties() + { + PrefixLimits = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Prefix limits. + /// Keeps track of any properties unknown to the library. + internal NativeIPv6PrefixLimitProperties(IList prefixLimits, IDictionary serializedAdditionalRawData) + { + PrefixLimits = prefixLimits; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Prefix limits. + public IList PrefixLimits { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddress.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddress.Serialization.cs index 9684093524a7..b6dd7a3f5f37 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddress.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddress.Serialization.cs @@ -39,6 +39,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("address"u8); writer.WriteStringValue(Address); } + if (options.Format != "W" && Optional.IsDefined(BfdAdministrativeState)) + { + writer.WritePropertyName("bfdAdministrativeState"u8); + writer.WriteStringValue(BfdAdministrativeState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(BgpAdministrativeState)) + { + writer.WritePropertyName("bgpAdministrativeState"u8); + writer.WriteStringValue(BgpAdministrativeState.Value.ToString()); + } if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) { writer.WritePropertyName("configurationState"u8); @@ -82,6 +92,8 @@ internal static NeighborAddress DeserializeNeighborAddress(JsonElement element, return null; } string address = default; + BfdAdministrativeState? bfdAdministrativeState = default; + BgpAdministrativeState? bgpAdministrativeState = default; NetworkFabricConfigurationState? configurationState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -92,6 +104,24 @@ internal static NeighborAddress DeserializeNeighborAddress(JsonElement element, address = property.Value.GetString(); continue; } + if (property.NameEquals("bfdAdministrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bfdAdministrativeState = new BfdAdministrativeState(property.Value.GetString()); + continue; + } + if (property.NameEquals("bgpAdministrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bgpAdministrativeState = new BgpAdministrativeState(property.Value.GetString()); + continue; + } if (property.NameEquals("configurationState"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -107,7 +137,7 @@ internal static NeighborAddress DeserializeNeighborAddress(JsonElement element, } } serializedAdditionalRawData = rawDataDictionary; - return new NeighborAddress(address, configurationState, serializedAdditionalRawData); + return new NeighborAddress(address, bfdAdministrativeState, bgpAdministrativeState, configurationState, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddress.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddress.cs index 49718d4f4b37..92e42509c100 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddress.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddress.cs @@ -52,17 +52,25 @@ public NeighborAddress() /// Initializes a new instance of . /// IP Address. + /// BFD Administrative State for each Neighbor Address. Example: Enabled | Disabled. + /// BGP Administrative State for each Neighbor Address. Example: Enabled | Disabled. /// Configuration state of the resource. /// Keeps track of any properties unknown to the library. - internal NeighborAddress(string address, NetworkFabricConfigurationState? configurationState, IDictionary serializedAdditionalRawData) + internal NeighborAddress(string address, BfdAdministrativeState? bfdAdministrativeState, BgpAdministrativeState? bgpAdministrativeState, NetworkFabricConfigurationState? configurationState, IDictionary serializedAdditionalRawData) { Address = address; + BfdAdministrativeState = bfdAdministrativeState; + BgpAdministrativeState = bgpAdministrativeState; ConfigurationState = configurationState; _serializedAdditionalRawData = serializedAdditionalRawData; } /// IP Address. public string Address { get; set; } + /// BFD Administrative State for each Neighbor Address. Example: Enabled | Disabled. + public BfdAdministrativeState? BfdAdministrativeState { get; } + /// BGP Administrative State for each Neighbor Address. Example: Enabled | Disabled. + public BgpAdministrativeState? BgpAdministrativeState { get; } /// Configuration state of the resource. public NetworkFabricConfigurationState? ConfigurationState { get; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddressBfdAdministrativeStatus.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddressBfdAdministrativeStatus.Serialization.cs new file mode 100644 index 000000000000..32cd9b300006 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddressBfdAdministrativeStatus.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NeighborAddressBfdAdministrativeStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeighborAddressBfdAdministrativeStatus)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NeighborAddress)) + { + writer.WritePropertyName("neighborAddress"u8); + writer.WriteStringValue(NeighborAddress); + } + if (Optional.IsDefined(AdministrativeState)) + { + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NeighborAddressBfdAdministrativeStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeighborAddressBfdAdministrativeStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeighborAddressBfdAdministrativeStatus(document.RootElement, options); + } + + internal static NeighborAddressBfdAdministrativeStatus DeserializeNeighborAddressBfdAdministrativeStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string neighborAddress = default; + BfdAdministrativeState? administrativeState = default; + string error = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("neighborAddress"u8)) + { + neighborAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("administrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeState = new BfdAdministrativeState(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeighborAddressBfdAdministrativeStatus(neighborAddress, administrativeState, error, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NeighborAddressBfdAdministrativeStatus)} does not support writing '{options.Format}' format."); + } + } + + NeighborAddressBfdAdministrativeStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNeighborAddressBfdAdministrativeStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeighborAddressBfdAdministrativeStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddressBfdAdministrativeStatus.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddressBfdAdministrativeStatus.cs new file mode 100644 index 000000000000..c8672b85e2cd --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddressBfdAdministrativeStatus.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Neighbor Address Bidirectional Forwarding Detection (BFD) Administrative Status. + public partial class NeighborAddressBfdAdministrativeStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal NeighborAddressBfdAdministrativeStatus() + { + } + + /// Initializes a new instance of . + /// NeighborAddress - Input should be either All or Specific Ipv4 Address or Specific Ipv6 Address. + /// BFD Administrative state. + /// Error message. + /// Keeps track of any properties unknown to the library. + internal NeighborAddressBfdAdministrativeStatus(string neighborAddress, BfdAdministrativeState? administrativeState, string error, IDictionary serializedAdditionalRawData) + { + NeighborAddress = neighborAddress; + AdministrativeState = administrativeState; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// NeighborAddress - Input should be either All or Specific Ipv4 Address or Specific Ipv6 Address. + public string NeighborAddress { get; } + /// BFD Administrative state. + public BfdAdministrativeState? AdministrativeState { get; } + /// Error message. + public string Error { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddressBgpAdministrativeStatus.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddressBgpAdministrativeStatus.Serialization.cs new file mode 100644 index 000000000000..6a209bc1aab2 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddressBgpAdministrativeStatus.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NeighborAddressBgpAdministrativeStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeighborAddressBgpAdministrativeStatus)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NeighborAddress)) + { + writer.WritePropertyName("neighborAddress"u8); + writer.WriteStringValue(NeighborAddress); + } + if (Optional.IsDefined(AdministrativeState)) + { + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NeighborAddressBgpAdministrativeStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeighborAddressBgpAdministrativeStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeighborAddressBgpAdministrativeStatus(document.RootElement, options); + } + + internal static NeighborAddressBgpAdministrativeStatus DeserializeNeighborAddressBgpAdministrativeStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string neighborAddress = default; + BgpAdministrativeState? administrativeState = default; + string error = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("neighborAddress"u8)) + { + neighborAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("administrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeState = new BgpAdministrativeState(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeighborAddressBgpAdministrativeStatus(neighborAddress, administrativeState, error, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NeighborAddressBgpAdministrativeStatus)} does not support writing '{options.Format}' format."); + } + } + + NeighborAddressBgpAdministrativeStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNeighborAddressBgpAdministrativeStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeighborAddressBgpAdministrativeStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddressBgpAdministrativeStatus.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddressBgpAdministrativeStatus.cs new file mode 100644 index 000000000000..3600c31231c2 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddressBgpAdministrativeStatus.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Neighbor Address BGP Administrative Status. + public partial class NeighborAddressBgpAdministrativeStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal NeighborAddressBgpAdministrativeStatus() + { + } + + /// Initializes a new instance of . + /// NeighborAddress - Input should be either All or Specific Ipv4 Address or Specific Ipv6 Address. + /// BGP Administrative state. + /// Error message. + /// Keeps track of any properties unknown to the library. + internal NeighborAddressBgpAdministrativeStatus(string neighborAddress, BgpAdministrativeState? administrativeState, string error, IDictionary serializedAdditionalRawData) + { + NeighborAddress = neighborAddress; + AdministrativeState = administrativeState; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// NeighborAddress - Input should be either All or Specific Ipv4 Address or Specific Ipv6 Address. + public string NeighborAddress { get; } + /// BGP Administrative state. + public BgpAdministrativeState? AdministrativeState { get; } + /// Error message. + public string Error { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddressPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddressPatch.Serialization.cs new file mode 100644 index 000000000000..e8fbbc1aa5d8 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddressPatch.Serialization.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NeighborAddressPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeighborAddressPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Address)) + { + writer.WritePropertyName("address"u8); + writer.WriteStringValue(Address); + } + if (options.Format != "W" && Optional.IsDefined(BfdAdministrativeState)) + { + writer.WritePropertyName("bfdAdministrativeState"u8); + writer.WriteStringValue(BfdAdministrativeState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(BgpAdministrativeState)) + { + writer.WritePropertyName("bgpAdministrativeState"u8); + writer.WriteStringValue(BgpAdministrativeState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) + { + writer.WritePropertyName("configurationState"u8); + writer.WriteStringValue(ConfigurationState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NeighborAddressPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeighborAddressPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeighborAddressPatch(document.RootElement, options); + } + + internal static NeighborAddressPatch DeserializeNeighborAddressPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string address = default; + BfdAdministrativeState? bfdAdministrativeState = default; + BgpAdministrativeState? bgpAdministrativeState = default; + NetworkFabricConfigurationState? configurationState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("address"u8)) + { + address = property.Value.GetString(); + continue; + } + if (property.NameEquals("bfdAdministrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bfdAdministrativeState = new BfdAdministrativeState(property.Value.GetString()); + continue; + } + if (property.NameEquals("bgpAdministrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bgpAdministrativeState = new BgpAdministrativeState(property.Value.GetString()); + continue; + } + if (property.NameEquals("configurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configurationState = new NetworkFabricConfigurationState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeighborAddressPatch(address, bfdAdministrativeState, bgpAdministrativeState, configurationState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NeighborAddressPatch)} does not support writing '{options.Format}' format."); + } + } + + NeighborAddressPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNeighborAddressPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeighborAddressPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddressPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddressPatch.cs new file mode 100644 index 000000000000..e54d53d926ff --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborAddressPatch.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Neighbor Address properties. + public partial class NeighborAddressPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NeighborAddressPatch() + { + } + + /// Initializes a new instance of . + /// IP Address. + /// BFD Administrative State for each Neighbor Address. Example: Enabled | Disabled. + /// BGP Administrative State for each Neighbor Address. Example: Enabled | Disabled. + /// Configuration state of the resource. + /// Keeps track of any properties unknown to the library. + internal NeighborAddressPatch(string address, BfdAdministrativeState? bfdAdministrativeState, BgpAdministrativeState? bgpAdministrativeState, NetworkFabricConfigurationState? configurationState, IDictionary serializedAdditionalRawData) + { + Address = address; + BfdAdministrativeState = bfdAdministrativeState; + BgpAdministrativeState = bgpAdministrativeState; + ConfigurationState = configurationState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// IP Address. + public string Address { get; set; } + /// BFD Administrative State for each Neighbor Address. Example: Enabled | Disabled. + public BfdAdministrativeState? BfdAdministrativeState { get; } + /// BGP Administrative State for each Neighbor Address. Example: Enabled | Disabled. + public BgpAdministrativeState? BgpAdministrativeState { get; } + /// Configuration state of the resource. + public NetworkFabricConfigurationState? ConfigurationState { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupDestinationPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupDestinationPatch.Serialization.cs new file mode 100644 index 000000000000..273713383721 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupDestinationPatch.Serialization.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NeighborGroupDestinationPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeighborGroupDestinationPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(IPv4Addresses)) + { + writer.WritePropertyName("ipv4Addresses"u8); + writer.WriteStartArray(); + foreach (var item in IPv4Addresses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(IPv6Addresses)) + { + writer.WritePropertyName("ipv6Addresses"u8); + writer.WriteStartArray(); + foreach (var item in IPv6Addresses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NeighborGroupDestinationPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeighborGroupDestinationPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeighborGroupDestinationPatch(document.RootElement, options); + } + + internal static NeighborGroupDestinationPatch DeserializeNeighborGroupDestinationPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList ipv4Addresses = default; + IList ipv6Addresses = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipv4Addresses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipv4Addresses = array; + continue; + } + if (property.NameEquals("ipv6Addresses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipv6Addresses = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeighborGroupDestinationPatch(ipv4Addresses ?? new ChangeTrackingList(), ipv6Addresses ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NeighborGroupDestinationPatch)} does not support writing '{options.Format}' format."); + } + } + + NeighborGroupDestinationPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNeighborGroupDestinationPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeighborGroupDestinationPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkusListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupDestinationPatch.cs similarity index 67% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkusListResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupDestinationPatch.cs index 50cf9890e492..e0084de6af28 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkusListResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupDestinationPatch.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of Network Fabric SKUs. - internal partial class NetworkFabricSkusListResult + /// An array of destination IPv4 Addresses or IPv6 Addresses. + public partial class NeighborGroupDestinationPatch { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,27 @@ internal partial class NetworkFabricSkusListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal NetworkFabricSkusListResult() + /// Initializes a new instance of . + public NeighborGroupDestinationPatch() { - Value = new ChangeTrackingList(); + IPv4Addresses = new ChangeTrackingList(); + IPv6Addresses = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of Network Fabric SKU resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// Array of IPv4 Addresses. + /// Array of IPv6 Addresses. /// Keeps track of any properties unknown to the library. - internal NetworkFabricSkusListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NeighborGroupDestinationPatch(IList ipv4Addresses, IList ipv6Addresses, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + IPv4Addresses = ipv4Addresses; + IPv6Addresses = ipv6Addresses; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of Network Fabric SKU resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// Array of IPv4 Addresses. + public IList IPv4Addresses { get; } + /// Array of IPv6 Addresses. + public IList IPv6Addresses { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupsListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupListResult.Serialization.cs similarity index 64% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupsListResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupListResult.Serialization.cs index fe00e62050cc..c9266a42ef09 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupsListResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class NeighborGroupsListResult : IUtf8JsonSerializable, IJsonModel + internal partial class NeighborGroupListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NeighborGroupsListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NeighborGroupListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NeighborGroupsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NeighborGroupListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NeighborGroupsListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NeighborGroupListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNeighborGroupsListResult(document.RootElement, options); + return DeserializeNeighborGroupListResult(document.RootElement, options); } - internal static NeighborGroupsListResult DeserializeNeighborGroupsListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static NeighborGroupListResult DeserializeNeighborGroupListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -87,17 +84,13 @@ internal static NeighborGroupsListResult DeserializeNeighborGroupsListResult(Jso return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static NeighborGroupsListResult DeserializeNeighborGroupsListResult(Jso } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +114,38 @@ internal static NeighborGroupsListResult DeserializeNeighborGroupsListResult(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new NeighborGroupsListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NeighborGroupListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(NeighborGroupsListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NeighborGroupListResult)} does not support writing '{options.Format}' format."); } } - NeighborGroupsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NeighborGroupListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNeighborGroupsListResult(document.RootElement, options); + return DeserializeNeighborGroupListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NeighborGroupsListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NeighborGroupListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectsList.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupListResult.cs similarity index 60% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectsList.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupListResult.cs index cda572cd21b2..8e5b7d1a3f45 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectsList.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupListResult.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of Network To Network Interconnects. - internal partial class NetworkToNetworkInterconnectsList + /// The response of a NeighborGroup list operation. + internal partial class NeighborGroupListResult { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +46,35 @@ internal partial class NetworkToNetworkInterconnectsList /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal NetworkToNetworkInterconnectsList() + /// Initializes a new instance of . + /// The NeighborGroup items on this page. + /// is null. + internal NeighborGroupListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } - /// Initializes a new instance of . - /// List of NetworkToNetworkInterconnects resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// The NeighborGroup items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal NetworkToNetworkInterconnectsList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NeighborGroupListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of NetworkToNetworkInterconnects resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// Initializes a new instance of for deserialization. + internal NeighborGroupListResult() + { + } + + /// The NeighborGroup items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AnnotationResourceProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupPatchProperties.Serialization.cs similarity index 64% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AnnotationResourceProperties.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupPatchProperties.Serialization.cs index 324512cb0640..1ef0b5eb0c70 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AnnotationResourceProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupPatchProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - public partial class AnnotationResourceProperties : IUtf8JsonSerializable, IJsonModel + public partial class NeighborGroupPatchProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AnnotationResourceProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NeighborGroupPatchProperties)} does not support writing '{format}' format."); } if (Optional.IsDefined(Annotation)) @@ -39,6 +39,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("annotation"u8); writer.WriteStringValue(Annotation); } + if (Optional.IsDefined(Destination)) + { + writer.WritePropertyName("destination"u8); + writer.WriteObjectValue(Destination, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -56,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AnnotationResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NeighborGroupPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AnnotationResourceProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NeighborGroupPatchProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAnnotationResourceProperties(document.RootElement, options); + return DeserializeNeighborGroupPatchProperties(document.RootElement, options); } - internal static AnnotationResourceProperties DeserializeAnnotationResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static NeighborGroupPatchProperties DeserializeNeighborGroupPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -77,6 +82,7 @@ internal static AnnotationResourceProperties DeserializeAnnotationResourceProper return null; } string annotation = default; + NeighborGroupDestinationPatch destination = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -86,44 +92,53 @@ internal static AnnotationResourceProperties DeserializeAnnotationResourceProper annotation = property.Value.GetString(); continue; } + if (property.NameEquals("destination"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + destination = NeighborGroupDestinationPatch.DeserializeNeighborGroupDestinationPatch(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new AnnotationResourceProperties(annotation, serializedAdditionalRawData); + return new NeighborGroupPatchProperties(annotation, destination, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(AnnotationResourceProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NeighborGroupPatchProperties)} does not support writing '{options.Format}' format."); } } - AnnotationResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NeighborGroupPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAnnotationResourceProperties(document.RootElement, options); + return DeserializeNeighborGroupPatchProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AnnotationResourceProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NeighborGroupPatchProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulesListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupPatchProperties.cs similarity index 67% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulesListResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupPatchProperties.cs index e87c54251d40..32238568bf99 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulesListResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupPatchProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of NetworkTapRules. - internal partial class NetworkTapRulesListResult + /// Neighbor Group Patch properties. + public partial class NeighborGroupPatchProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,25 @@ internal partial class NetworkTapRulesListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal NetworkTapRulesListResult() + /// Initializes a new instance of . + public NeighborGroupPatchProperties() { - Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of NetworkTapRule resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// Switch configuration description. + /// An array of destination IPv4 Addresses or IPv6 Addresses. /// Keeps track of any properties unknown to the library. - internal NetworkTapRulesListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NeighborGroupPatchProperties(string annotation, NeighborGroupDestinationPatch destination, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + Annotation = annotation; + Destination = destination; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of NetworkTapRule resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// Switch configuration description. + public string Annotation { get; set; } + /// An array of destination IPv4 Addresses or IPv6 Addresses. + public NeighborGroupDestinationPatch Destination { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupProperties.Serialization.cs new file mode 100644 index 000000000000..230360e8f23c --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupProperties.Serialization.cs @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NeighborGroupProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeighborGroupProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + writer.WritePropertyName("destination"u8); + writer.WriteObjectValue(Destination, options); + if (options.Format != "W" && Optional.IsCollectionDefined(NetworkTapIds)) + { + writer.WritePropertyName("networkTapIds"u8); + writer.WriteStartArray(); + foreach (var item in NetworkTapIds) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(NetworkTapRuleIds)) + { + writer.WritePropertyName("networkTapRuleIds"u8); + writer.WriteStartArray(); + foreach (var item in NetworkTapRuleIds) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NeighborGroupProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeighborGroupProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeighborGroupProperties(document.RootElement, options); + } + + internal static NeighborGroupProperties DeserializeNeighborGroupProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + NeighborGroupDestination destination = default; + IReadOnlyList networkTapIds = default; + IReadOnlyList networkTapRuleIds = default; + LastOperationProperties lastOperation = default; + NetworkFabricProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("destination"u8)) + { + destination = NeighborGroupDestination.DeserializeNeighborGroupDestination(property.Value, options); + continue; + } + if (property.NameEquals("networkTapIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + networkTapIds = array; + continue; + } + if (property.NameEquals("networkTapRuleIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + networkTapRuleIds = array; + continue; + } + if (property.NameEquals("lastOperation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NetworkFabricProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeighborGroupProperties( + annotation, + destination, + networkTapIds ?? new ChangeTrackingList(), + networkTapRuleIds ?? new ChangeTrackingList(), + lastOperation, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NeighborGroupProperties)} does not support writing '{options.Format}' format."); + } + } + + NeighborGroupProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNeighborGroupProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeighborGroupProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupProperties.cs new file mode 100644 index 000000000000..16e8ee60928b --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupProperties.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Neighbor Group Properties defines the properties of the resource. + public partial class NeighborGroupProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// An array of destination IPv4 Addresses or IPv6 Addresses. + /// is null. + public NeighborGroupProperties(NeighborGroupDestination destination) + { + Argument.AssertNotNull(destination, nameof(destination)); + + Destination = destination; + NetworkTapIds = new ChangeTrackingList(); + NetworkTapRuleIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// An array of destination IPv4 Addresses or IPv6 Addresses. + /// List of NetworkTap IDs where neighbor group is associated. + /// List of Network Tap Rule IDs where neighbor group is associated. + /// Details of the last operation performed on the resource. + /// The provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal NeighborGroupProperties(string annotation, NeighborGroupDestination destination, IReadOnlyList networkTapIds, IReadOnlyList networkTapRuleIds, LastOperationProperties lastOperation, NetworkFabricProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + Destination = destination; + NetworkTapIds = networkTapIds; + NetworkTapRuleIds = networkTapRuleIds; + LastOperation = lastOperation; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NeighborGroupProperties() + { + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// An array of destination IPv4 Addresses or IPv6 Addresses. + public NeighborGroupDestination Destination { get; set; } + /// List of NetworkTap IDs where neighbor group is associated. + public IReadOnlyList NetworkTapIds { get; } + /// List of Network Tap Rule IDs where neighbor group is associated. + public IReadOnlyList NetworkTapRuleIds { get; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + + /// The provisioning state of the resource. + public NetworkFabricProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceAdministrativeState.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceAdministrativeState.cs index 5766fe40c699..2ec81ebe586c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceAdministrativeState.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceAdministrativeState.cs @@ -23,18 +23,33 @@ public NetworkDeviceAdministrativeState(string value) } private const string RmaValue = "RMA"; + private const string UngracefulRmaValue = "UngracefulRMA"; private const string ResyncValue = "Resync"; private const string GracefulQuarantineValue = "GracefulQuarantine"; + private const string UngracefulQuarantineValue = "UngracefulQuarantine"; private const string QuarantineValue = "Quarantine"; + private const string UnderMaintenanceValue = "UnderMaintenance"; + private const string EnableValue = "Enable"; + private const string DisableValue = "Disable"; - /// RMA. + /// Device AdministrativeState-RMA. public static NetworkDeviceAdministrativeState Rma { get; } = new NetworkDeviceAdministrativeState(RmaValue); - /// Resync. + /// Device AdministrativeState-RMA(Return Material Authorization) Ungraceful. + public static NetworkDeviceAdministrativeState UngracefulRma { get; } = new NetworkDeviceAdministrativeState(UngracefulRmaValue); + /// Device AdministrativeState-Resync. public static NetworkDeviceAdministrativeState Resync { get; } = new NetworkDeviceAdministrativeState(ResyncValue); - /// GracefulQuarantine. + /// Device AdministrativeState-GracefulQuarantine. public static NetworkDeviceAdministrativeState GracefulQuarantine { get; } = new NetworkDeviceAdministrativeState(GracefulQuarantineValue); - /// Quarantine. + /// Device AdministrativeState-UngracefulQuarantine. + public static NetworkDeviceAdministrativeState UngracefulQuarantine { get; } = new NetworkDeviceAdministrativeState(UngracefulQuarantineValue); + /// Device AdministrativeState-Quarantine. public static NetworkDeviceAdministrativeState Quarantine { get; } = new NetworkDeviceAdministrativeState(QuarantineValue); + /// Device AdministrativeState-UnderMaintenance. + public static NetworkDeviceAdministrativeState UnderMaintenance { get; } = new NetworkDeviceAdministrativeState(UnderMaintenanceValue); + /// Device AdministrativeState-Enable. + public static NetworkDeviceAdministrativeState Enable { get; } = new NetworkDeviceAdministrativeState(EnableValue); + /// Device AdministrativeState-Disable. + public static NetworkDeviceAdministrativeState Disable { get; } = new NetworkDeviceAdministrativeState(DisableValue); /// Determines if two values are the same. public static bool operator ==(NetworkDeviceAdministrativeState left, NetworkDeviceAdministrativeState right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceInterfacePatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceInterfacePatch.Serialization.cs index e72d9bb57085..ec9a2774faca 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceInterfacePatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceInterfacePatch.Serialization.cs @@ -34,14 +34,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(NetworkDeviceInterfacePatch)} does not support writing '{format}' format."); } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -79,7 +76,7 @@ internal static NetworkDeviceInterfacePatch DeserializeNetworkDeviceInterfacePat { return null; } - string annotation = default; + NetworkInterfacePatchProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -88,17 +85,9 @@ internal static NetworkDeviceInterfacePatch DeserializeNetworkDeviceInterfacePat { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - } + properties = NetworkInterfacePatchProperties.DeserializeNetworkInterfacePatchProperties(property.Value, options); continue; } if (options.Format != "W") @@ -107,7 +96,7 @@ internal static NetworkDeviceInterfacePatch DeserializeNetworkDeviceInterfacePat } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkDeviceInterfacePatch(annotation, serializedAdditionalRawData); + return new NetworkDeviceInterfacePatch(properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceInterfacePatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceInterfacePatch.cs index b0f6a19b4b0a..53a83d28c21c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceInterfacePatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceInterfacePatch.cs @@ -51,15 +51,15 @@ public NetworkDeviceInterfacePatch() } /// Initializes a new instance of . - /// Switch configuration description. + /// Network Interface Patch properties. /// Keeps track of any properties unknown to the library. - internal NetworkDeviceInterfacePatch(string annotation, IDictionary serializedAdditionalRawData) + internal NetworkDeviceInterfacePatch(NetworkInterfacePatchProperties properties, IDictionary serializedAdditionalRawData) { - Annotation = annotation; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Switch configuration description. - public string Annotation { get; set; } + /// Network Interface Patch properties. + public NetworkInterfacePatchProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceInterfaceType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceInterfaceType.cs index d44b68357760..4094ff78bd6e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceInterfaceType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceInterfaceType.cs @@ -25,9 +25,9 @@ public NetworkDeviceInterfaceType(string value) private const string ManagementValue = "Management"; private const string DataValue = "Data"; - /// Management. + /// InterfaceType-Management. public static NetworkDeviceInterfaceType Management { get; } = new NetworkDeviceInterfaceType(ManagementValue); - /// Data. + /// InterfaceType-Data. public static NetworkDeviceInterfaceType Data { get; } = new NetworkDeviceInterfaceType(DataValue); /// Determines if two values are the same. public static bool operator ==(NetworkDeviceInterfaceType left, NetworkDeviceInterfaceType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunitiesListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceListResult.Serialization.cs similarity index 67% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunitiesListResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceListResult.Serialization.cs index acb25471a189..feaa35f7acdf 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPCommunitiesListResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class IPCommunitiesListResult : IUtf8JsonSerializable, IJsonModel + internal partial class NetworkDeviceListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IPCommunitiesListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NetworkDeviceListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - IPCommunitiesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NetworkDeviceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IPCommunitiesListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NetworkDeviceListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeIPCommunitiesListResult(document.RootElement, options); + return DeserializeNetworkDeviceListResult(document.RootElement, options); } - internal static IPCommunitiesListResult DeserializeIPCommunitiesListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static NetworkDeviceListResult DeserializeNetworkDeviceListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,29 +83,29 @@ internal static IPCommunitiesListResult DeserializeIPCommunitiesListResult(JsonE { return null; } - IReadOnlyList value = default; - string nextLink = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(NetworkFabricIPCommunityData.DeserializeNetworkFabricIPCommunityData(item, options)); + array.Add(NetworkDeviceData.DeserializeNetworkDeviceData(item, options)); } value = array; continue; } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +114,38 @@ internal static IPCommunitiesListResult DeserializeIPCommunitiesListResult(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new IPCommunitiesListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NetworkDeviceListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(IPCommunitiesListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkDeviceListResult)} does not support writing '{options.Format}' format."); } } - IPCommunitiesListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NetworkDeviceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeIPCommunitiesListResult(document.RootElement, options); + return DeserializeNetworkDeviceListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(IPCommunitiesListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkDeviceListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceListResult.cs new file mode 100644 index 000000000000..7a0748b1505d --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a NetworkDevice list operation. + internal partial class NetworkDeviceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The NetworkDevice items on this page. + /// is null. + internal NetworkDeviceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The NetworkDevice items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NetworkDeviceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkDeviceListResult() + { + } + + /// The NetworkDevice items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicePatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicePatch.Serialization.cs index ae39a530965d..464b587be5eb 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicePatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicePatch.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,25 +34,37 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(NetworkDevicePatch)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) + if (Optional.IsCollectionDefined(Tags)) { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); } - if (Optional.IsDefined(HostName)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("hostName"u8); - writer.WriteStringValue(HostName); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - if (Optional.IsDefined(SerialNumber)) + if (options.Format != "W" && _serializedAdditionalRawData != null) { - writer.WritePropertyName("serialNumber"u8); - writer.WriteStringValue(SerialNumber); + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } } - writer.WriteEndObject(); } NetworkDevicePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -76,9 +88,7 @@ internal static NetworkDevicePatch DeserializeNetworkDevicePatch(JsonElement ele return null; } IDictionary tags = default; - string annotation = default; - string hostName = default; - string serialNumber = default; + NetworkDevicePatchParametersProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -101,27 +111,9 @@ internal static NetworkDevicePatch DeserializeNetworkDevicePatch(JsonElement ele { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("hostName"u8)) - { - hostName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("serialNumber"u8)) - { - serialNumber = property0.Value.GetString(); - continue; - } - } + properties = NetworkDevicePatchParametersProperties.DeserializeNetworkDevicePatchParametersProperties(property.Value, options); continue; } if (options.Format != "W") @@ -130,7 +122,7 @@ internal static NetworkDevicePatch DeserializeNetworkDevicePatch(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkDevicePatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, annotation, hostName, serialNumber); + return new NetworkDevicePatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicePatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicePatch.cs index 9de7f3015ecc..2deb8d48e706 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicePatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicePatch.cs @@ -11,31 +11,60 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// The Network Device Patch Parameters defines the patch parameters of the resource. - public partial class NetworkDevicePatch : NetworkRackPatch + public partial class NetworkDevicePatch { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public NetworkDevicePatch() { + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Resource tags. + /// Network Device Patch properties. /// Keeps track of any properties unknown to the library. - /// Switch configuration description. - /// The host name of the device. - /// Serial number of the device. Format of serial Number - Make;Model;HardwareRevisionId;SerialNumber. - internal NetworkDevicePatch(IDictionary tags, IDictionary serializedAdditionalRawData, string annotation, string hostName, string serialNumber) : base(tags, serializedAdditionalRawData) + internal NetworkDevicePatch(IDictionary tags, NetworkDevicePatchParametersProperties properties, IDictionary serializedAdditionalRawData) { - Annotation = annotation; - HostName = hostName; - SerialNumber = serialNumber; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Switch configuration description. - public string Annotation { get; set; } - /// The host name of the device. - public string HostName { get; set; } - /// Serial number of the device. Format of serial Number - Make;Model;HardwareRevisionId;SerialNumber. - public string SerialNumber { get; set; } + /// Resource tags. + public IDictionary Tags { get; } + /// Network Device Patch properties. + public NetworkDevicePatchParametersProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicePatchParametersProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicePatchParametersProperties.Serialization.cs new file mode 100644 index 000000000000..10bb46f65f95 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicePatchParametersProperties.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkDevicePatchParametersProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkDevicePatchParametersProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (Optional.IsDefined(HostName)) + { + writer.WritePropertyName("hostName"u8); + writer.WriteStringValue(HostName); + } + if (Optional.IsDefined(SerialNumber)) + { + writer.WritePropertyName("serialNumber"u8); + writer.WriteStringValue(SerialNumber); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkDevicePatchParametersProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkDevicePatchParametersProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkDevicePatchParametersProperties(document.RootElement, options); + } + + internal static NetworkDevicePatchParametersProperties DeserializeNetworkDevicePatchParametersProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + string hostName = default; + string serialNumber = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("hostName"u8)) + { + hostName = property.Value.GetString(); + continue; + } + if (property.NameEquals("serialNumber"u8)) + { + serialNumber = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkDevicePatchParametersProperties(annotation, hostName, serialNumber, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkDevicePatchParametersProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkDevicePatchParametersProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkDevicePatchParametersProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkDevicePatchParametersProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicePatchParametersProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicePatchParametersProperties.cs new file mode 100644 index 000000000000..a40819b159cd --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicePatchParametersProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Network Device Patch properties. + public partial class NetworkDevicePatchParametersProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NetworkDevicePatchParametersProperties() + { + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// The host name of the device. + /// Serial number of the device. Format of serial Number - Make;Model;HardwareRevisionId;SerialNumber. + /// Keeps track of any properties unknown to the library. + internal NetworkDevicePatchParametersProperties(string annotation, string hostName, string serialNumber, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + HostName = hostName; + SerialNumber = serialNumber; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// The host name of the device. + public string HostName { get; set; } + /// Serial number of the device. Format of serial Number - Make;Model;HardwareRevisionId;SerialNumber. + public string SerialNumber { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceRebootType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceRebootType.cs index 91d5fa52d615..458bbb6878e6 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceRebootType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceRebootType.cs @@ -27,13 +27,13 @@ public NetworkDeviceRebootType(string value) private const string UngracefulRebootWithZtpValue = "UngracefulRebootWithZTP"; private const string UngracefulRebootWithoutZtpValue = "UngracefulRebootWithoutZTP"; - /// GracefulRebootWithZTP. + /// RebootType GracefulRebootWithZTP. public static NetworkDeviceRebootType GracefulRebootWithZtp { get; } = new NetworkDeviceRebootType(GracefulRebootWithZtpValue); - /// GracefulRebootWithoutZTP. + /// RebootType GracefulRebootWithoutZTP. public static NetworkDeviceRebootType GracefulRebootWithoutZtp { get; } = new NetworkDeviceRebootType(GracefulRebootWithoutZtpValue); - /// UngracefulRebootWithZTP. + /// RebootType UngracefulRebootWithZTP. public static NetworkDeviceRebootType UngracefulRebootWithZtp { get; } = new NetworkDeviceRebootType(UngracefulRebootWithZtpValue); - /// UngracefulRebootWithoutZTP. + /// RebootType UngracefulRebootWithoutZTP. public static NetworkDeviceRebootType UngracefulRebootWithoutZtp { get; } = new NetworkDeviceRebootType(UngracefulRebootWithoutZtpValue); /// Determines if two values are the same. public static bool operator ==(NetworkDeviceRebootType left, NetworkDeviceRebootType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceRole.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceRole.cs index 235469ef7f6a..98b7bbbf45af 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceRole.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceRole.cs @@ -28,15 +28,15 @@ public NetworkDeviceRole(string value) private const string TSValue = "TS"; private const string ManagementValue = "Management"; - /// CE. + /// NetworkDeviceRole-CE(Customer Edge). public static NetworkDeviceRole CE { get; } = new NetworkDeviceRole(CEValue); - /// ToR. + /// NetworkDeviceRole-ToR(top of rack). public static NetworkDeviceRole ToR { get; } = new NetworkDeviceRole(ToRValue); - /// NPB. + /// NetworkDeviceRole-NPB(Network Packet Broker). public static NetworkDeviceRole Npb { get; } = new NetworkDeviceRole(NpbValue); - /// TS. + /// NetworkDeviceRole-TS(Terminal Server). public static NetworkDeviceRole TS { get; } = new NetworkDeviceRole(TSValue); - /// Management. + /// NetworkDeviceRole-Management. public static NetworkDeviceRole Management { get; } = new NetworkDeviceRole(ManagementValue); /// Determines if two values are the same. public static bool operator ==(NetworkDeviceRole left, NetworkDeviceRole right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceRoleName.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceRoleName.cs index 3c0813f4dee9..44c3442c217c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceRoleName.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceRoleName.cs @@ -28,15 +28,15 @@ public NetworkDeviceRoleName(string value) private const string TSValue = "TS"; private const string ManagementValue = "Management"; - /// CE. + /// NetworkDeviceRoleName-CE(Customer Edge). public static NetworkDeviceRoleName CE { get; } = new NetworkDeviceRoleName(CEValue); - /// ToR. + /// NetworkDeviceRoleName-ToR(top of rack). public static NetworkDeviceRoleName ToR { get; } = new NetworkDeviceRoleName(ToRValue); - /// NPB. + /// NetworkDeviceRoleName-NPB(Network Packet Broker). public static NetworkDeviceRoleName Npb { get; } = new NetworkDeviceRoleName(NpbValue); - /// TS. + /// NetworkDeviceRoleName-TS(Terminal Server). public static NetworkDeviceRoleName TS { get; } = new NetworkDeviceRoleName(TSValue); - /// Management. + /// NetworkDeviceRoleName-Management. public static NetworkDeviceRoleName Management { get; } = new NetworkDeviceRoleName(ManagementValue); /// Determines if two values are the same. public static bool operator ==(NetworkDeviceRoleName left, NetworkDeviceRoleName right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewaysListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceSkuListResult.Serialization.cs similarity index 65% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewaysListResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceSkuListResult.Serialization.cs index a231a2233ecf..7a88a8aa47be 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/InternetGatewaysListResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceSkuListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class InternetGatewaysListResult : IUtf8JsonSerializable, IJsonModel + internal partial class NetworkDeviceSkuListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InternetGatewaysListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NetworkDeviceSkuListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - InternetGatewaysListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NetworkDeviceSkuListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InternetGatewaysListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NetworkDeviceSkuListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternetGatewaysListResult(document.RootElement, options); + return DeserializeNetworkDeviceSkuListResult(document.RootElement, options); } - internal static InternetGatewaysListResult DeserializeInternetGatewaysListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static NetworkDeviceSkuListResult DeserializeNetworkDeviceSkuListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,29 +83,29 @@ internal static InternetGatewaysListResult DeserializeInternetGatewaysListResult { return null; } - IReadOnlyList value = default; - string nextLink = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(NetworkFabricInternetGatewayData.DeserializeNetworkFabricInternetGatewayData(item, options)); + array.Add(NetworkDeviceSkuData.DeserializeNetworkDeviceSkuData(item, options)); } value = array; continue; } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +114,38 @@ internal static InternetGatewaysListResult DeserializeInternetGatewaysListResult } } serializedAdditionalRawData = rawDataDictionary; - return new InternetGatewaysListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NetworkDeviceSkuListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(InternetGatewaysListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkDeviceSkuListResult)} does not support writing '{options.Format}' format."); } } - InternetGatewaysListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NetworkDeviceSkuListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeInternetGatewaysListResult(document.RootElement, options); + return DeserializeNetworkDeviceSkuListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(InternetGatewaysListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkDeviceSkuListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceSkuListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceSkuListResult.cs new file mode 100644 index 000000000000..c402485c1585 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceSkuListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a NetworkDeviceSku list operation. + internal partial class NetworkDeviceSkuListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The NetworkDeviceSku items on this page. + /// is null. + internal NetworkDeviceSkuListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The NetworkDeviceSku items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NetworkDeviceSkuListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkDeviceSkuListResult() + { + } + + /// The NetworkDeviceSku items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListPatch.Serialization.cs index 3c1f199b0fc9..fe35807250d4 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListPatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListPatch.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,50 +34,37 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(NetworkFabricAccessControlListPatch)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(ConfigurationType)) - { - writer.WritePropertyName("configurationType"u8); - writer.WriteStringValue(ConfigurationType.Value.ToString()); - } - if (Optional.IsDefined(AclsUri)) - { - writer.WritePropertyName("aclsUrl"u8); - writer.WriteStringValue(AclsUri.AbsoluteUri); - } - if (Optional.IsDefined(DefaultAction)) + if (Optional.IsCollectionDefined(Tags)) { - writer.WritePropertyName("defaultAction"u8); - writer.WriteStringValue(DefaultAction.Value.ToString()); - } - if (Optional.IsCollectionDefined(MatchConfigurations)) - { - writer.WritePropertyName("matchConfigurations"u8); - writer.WriteStartArray(); - foreach (var item in MatchConfigurations) + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) { - writer.WriteObjectValue(item, options); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } - writer.WriteEndArray(); + writer.WriteEndObject(); } - if (Optional.IsCollectionDefined(DynamicMatchConfigurations)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("dynamicMatchConfigurations"u8); - writer.WriteStartArray(); - foreach (var item in DynamicMatchConfigurations) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - if (Optional.IsDefined(Annotation)) + if (options.Format != "W" && _serializedAdditionalRawData != null) { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } } - writer.WriteEndObject(); } NetworkFabricAccessControlListPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -101,12 +88,7 @@ internal static NetworkFabricAccessControlListPatch DeserializeNetworkFabricAcce return null; } IDictionary tags = default; - NetworkFabricConfigurationType? configurationType = default; - Uri aclsUrl = default; - CommunityActionType? defaultAction = default; - IList matchConfigurations = default; - IList dynamicMatchConfigurations = default; - string annotation = default; + AccessControlListPatchProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -129,72 +111,9 @@ internal static NetworkFabricAccessControlListPatch DeserializeNetworkFabricAcce { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("configurationType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - configurationType = new NetworkFabricConfigurationType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("aclsUrl"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - aclsUrl = new Uri(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("defaultAction"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - defaultAction = new CommunityActionType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("matchConfigurations"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(AccessControlListMatchConfiguration.DeserializeAccessControlListMatchConfiguration(item, options)); - } - matchConfigurations = array; - continue; - } - if (property0.NameEquals("dynamicMatchConfigurations"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(CommonDynamicMatchConfiguration.DeserializeCommonDynamicMatchConfiguration(item, options)); - } - dynamicMatchConfigurations = array; - continue; - } - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - } + properties = AccessControlListPatchProperties.DeserializeAccessControlListPatchProperties(property.Value, options); continue; } if (options.Format != "W") @@ -203,15 +122,7 @@ internal static NetworkFabricAccessControlListPatch DeserializeNetworkFabricAcce } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkFabricAccessControlListPatch( - tags ?? new ChangeTrackingDictionary(), - serializedAdditionalRawData, - configurationType, - aclsUrl, - defaultAction, - matchConfigurations ?? new ChangeTrackingList(), - dynamicMatchConfigurations ?? new ChangeTrackingList(), - annotation); + return new NetworkFabricAccessControlListPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListPatch.cs index 343881510a6f..5afd815bf1a3 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAccessControlListPatch.cs @@ -11,45 +11,60 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// The Access Control Lists patch resource definition. - public partial class NetworkFabricAccessControlListPatch : NetworkRackPatch + public partial class NetworkFabricAccessControlListPatch { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public NetworkFabricAccessControlListPatch() { - MatchConfigurations = new ChangeTrackingList(); - DynamicMatchConfigurations = new ChangeTrackingList(); + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Resource tags. + /// Access Control Lists patch properties. /// Keeps track of any properties unknown to the library. - /// Input method to configure Access Control List. - /// Access Control List file URL. - /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. - /// List of match configurations. - /// List of dynamic match configurations. - /// Switch configuration description. - internal NetworkFabricAccessControlListPatch(IDictionary tags, IDictionary serializedAdditionalRawData, NetworkFabricConfigurationType? configurationType, Uri aclsUri, CommunityActionType? defaultAction, IList matchConfigurations, IList dynamicMatchConfigurations, string annotation) : base(tags, serializedAdditionalRawData) + internal NetworkFabricAccessControlListPatch(IDictionary tags, AccessControlListPatchProperties properties, IDictionary serializedAdditionalRawData) { - ConfigurationType = configurationType; - AclsUri = aclsUri; - DefaultAction = defaultAction; - MatchConfigurations = matchConfigurations; - DynamicMatchConfigurations = dynamicMatchConfigurations; - Annotation = annotation; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Input method to configure Access Control List. - public NetworkFabricConfigurationType? ConfigurationType { get; set; } - /// Access Control List file URL. - public Uri AclsUri { get; set; } - /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. - public CommunityActionType? DefaultAction { get; set; } - /// List of match configurations. - public IList MatchConfigurations { get; } - /// List of dynamic match configurations. - public IList DynamicMatchConfigurations { get; } - /// Switch configuration description. - public string Annotation { get; set; } + /// Resource tags. + public IDictionary Tags { get; } + /// Access Control Lists patch properties. + public AccessControlListPatchProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAdministrativeState.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAdministrativeState.cs index f6824d9c7929..9ca6425ae77a 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAdministrativeState.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricAdministrativeState.cs @@ -26,15 +26,18 @@ public NetworkFabricAdministrativeState(string value) private const string DisabledValue = "Disabled"; private const string MatValue = "MAT"; private const string RmaValue = "RMA"; + private const string UnderMaintenanceValue = "UnderMaintenance"; - /// Enabled. + /// Enabled Administrative State. public static NetworkFabricAdministrativeState Enabled { get; } = new NetworkFabricAdministrativeState(EnabledValue); - /// Disabled. + /// Disabled Administrative State. public static NetworkFabricAdministrativeState Disabled { get; } = new NetworkFabricAdministrativeState(DisabledValue); - /// MAT. + /// MAT(Manual Action Taken) Administrative State. public static NetworkFabricAdministrativeState Mat { get; } = new NetworkFabricAdministrativeState(MatValue); - /// RMA. + /// RMA(Return Material Authorization) Administrative State. public static NetworkFabricAdministrativeState Rma { get; } = new NetworkFabricAdministrativeState(RmaValue); + /// UnderMaintenance Administrative State. + public static NetworkFabricAdministrativeState UnderMaintenance { get; } = new NetworkFabricAdministrativeState(UnderMaintenanceValue); /// Determines if two values are the same. public static bool operator ==(NetworkFabricAdministrativeState left, NetworkFabricAdministrativeState right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricBooleanValue.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricBooleanValue.cs index 0964a002bd33..51096795b899 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricBooleanValue.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricBooleanValue.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// Boolean Enum. Example- True/False. + /// Boolean union. Example- True/False. public readonly partial struct NetworkFabricBooleanValue : IEquatable { private readonly string _value; @@ -25,9 +25,9 @@ public NetworkFabricBooleanValue(string value) private const string TrueValue = "True"; private const string FalseValue = "False"; - /// True. + /// EnumProperty-True. public static NetworkFabricBooleanValue True { get; } = new NetworkFabricBooleanValue(TrueValue); - /// False. + /// EnumProperty-False. public static NetworkFabricBooleanValue False { get; } = new NetworkFabricBooleanValue(FalseValue); /// Determines if two values are the same. public static bool operator ==(NetworkFabricBooleanValue left, NetworkFabricBooleanValue right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricConfigurationState.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricConfigurationState.cs index 6e48406a27f7..2e5b33156f1e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricConfigurationState.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricConfigurationState.cs @@ -32,27 +32,33 @@ public NetworkFabricConfigurationState(string value) private const string DeprovisionedValue = "Deprovisioned"; private const string ErrorDeprovisioningValue = "ErrorDeprovisioning"; private const string DeferredControlValue = "DeferredControl"; + private const string ProvisioningValue = "Provisioning"; + private const string PendingCommitValue = "PendingCommit"; - /// Succeeded. + /// Success Configuration State. public static NetworkFabricConfigurationState Succeeded { get; } = new NetworkFabricConfigurationState(SucceededValue); - /// Failed. + /// Failed Configuration State. public static NetworkFabricConfigurationState Failed { get; } = new NetworkFabricConfigurationState(FailedValue); - /// Rejected. + /// Rejected Configuration State. public static NetworkFabricConfigurationState Rejected { get; } = new NetworkFabricConfigurationState(RejectedValue); - /// Accepted. + /// Accepted Configuration State. public static NetworkFabricConfigurationState Accepted { get; } = new NetworkFabricConfigurationState(AcceptedValue); - /// Provisioned. + /// Provisioned Configuration State. public static NetworkFabricConfigurationState Provisioned { get; } = new NetworkFabricConfigurationState(ProvisionedValue); - /// ErrorProvisioning. + /// ErrorProvisioning Configuration State. public static NetworkFabricConfigurationState ErrorProvisioning { get; } = new NetworkFabricConfigurationState(ErrorProvisioningValue); - /// Deprovisioning. + /// Deprovisioning Configuration State. public static NetworkFabricConfigurationState Deprovisioning { get; } = new NetworkFabricConfigurationState(DeprovisioningValue); - /// Deprovisioned. + /// Deprovisioned Configuration State. public static NetworkFabricConfigurationState Deprovisioned { get; } = new NetworkFabricConfigurationState(DeprovisionedValue); - /// ErrorDeprovisioning. + /// ErrorDeprovisioning Configuration State. public static NetworkFabricConfigurationState ErrorDeprovisioning { get; } = new NetworkFabricConfigurationState(ErrorDeprovisioningValue); - /// DeferredControl. + /// DeferredControl Configuration State. public static NetworkFabricConfigurationState DeferredControl { get; } = new NetworkFabricConfigurationState(DeferredControlValue); + /// Provisioning Configuration State. + public static NetworkFabricConfigurationState Provisioning { get; } = new NetworkFabricConfigurationState(ProvisioningValue); + /// PendingCommit Configuration State. + public static NetworkFabricConfigurationState PendingCommit { get; } = new NetworkFabricConfigurationState(PendingCommitValue); /// Determines if two values are the same. public static bool operator ==(NetworkFabricConfigurationState left, NetworkFabricConfigurationState right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricConfigurationType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricConfigurationType.cs index 4fb32878f742..a9c258256a81 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricConfigurationType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricConfigurationType.cs @@ -25,9 +25,9 @@ public NetworkFabricConfigurationType(string value) private const string FileValue = "File"; private const string InlineValue = "Inline"; - /// File. + /// File Configuration Type. public static NetworkFabricConfigurationType File { get; } = new NetworkFabricConfigurationType(FileValue); - /// Inline. + /// Inline Configuration Type. public static NetworkFabricConfigurationType Inline { get; } = new NetworkFabricConfigurationType(InlineValue); /// Determines if two values are the same. public static bool operator ==(NetworkFabricConfigurationType left, NetworkFabricConfigurationType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllersListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerListResult.Serialization.cs similarity index 63% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllersListResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerListResult.Serialization.cs index 7e9c8d190fb4..d7f4b1b15af4 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllersListResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class NetworkFabricControllersListResult : IUtf8JsonSerializable, IJsonModel + internal partial class NetworkFabricControllerListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkFabricControllersListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NetworkFabricControllerListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NetworkFabricControllersListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NetworkFabricControllerListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkFabricControllersListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NetworkFabricControllerListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkFabricControllersListResult(document.RootElement, options); + return DeserializeNetworkFabricControllerListResult(document.RootElement, options); } - internal static NetworkFabricControllersListResult DeserializeNetworkFabricControllersListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static NetworkFabricControllerListResult DeserializeNetworkFabricControllerListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -87,17 +84,13 @@ internal static NetworkFabricControllersListResult DeserializeNetworkFabricContr return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static NetworkFabricControllersListResult DeserializeNetworkFabricContr } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +114,38 @@ internal static NetworkFabricControllersListResult DeserializeNetworkFabricContr } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkFabricControllersListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NetworkFabricControllerListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(NetworkFabricControllersListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkFabricControllerListResult)} does not support writing '{options.Format}' format."); } } - NetworkFabricControllersListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NetworkFabricControllerListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkFabricControllersListResult(document.RootElement, options); + return DeserializeNetworkFabricControllerListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NetworkFabricControllersListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkFabricControllerListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerListResult.cs new file mode 100644 index 000000000000..0da6835e8611 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a NetworkFabricController list operation. + internal partial class NetworkFabricControllerListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The NetworkFabricController items on this page. + /// is null. + internal NetworkFabricControllerListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The NetworkFabricController items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NetworkFabricControllerListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkFabricControllerListResult() + { + } + + /// The NetworkFabricController items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerPatch.Serialization.cs index 7edf329a50d4..9f9f4f2b155f 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerPatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerPatch.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,30 +34,37 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(NetworkFabricControllerPatch)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(InfrastructureExpressRouteConnections)) + if (Optional.IsCollectionDefined(Tags)) { - writer.WritePropertyName("infrastructureExpressRouteConnections"u8); - writer.WriteStartArray(); - foreach (var item in InfrastructureExpressRouteConnections) + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) { - writer.WriteObjectValue(item, options); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } - writer.WriteEndArray(); + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - if (Optional.IsCollectionDefined(WorkloadExpressRouteConnections)) + if (options.Format != "W" && _serializedAdditionalRawData != null) { - writer.WritePropertyName("workloadExpressRouteConnections"u8); - writer.WriteStartArray(); - foreach (var item in WorkloadExpressRouteConnections) + foreach (var item in _serializedAdditionalRawData) { - writer.WriteObjectValue(item, options); + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif } - writer.WriteEndArray(); } - writer.WriteEndObject(); } NetworkFabricControllerPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -81,8 +88,7 @@ internal static NetworkFabricControllerPatch DeserializeNetworkFabricControllerP return null; } IDictionary tags = default; - IList infrastructureExpressRouteConnections = default; - IList workloadExpressRouteConnections = default; + NetworkFabricControllerPatchProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -105,40 +111,9 @@ internal static NetworkFabricControllerPatch DeserializeNetworkFabricControllerP { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("infrastructureExpressRouteConnections"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ExpressRouteConnectionInformation.DeserializeExpressRouteConnectionInformation(item, options)); - } - infrastructureExpressRouteConnections = array; - continue; - } - if (property0.NameEquals("workloadExpressRouteConnections"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ExpressRouteConnectionInformation.DeserializeExpressRouteConnectionInformation(item, options)); - } - workloadExpressRouteConnections = array; - continue; - } - } + properties = NetworkFabricControllerPatchProperties.DeserializeNetworkFabricControllerPatchProperties(property.Value, options); continue; } if (options.Format != "W") @@ -147,7 +122,7 @@ internal static NetworkFabricControllerPatch DeserializeNetworkFabricControllerP } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkFabricControllerPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, infrastructureExpressRouteConnections ?? new ChangeTrackingList(), workloadExpressRouteConnections ?? new ChangeTrackingList()); + return new NetworkFabricControllerPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerPatch.cs index 67e5447b8907..e466b10db305 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerPatch.cs @@ -11,29 +11,60 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// The Network Fabric Controller Patch payload definition. - public partial class NetworkFabricControllerPatch : NetworkRackPatch + public partial class NetworkFabricControllerPatch { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public NetworkFabricControllerPatch() { - InfrastructureExpressRouteConnections = new ChangeTrackingList(); - WorkloadExpressRouteConnections = new ChangeTrackingList(); + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Resource tags. + /// Network Fabric Controller patch properties. /// Keeps track of any properties unknown to the library. - /// As part of an update, the Infrastructure ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Infrastructure services. (This is a Mandatory attribute). - /// As part of an update, the workload ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Workload services. (This is a Mandatory attribute). - internal NetworkFabricControllerPatch(IDictionary tags, IDictionary serializedAdditionalRawData, IList infrastructureExpressRouteConnections, IList workloadExpressRouteConnections) : base(tags, serializedAdditionalRawData) + internal NetworkFabricControllerPatch(IDictionary tags, NetworkFabricControllerPatchProperties properties, IDictionary serializedAdditionalRawData) { - InfrastructureExpressRouteConnections = infrastructureExpressRouteConnections; - WorkloadExpressRouteConnections = workloadExpressRouteConnections; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// As part of an update, the Infrastructure ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Infrastructure services. (This is a Mandatory attribute). - public IList InfrastructureExpressRouteConnections { get; } - /// As part of an update, the workload ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Workload services. (This is a Mandatory attribute). - public IList WorkloadExpressRouteConnections { get; } + /// Resource tags. + public IDictionary Tags { get; } + /// Network Fabric Controller patch properties. + public NetworkFabricControllerPatchProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerPatchProperties.Serialization.cs new file mode 100644 index 000000000000..f193e798c433 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerPatchProperties.Serialization.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkFabricControllerPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkFabricControllerPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(InfrastructureExpressRouteConnections)) + { + writer.WritePropertyName("infrastructureExpressRouteConnections"u8); + writer.WriteStartArray(); + foreach (var item in InfrastructureExpressRouteConnections) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(WorkloadExpressRouteConnections)) + { + writer.WritePropertyName("workloadExpressRouteConnections"u8); + writer.WriteStartArray(); + foreach (var item in WorkloadExpressRouteConnections) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkFabricControllerPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkFabricControllerPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkFabricControllerPatchProperties(document.RootElement, options); + } + + internal static NetworkFabricControllerPatchProperties DeserializeNetworkFabricControllerPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList infrastructureExpressRouteConnections = default; + IList workloadExpressRouteConnections = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("infrastructureExpressRouteConnections"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExpressRouteConnectionInformation.DeserializeExpressRouteConnectionInformation(item, options)); + } + infrastructureExpressRouteConnections = array; + continue; + } + if (property.NameEquals("workloadExpressRouteConnections"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExpressRouteConnectionInformation.DeserializeExpressRouteConnectionInformation(item, options)); + } + workloadExpressRouteConnections = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkFabricControllerPatchProperties(infrastructureExpressRouteConnections ?? new ChangeTrackingList(), workloadExpressRouteConnections ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkFabricControllerPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkFabricControllerPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkFabricControllerPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkFabricControllerPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerPatchProperties.cs new file mode 100644 index 000000000000..236b8e1dd1c4 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerPatchProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Network Fabric Controller patch properties. + public partial class NetworkFabricControllerPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NetworkFabricControllerPatchProperties() + { + InfrastructureExpressRouteConnections = new ChangeTrackingList(); + WorkloadExpressRouteConnections = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// As part of an update, the Infrastructure ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Infrastructure services. (This is a Mandatory attribute). + /// As part of an update, the workload ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Workload services. (This is a Mandatory attribute). + /// Keeps track of any properties unknown to the library. + internal NetworkFabricControllerPatchProperties(IList infrastructureExpressRouteConnections, IList workloadExpressRouteConnections, IDictionary serializedAdditionalRawData) + { + InfrastructureExpressRouteConnections = infrastructureExpressRouteConnections; + WorkloadExpressRouteConnections = workloadExpressRouteConnections; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// As part of an update, the Infrastructure ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Infrastructure services. (This is a Mandatory attribute). + public IList InfrastructureExpressRouteConnections { get; } + /// As part of an update, the workload ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Workload services. (This is a Mandatory attribute). + public IList WorkloadExpressRouteConnections { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerSKU.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerSKU.cs index 86eaf683289f..d7823fb57912 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerSKU.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllerSKU.cs @@ -26,11 +26,11 @@ public NetworkFabricControllerSKU(string value) private const string StandardValue = "Standard"; private const string HighPerformanceValue = "HighPerformance"; - /// Basic. + /// NfcSku-Basic. public static NetworkFabricControllerSKU Basic { get; } = new NetworkFabricControllerSKU(BasicValue); - /// Standard. + /// NfcSku-Standard. public static NetworkFabricControllerSKU Standard { get; } = new NetworkFabricControllerSKU(StandardValue); - /// HighPerformance. + /// NfcSku-HighPerformance. public static NetworkFabricControllerSKU HighPerformance { get; } = new NetworkFabricControllerSKU(HighPerformanceValue); /// Determines if two values are the same. public static bool operator ==(NetworkFabricControllerSKU left, NetworkFabricControllerSKU right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricExternalNetworkPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricExternalNetworkPatch.Serialization.cs index 6e8b913a2699..db26aa8d5823 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricExternalNetworkPatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricExternalNetworkPatch.Serialization.cs @@ -34,49 +34,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(NetworkFabricExternalNetworkPatch)} does not support writing '{format}' format."); } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) - { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); - } - if (Optional.IsDefined(ImportRoutePolicyId)) - { - writer.WritePropertyName("importRoutePolicyId"u8); - writer.WriteStringValue(ImportRoutePolicyId); - } - if (Optional.IsDefined(ExportRoutePolicyId)) - { - writer.WritePropertyName("exportRoutePolicyId"u8); - writer.WriteStringValue(ExportRoutePolicyId); - } - if (Optional.IsDefined(ImportRoutePolicy)) - { - writer.WritePropertyName("importRoutePolicy"u8); - writer.WriteObjectValue(ImportRoutePolicy, options); - } - if (Optional.IsDefined(ExportRoutePolicy)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("exportRoutePolicy"u8); - writer.WriteObjectValue(ExportRoutePolicy, options); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - if (Optional.IsDefined(PeeringOption)) - { - writer.WritePropertyName("peeringOption"u8); - writer.WriteStringValue(PeeringOption.Value.ToString()); - } - if (Optional.IsDefined(OptionBProperties)) - { - writer.WritePropertyName("optionBProperties"u8); - writer.WriteObjectValue(OptionBProperties, options); - } - if (Optional.IsDefined(OptionAProperties)) - { - writer.WritePropertyName("optionAProperties"u8); - writer.WriteObjectValue(OptionAProperties, options); - } - writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -114,14 +76,7 @@ internal static NetworkFabricExternalNetworkPatch DeserializeNetworkFabricExtern { return null; } - string annotation = default; - ResourceIdentifier importRoutePolicyId = default; - ResourceIdentifier exportRoutePolicyId = default; - ImportRoutePolicy importRoutePolicy = default; - ExportRoutePolicy exportRoutePolicy = default; - PeeringOption? peeringOption = default; - L3OptionBProperties optionBProperties = default; - ExternalNetworkPatchOptionAProperties optionAProperties = default; + ExternalNetworkPatchProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -130,80 +85,9 @@ internal static NetworkFabricExternalNetworkPatch DeserializeNetworkFabricExtern { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("importRoutePolicyId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - importRoutePolicyId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("exportRoutePolicyId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - exportRoutePolicyId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("importRoutePolicy"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - importRoutePolicy = ImportRoutePolicy.DeserializeImportRoutePolicy(property0.Value, options); - continue; - } - if (property0.NameEquals("exportRoutePolicy"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - exportRoutePolicy = ExportRoutePolicy.DeserializeExportRoutePolicy(property0.Value, options); - continue; - } - if (property0.NameEquals("peeringOption"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - peeringOption = new PeeringOption(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("optionBProperties"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - optionBProperties = L3OptionBProperties.DeserializeL3OptionBProperties(property0.Value, options); - continue; - } - if (property0.NameEquals("optionAProperties"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - optionAProperties = ExternalNetworkPatchOptionAProperties.DeserializeExternalNetworkPatchOptionAProperties(property0.Value, options); - continue; - } - } + properties = ExternalNetworkPatchProperties.DeserializeExternalNetworkPatchProperties(property.Value, options); continue; } if (options.Format != "W") @@ -212,16 +96,7 @@ internal static NetworkFabricExternalNetworkPatch DeserializeNetworkFabricExtern } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkFabricExternalNetworkPatch( - annotation, - importRoutePolicyId, - exportRoutePolicyId, - importRoutePolicy, - exportRoutePolicy, - peeringOption, - optionBProperties, - optionAProperties, - serializedAdditionalRawData); + return new NetworkFabricExternalNetworkPatch(properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricExternalNetworkPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricExternalNetworkPatch.cs index a8f754fb01ac..e2b315e159ce 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricExternalNetworkPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricExternalNetworkPatch.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.ManagedNetworkFabric.Models { @@ -52,43 +51,15 @@ public NetworkFabricExternalNetworkPatch() } /// Initializes a new instance of . - /// Switch configuration description. - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. - /// Import Route Policy either IPv4 or IPv6. - /// Export Route Policy either IPv4 or IPv6. - /// Peering option list. - /// option B properties object. - /// option A properties object. + /// External Network Patch properties. /// Keeps track of any properties unknown to the library. - internal NetworkFabricExternalNetworkPatch(string annotation, ResourceIdentifier importRoutePolicyId, ResourceIdentifier exportRoutePolicyId, ImportRoutePolicy importRoutePolicy, ExportRoutePolicy exportRoutePolicy, PeeringOption? peeringOption, L3OptionBProperties optionBProperties, ExternalNetworkPatchOptionAProperties optionAProperties, IDictionary serializedAdditionalRawData) + internal NetworkFabricExternalNetworkPatch(ExternalNetworkPatchProperties properties, IDictionary serializedAdditionalRawData) { - Annotation = annotation; - ImportRoutePolicyId = importRoutePolicyId; - ExportRoutePolicyId = exportRoutePolicyId; - ImportRoutePolicy = importRoutePolicy; - ExportRoutePolicy = exportRoutePolicy; - PeeringOption = peeringOption; - OptionBProperties = optionBProperties; - OptionAProperties = optionAProperties; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Switch configuration description. - public string Annotation { get; set; } - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. - public ResourceIdentifier ImportRoutePolicyId { get; set; } - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. - public ResourceIdentifier ExportRoutePolicyId { get; set; } - /// Import Route Policy either IPv4 or IPv6. - public ImportRoutePolicy ImportRoutePolicy { get; set; } - /// Export Route Policy either IPv4 or IPv6. - public ExportRoutePolicy ExportRoutePolicy { get; set; } - /// Peering option list. - public PeeringOption? PeeringOption { get; set; } - /// option B properties object. - public L3OptionBProperties OptionBProperties { get; set; } - /// option A properties object. - public ExternalNetworkPatchOptionAProperties OptionAProperties { get; set; } + /// External Network Patch properties. + public ExternalNetworkPatchProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPAddressType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPAddressType.cs index a77fd99e7809..8536ad9dd55c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPAddressType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPAddressType.cs @@ -25,9 +25,9 @@ public NetworkFabricIPAddressType(string value) private const string IPv4Value = "IPv4"; private const string IPv6Value = "IPv6"; - /// IPv4. + /// IPv4 IP address. public static NetworkFabricIPAddressType IPv4 { get; } = new NetworkFabricIPAddressType(IPv4Value); - /// IPv6. + /// IPv6 IP address. public static NetworkFabricIPAddressType IPv6 { get; } = new NetworkFabricIPAddressType(IPv6Value); /// Determines if two values are the same. public static bool operator ==(NetworkFabricIPAddressType left, NetworkFabricIPAddressType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPCommunityPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPCommunityPatch.Serialization.cs index 8a942ae6efca..8de19ae07980 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPCommunityPatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPCommunityPatch.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,20 +34,37 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(NetworkFabricIPCommunityPatch)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(IPCommunityRules)) + if (Optional.IsCollectionDefined(Tags)) { - writer.WritePropertyName("ipCommunityRules"u8); - writer.WriteStartArray(); - foreach (var item in IPCommunityRules) + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) { - writer.WriteObjectValue(item, options); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif } - writer.WriteEndArray(); } - writer.WriteEndObject(); } NetworkFabricIPCommunityPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -71,7 +88,7 @@ internal static NetworkFabricIPCommunityPatch DeserializeNetworkFabricIPCommunit return null; } IDictionary tags = default; - IList ipCommunityRules = default; + IPCommunityPatchableProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -94,26 +111,9 @@ internal static NetworkFabricIPCommunityPatch DeserializeNetworkFabricIPCommunit { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("ipCommunityRules"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(IPCommunityRule.DeserializeIPCommunityRule(item, options)); - } - ipCommunityRules = array; - continue; - } - } + properties = IPCommunityPatchableProperties.DeserializeIPCommunityPatchableProperties(property.Value, options); continue; } if (options.Format != "W") @@ -122,7 +122,7 @@ internal static NetworkFabricIPCommunityPatch DeserializeNetworkFabricIPCommunit } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkFabricIPCommunityPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, ipCommunityRules ?? new ChangeTrackingList()); + return new NetworkFabricIPCommunityPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPCommunityPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPCommunityPatch.cs index 517de9f04ed5..2258599245b1 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPCommunityPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPCommunityPatch.cs @@ -11,24 +11,70 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// The IP Community patch resource definition. - public partial class NetworkFabricIPCommunityPatch : NetworkRackPatch + public partial class NetworkFabricIPCommunityPatch { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public NetworkFabricIPCommunityPatch() { - IPCommunityRules = new ChangeTrackingList(); + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Resource tags. + /// IP Community patchable properties. /// Keeps track of any properties unknown to the library. - /// List of IP Community Rules. - internal NetworkFabricIPCommunityPatch(IDictionary tags, IDictionary serializedAdditionalRawData, IList ipCommunityRules) : base(tags, serializedAdditionalRawData) + internal NetworkFabricIPCommunityPatch(IDictionary tags, IPCommunityPatchableProperties properties, IDictionary serializedAdditionalRawData) { - IPCommunityRules = ipCommunityRules; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Resource tags. + public IDictionary Tags { get; } + /// IP Community patchable properties. + internal IPCommunityPatchableProperties Properties { get; set; } /// List of IP Community Rules. - public IList IPCommunityRules { get; } + public IList IPCommunityRules + { + get + { + if (Properties is null) + Properties = new IPCommunityPatchableProperties(); + return Properties.IPCommunityRules; + } + } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPExtendedCommunityPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPExtendedCommunityPatch.Serialization.cs index 13ffee854e70..f79dfd38f4ea 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPExtendedCommunityPatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPExtendedCommunityPatch.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,25 +34,37 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(NetworkFabricIPExtendedCommunityPatch)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(IPExtendedCommunityRules)) + if (Optional.IsCollectionDefined(Tags)) { - writer.WritePropertyName("ipExtendedCommunityRules"u8); - writer.WriteStartArray(); - foreach (var item in IPExtendedCommunityRules) + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) { - writer.WriteObjectValue(item, options); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } - writer.WriteEndArray(); + writer.WriteEndObject(); } - if (Optional.IsDefined(Annotation)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } } - writer.WriteEndObject(); } NetworkFabricIPExtendedCommunityPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -76,8 +88,7 @@ internal static NetworkFabricIPExtendedCommunityPatch DeserializeNetworkFabricIP return null; } IDictionary tags = default; - IList ipExtendedCommunityRules = default; - string annotation = default; + IPExtendedCommunityPatchProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -100,31 +111,9 @@ internal static NetworkFabricIPExtendedCommunityPatch DeserializeNetworkFabricIP { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("ipExtendedCommunityRules"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(IPExtendedCommunityRule.DeserializeIPExtendedCommunityRule(item, options)); - } - ipExtendedCommunityRules = array; - continue; - } - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - } + properties = IPExtendedCommunityPatchProperties.DeserializeIPExtendedCommunityPatchProperties(property.Value, options); continue; } if (options.Format != "W") @@ -133,7 +122,7 @@ internal static NetworkFabricIPExtendedCommunityPatch DeserializeNetworkFabricIP } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkFabricIPExtendedCommunityPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, ipExtendedCommunityRules ?? new ChangeTrackingList(), annotation); + return new NetworkFabricIPExtendedCommunityPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPExtendedCommunityPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPExtendedCommunityPatch.cs index 8bcc0f17e36c..fd2333e0ba14 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPExtendedCommunityPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPExtendedCommunityPatch.cs @@ -11,28 +11,60 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// The IP Extended Communities patch resource definition. - public partial class NetworkFabricIPExtendedCommunityPatch : NetworkRackPatch + public partial class NetworkFabricIPExtendedCommunityPatch { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public NetworkFabricIPExtendedCommunityPatch() { - IPExtendedCommunityRules = new ChangeTrackingList(); + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Resource tags. + /// IP Extended Community patchable properties. /// Keeps track of any properties unknown to the library. - /// List of IP Extended Community Rules. - /// Switch configuration description. - internal NetworkFabricIPExtendedCommunityPatch(IDictionary tags, IDictionary serializedAdditionalRawData, IList ipExtendedCommunityRules, string annotation) : base(tags, serializedAdditionalRawData) + internal NetworkFabricIPExtendedCommunityPatch(IDictionary tags, IPExtendedCommunityPatchProperties properties, IDictionary serializedAdditionalRawData) { - IPExtendedCommunityRules = ipExtendedCommunityRules; - Annotation = annotation; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of IP Extended Community Rules. - public IList IPExtendedCommunityRules { get; } - /// Switch configuration description. - public string Annotation { get; set; } + /// Resource tags. + public IDictionary Tags { get; } + /// IP Extended Community patchable properties. + public IPExtendedCommunityPatchProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPPrefixPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPPrefixPatch.Serialization.cs index 4824adc0a478..5aa9df9817c8 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPPrefixPatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPPrefixPatch.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,25 +34,37 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(NetworkFabricIPPrefixPatch)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - if (Optional.IsCollectionDefined(IPPrefixRules)) + if (options.Format != "W" && _serializedAdditionalRawData != null) { - writer.WritePropertyName("ipPrefixRules"u8); - writer.WriteStartArray(); - foreach (var item in IPPrefixRules) + foreach (var item in _serializedAdditionalRawData) { - writer.WriteObjectValue(item, options); + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif } - writer.WriteEndArray(); } - writer.WriteEndObject(); } NetworkFabricIPPrefixPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -76,8 +88,7 @@ internal static NetworkFabricIPPrefixPatch DeserializeNetworkFabricIPPrefixPatch return null; } IDictionary tags = default; - string annotation = default; - IList ipPrefixRules = default; + IPPrefixPatchProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -100,31 +111,9 @@ internal static NetworkFabricIPPrefixPatch DeserializeNetworkFabricIPPrefixPatch { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("ipPrefixRules"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(IPPrefixRule.DeserializeIPPrefixRule(item, options)); - } - ipPrefixRules = array; - continue; - } - } + properties = IPPrefixPatchProperties.DeserializeIPPrefixPatchProperties(property.Value, options); continue; } if (options.Format != "W") @@ -133,7 +122,7 @@ internal static NetworkFabricIPPrefixPatch DeserializeNetworkFabricIPPrefixPatch } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkFabricIPPrefixPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, annotation, ipPrefixRules ?? new ChangeTrackingList()); + return new NetworkFabricIPPrefixPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPPrefixPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPPrefixPatch.cs index 7c22b81434f5..1cfdb208ef9c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPPrefixPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricIPPrefixPatch.cs @@ -11,28 +11,60 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// The IP Prefix patch resource definition. - public partial class NetworkFabricIPPrefixPatch : NetworkRackPatch + public partial class NetworkFabricIPPrefixPatch { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public NetworkFabricIPPrefixPatch() { - IPPrefixRules = new ChangeTrackingList(); + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Resource tags. + /// IP Prefix patchable properties. /// Keeps track of any properties unknown to the library. - /// Switch configuration description. - /// The list of IP Prefix Rules. - internal NetworkFabricIPPrefixPatch(IDictionary tags, IDictionary serializedAdditionalRawData, string annotation, IList ipPrefixRules) : base(tags, serializedAdditionalRawData) + internal NetworkFabricIPPrefixPatch(IDictionary tags, IPPrefixPatchProperties properties, IDictionary serializedAdditionalRawData) { - Annotation = annotation; - IPPrefixRules = ipPrefixRules; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Switch configuration description. - public string Annotation { get; set; } - /// The list of IP Prefix Rules. - public IList IPPrefixRules { get; } + /// Resource tags. + public IDictionary Tags { get; } + /// IP Prefix patchable properties. + public IPPrefixPatchProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternalNetworkPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternalNetworkPatch.Serialization.cs index 1ee8ae04d703..1319c4bf5fe2 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternalNetworkPatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternalNetworkPatch.Serialization.cs @@ -34,84 +34,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(NetworkFabricInternalNetworkPatch)} does not support writing '{format}' format."); } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) - { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); - } - if (Optional.IsDefined(Mtu)) - { - writer.WritePropertyName("mtu"u8); - writer.WriteNumberValue(Mtu.Value); - } - if (Optional.IsCollectionDefined(ConnectedIPv4Subnets)) - { - writer.WritePropertyName("connectedIPv4Subnets"u8); - writer.WriteStartArray(); - foreach (var item in ConnectedIPv4Subnets) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(ConnectedIPv6Subnets)) - { - writer.WritePropertyName("connectedIPv6Subnets"u8); - writer.WriteStartArray(); - foreach (var item in ConnectedIPv6Subnets) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ImportRoutePolicyId)) - { - writer.WritePropertyName("importRoutePolicyId"u8); - writer.WriteStringValue(ImportRoutePolicyId); - } - if (Optional.IsDefined(ExportRoutePolicyId)) - { - writer.WritePropertyName("exportRoutePolicyId"u8); - writer.WriteStringValue(ExportRoutePolicyId); - } - if (Optional.IsDefined(ImportRoutePolicy)) - { - writer.WritePropertyName("importRoutePolicy"u8); - writer.WriteObjectValue(ImportRoutePolicy, options); - } - if (Optional.IsDefined(ExportRoutePolicy)) - { - writer.WritePropertyName("exportRoutePolicy"u8); - writer.WriteObjectValue(ExportRoutePolicy, options); - } - if (Optional.IsDefined(IngressAclId)) - { - writer.WritePropertyName("ingressAclId"u8); - writer.WriteStringValue(IngressAclId); - } - if (Optional.IsDefined(EgressAclId)) - { - writer.WritePropertyName("egressAclId"u8); - writer.WriteStringValue(EgressAclId); - } - if (Optional.IsDefined(IsMonitoringEnabled)) - { - writer.WritePropertyName("isMonitoringEnabled"u8); - writer.WriteStringValue(IsMonitoringEnabled.Value.ToString()); - } - if (Optional.IsDefined(BgpConfiguration)) - { - writer.WritePropertyName("bgpConfiguration"u8); - writer.WriteObjectValue(BgpConfiguration, options); - } - if (Optional.IsDefined(StaticRouteConfiguration)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("staticRouteConfiguration"u8); - writer.WriteObjectValue(StaticRouteConfiguration, options); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -149,19 +76,7 @@ internal static NetworkFabricInternalNetworkPatch DeserializeNetworkFabricIntern { return null; } - string annotation = default; - int? mtu = default; - IList connectedIPv4Subnets = default; - IList connectedIPv6Subnets = default; - ResourceIdentifier importRoutePolicyId = default; - ResourceIdentifier exportRoutePolicyId = default; - ImportRoutePolicy importRoutePolicy = default; - ExportRoutePolicy exportRoutePolicy = default; - ResourceIdentifier ingressAclId = default; - ResourceIdentifier egressAclId = default; - IsMonitoringEnabled? isMonitoringEnabled = default; - BgpConfiguration bgpConfiguration = default; - StaticRouteConfiguration staticRouteConfiguration = default; + InternalNetworkPatchProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -170,135 +85,9 @@ internal static NetworkFabricInternalNetworkPatch DeserializeNetworkFabricIntern { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("mtu"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mtu = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("connectedIPv4Subnets"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ConnectedSubnet.DeserializeConnectedSubnet(item, options)); - } - connectedIPv4Subnets = array; - continue; - } - if (property0.NameEquals("connectedIPv6Subnets"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ConnectedSubnet.DeserializeConnectedSubnet(item, options)); - } - connectedIPv6Subnets = array; - continue; - } - if (property0.NameEquals("importRoutePolicyId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - importRoutePolicyId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("exportRoutePolicyId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - exportRoutePolicyId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("importRoutePolicy"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - importRoutePolicy = ImportRoutePolicy.DeserializeImportRoutePolicy(property0.Value, options); - continue; - } - if (property0.NameEquals("exportRoutePolicy"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - exportRoutePolicy = ExportRoutePolicy.DeserializeExportRoutePolicy(property0.Value, options); - continue; - } - if (property0.NameEquals("ingressAclId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - ingressAclId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("egressAclId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - egressAclId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("isMonitoringEnabled"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isMonitoringEnabled = new IsMonitoringEnabled(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("bgpConfiguration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - bgpConfiguration = BgpConfiguration.DeserializeBgpConfiguration(property0.Value, options); - continue; - } - if (property0.NameEquals("staticRouteConfiguration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - staticRouteConfiguration = StaticRouteConfiguration.DeserializeStaticRouteConfiguration(property0.Value, options); - continue; - } - } + properties = InternalNetworkPatchProperties.DeserializeInternalNetworkPatchProperties(property.Value, options); continue; } if (options.Format != "W") @@ -307,21 +96,7 @@ internal static NetworkFabricInternalNetworkPatch DeserializeNetworkFabricIntern } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkFabricInternalNetworkPatch( - annotation, - mtu, - connectedIPv4Subnets ?? new ChangeTrackingList(), - connectedIPv6Subnets ?? new ChangeTrackingList(), - importRoutePolicyId, - exportRoutePolicyId, - importRoutePolicy, - exportRoutePolicy, - ingressAclId, - egressAclId, - isMonitoringEnabled, - bgpConfiguration, - staticRouteConfiguration, - serializedAdditionalRawData); + return new NetworkFabricInternalNetworkPatch(properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternalNetworkPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternalNetworkPatch.cs index bd77b71469e1..b03a376d79d4 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternalNetworkPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternalNetworkPatch.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.ManagedNetworkFabric.Models { @@ -49,68 +48,18 @@ public partial class NetworkFabricInternalNetworkPatch /// Initializes a new instance of . public NetworkFabricInternalNetworkPatch() { - ConnectedIPv4Subnets = new ChangeTrackingList(); - ConnectedIPv6Subnets = new ChangeTrackingList(); } /// Initializes a new instance of . - /// Switch configuration description. - /// Maximum transmission unit. Default value is 1500. - /// List of Connected IPv4 Subnets. - /// List of connected IPv6 Subnets. - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. - /// Import Route Policy either IPv4 or IPv6. - /// Export Route Policy either IPv4 or IPv6. - /// Ingress Acl. ARM resource ID of Access Control Lists. - /// Egress Acl. ARM resource ID of Access Control Lists. - /// To check whether monitoring of internal network is enabled or not. - /// BGP configuration properties. - /// Static Route Configuration properties. + /// InternalNetwork Patch properties. /// Keeps track of any properties unknown to the library. - internal NetworkFabricInternalNetworkPatch(string annotation, int? mtu, IList connectedIPv4Subnets, IList connectedIPv6Subnets, ResourceIdentifier importRoutePolicyId, ResourceIdentifier exportRoutePolicyId, ImportRoutePolicy importRoutePolicy, ExportRoutePolicy exportRoutePolicy, ResourceIdentifier ingressAclId, ResourceIdentifier egressAclId, IsMonitoringEnabled? isMonitoringEnabled, BgpConfiguration bgpConfiguration, StaticRouteConfiguration staticRouteConfiguration, IDictionary serializedAdditionalRawData) + internal NetworkFabricInternalNetworkPatch(InternalNetworkPatchProperties properties, IDictionary serializedAdditionalRawData) { - Annotation = annotation; - Mtu = mtu; - ConnectedIPv4Subnets = connectedIPv4Subnets; - ConnectedIPv6Subnets = connectedIPv6Subnets; - ImportRoutePolicyId = importRoutePolicyId; - ExportRoutePolicyId = exportRoutePolicyId; - ImportRoutePolicy = importRoutePolicy; - ExportRoutePolicy = exportRoutePolicy; - IngressAclId = ingressAclId; - EgressAclId = egressAclId; - IsMonitoringEnabled = isMonitoringEnabled; - BgpConfiguration = bgpConfiguration; - StaticRouteConfiguration = staticRouteConfiguration; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Switch configuration description. - public string Annotation { get; set; } - /// Maximum transmission unit. Default value is 1500. - public int? Mtu { get; set; } - /// List of Connected IPv4 Subnets. - public IList ConnectedIPv4Subnets { get; } - /// List of connected IPv6 Subnets. - public IList ConnectedIPv6Subnets { get; } - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. - public ResourceIdentifier ImportRoutePolicyId { get; set; } - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. - public ResourceIdentifier ExportRoutePolicyId { get; set; } - /// Import Route Policy either IPv4 or IPv6. - public ImportRoutePolicy ImportRoutePolicy { get; set; } - /// Export Route Policy either IPv4 or IPv6. - public ExportRoutePolicy ExportRoutePolicy { get; set; } - /// Ingress Acl. ARM resource ID of Access Control Lists. - public ResourceIdentifier IngressAclId { get; set; } - /// Egress Acl. ARM resource ID of Access Control Lists. - public ResourceIdentifier EgressAclId { get; set; } - /// To check whether monitoring of internal network is enabled or not. - public IsMonitoringEnabled? IsMonitoringEnabled { get; set; } - /// BGP configuration properties. - public BgpConfiguration BgpConfiguration { get; set; } - /// Static Route Configuration properties. - public StaticRouteConfiguration StaticRouteConfiguration { get; set; } + /// InternalNetwork Patch properties. + public InternalNetworkPatchProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayPatch.Serialization.cs index e3fa7ab7fe84..a8f1da2ae91f 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayPatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayPatch.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,15 +34,37 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(NetworkFabricInternetGatewayPatch)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(InternetGatewayRuleId)) + if (Optional.IsCollectionDefined(Tags)) { - writer.WritePropertyName("internetGatewayRuleId"u8); - writer.WriteStringValue(InternetGatewayRuleId); + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } } - writer.WriteEndObject(); } NetworkFabricInternetGatewayPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -66,7 +88,7 @@ internal static NetworkFabricInternetGatewayPatch DeserializeNetworkFabricIntern return null; } IDictionary tags = default; - ResourceIdentifier internetGatewayRuleId = default; + InternetGatewayPatchProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -89,21 +111,9 @@ internal static NetworkFabricInternetGatewayPatch DeserializeNetworkFabricIntern { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("internetGatewayRuleId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - internetGatewayRuleId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - } + properties = InternetGatewayPatchProperties.DeserializeInternetGatewayPatchProperties(property.Value, options); continue; } if (options.Format != "W") @@ -112,7 +122,7 @@ internal static NetworkFabricInternetGatewayPatch DeserializeNetworkFabricIntern } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkFabricInternetGatewayPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, internetGatewayRuleId); + return new NetworkFabricInternetGatewayPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayPatch.cs index 303ad1244f28..6f32425082a1 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayPatch.cs @@ -12,23 +12,71 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// The Internet Gateway patch resource definition. - public partial class NetworkFabricInternetGatewayPatch : NetworkRackPatch + public partial class NetworkFabricInternetGatewayPatch { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public NetworkFabricInternetGatewayPatch() { + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Resource tags. + /// Resource properties. /// Keeps track of any properties unknown to the library. - /// ARM Resource ID of the Internet Gateway Rule. - internal NetworkFabricInternetGatewayPatch(IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier internetGatewayRuleId) : base(tags, serializedAdditionalRawData) + internal NetworkFabricInternetGatewayPatch(IDictionary tags, InternetGatewayPatchProperties properties, IDictionary serializedAdditionalRawData) { - InternetGatewayRuleId = internetGatewayRuleId; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Resource tags. + public IDictionary Tags { get; } + /// Resource properties. + internal InternetGatewayPatchProperties Properties { get; set; } /// ARM Resource ID of the Internet Gateway Rule. - public ResourceIdentifier InternetGatewayRuleId { get; set; } + public ResourceIdentifier InternetGatewayRuleId + { + get => Properties is null ? default : Properties.InternetGatewayRuleId; + set + { + if (Properties is null) + Properties = new InternetGatewayPatchProperties(); + Properties.InternetGatewayRuleId = value; + } + } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayRulePatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayRulePatch.Serialization.cs index 325d79e2fec3..7bcdcd520aee 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayRulePatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayRulePatch.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,7 +34,32 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(NetworkFabricInternetGatewayRulePatch)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } NetworkFabricInternetGatewayRulePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayRulePatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayRulePatch.cs index 3938b5d06d7d..288e5249344d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayRulePatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricInternetGatewayRulePatch.cs @@ -11,18 +11,56 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// The Internet Gateway Rules patch resource definition. - public partial class NetworkFabricInternetGatewayRulePatch : NetworkRackPatch + public partial class NetworkFabricInternetGatewayRulePatch { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public NetworkFabricInternetGatewayRulePatch() { + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Resource tags. /// Keeps track of any properties unknown to the library. - internal NetworkFabricInternetGatewayRulePatch(IDictionary tags, IDictionary serializedAdditionalRawData) : base(tags, serializedAdditionalRawData) + internal NetworkFabricInternetGatewayRulePatch(IDictionary tags, IDictionary serializedAdditionalRawData) { + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; } + + /// Resource tags. + public IDictionary Tags { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricL2IsolationDomainPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricL2IsolationDomainPatch.Serialization.cs index 76b071debad9..49edf4c9549f 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricL2IsolationDomainPatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricL2IsolationDomainPatch.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,20 +34,37 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(NetworkFabricL2IsolationDomainPatch)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) + if (Optional.IsCollectionDefined(Tags)) { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); } - if (Optional.IsDefined(Mtu)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("mtu"u8); - writer.WriteNumberValue(Mtu.Value); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } } - writer.WriteEndObject(); } NetworkFabricL2IsolationDomainPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -71,8 +88,7 @@ internal static NetworkFabricL2IsolationDomainPatch DeserializeNetworkFabricL2Is return null; } IDictionary tags = default; - string annotation = default; - int? mtu = default; + L2IsolationDomainPatchProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -95,26 +111,9 @@ internal static NetworkFabricL2IsolationDomainPatch DeserializeNetworkFabricL2Is { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("mtu"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mtu = property0.Value.GetInt32(); - continue; - } - } + properties = L2IsolationDomainPatchProperties.DeserializeL2IsolationDomainPatchProperties(property.Value, options); continue; } if (options.Format != "W") @@ -123,7 +122,7 @@ internal static NetworkFabricL2IsolationDomainPatch DeserializeNetworkFabricL2Is } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkFabricL2IsolationDomainPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, annotation, mtu); + return new NetworkFabricL2IsolationDomainPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricL2IsolationDomainPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricL2IsolationDomainPatch.cs index daa42cc0a7ab..73d678774b5f 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricL2IsolationDomainPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricL2IsolationDomainPatch.cs @@ -11,27 +11,60 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// The L2 Isolation Domain patch resource definition. - public partial class NetworkFabricL2IsolationDomainPatch : NetworkRackPatch + public partial class NetworkFabricL2IsolationDomainPatch { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public NetworkFabricL2IsolationDomainPatch() { + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Resource tags. + /// Resource properties. /// Keeps track of any properties unknown to the library. - /// Switch configuration description. - /// Maximum transmission unit. Default value is 1500. - internal NetworkFabricL2IsolationDomainPatch(IDictionary tags, IDictionary serializedAdditionalRawData, string annotation, int? mtu) : base(tags, serializedAdditionalRawData) + internal NetworkFabricL2IsolationDomainPatch(IDictionary tags, L2IsolationDomainPatchProperties properties, IDictionary serializedAdditionalRawData) { - Annotation = annotation; - Mtu = mtu; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Switch configuration description. - public string Annotation { get; set; } - /// Maximum transmission unit. Default value is 1500. - public int? Mtu { get; set; } + /// Resource tags. + public IDictionary Tags { get; } + /// Resource properties. + public L2IsolationDomainPatchProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricL3IsolationDomainPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricL3IsolationDomainPatch.Serialization.cs index 51eae3e0cb10..eda389d60a05 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricL3IsolationDomainPatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricL3IsolationDomainPatch.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,35 +34,37 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(NetworkFabricL3IsolationDomainPatch)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) - { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); - } - if (Optional.IsDefined(RedistributeConnectedSubnets)) - { - writer.WritePropertyName("redistributeConnectedSubnets"u8); - writer.WriteStringValue(RedistributeConnectedSubnets.Value.ToString()); - } - if (Optional.IsDefined(RedistributeStaticRoutes)) + if (Optional.IsCollectionDefined(Tags)) { - writer.WritePropertyName("redistributeStaticRoutes"u8); - writer.WriteStringValue(RedistributeStaticRoutes.Value.ToString()); + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); } - if (Optional.IsDefined(AggregateRouteConfiguration)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("aggregateRouteConfiguration"u8); - writer.WriteObjectValue(AggregateRouteConfiguration, options); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - if (Optional.IsDefined(ConnectedSubnetRoutePolicy)) + if (options.Format != "W" && _serializedAdditionalRawData != null) { - writer.WritePropertyName("connectedSubnetRoutePolicy"u8); - writer.WriteObjectValue(ConnectedSubnetRoutePolicy, options); + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } } - writer.WriteEndObject(); } NetworkFabricL3IsolationDomainPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -86,11 +88,7 @@ internal static NetworkFabricL3IsolationDomainPatch DeserializeNetworkFabricL3Is return null; } IDictionary tags = default; - string annotation = default; - RedistributeConnectedSubnet? redistributeConnectedSubnets = default; - RedistributeStaticRoute? redistributeStaticRoutes = default; - AggregateRouteConfiguration aggregateRouteConfiguration = default; - ConnectedSubnetRoutePolicy connectedSubnetRoutePolicy = default; + L3IsolationDomainPatchProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -113,53 +111,9 @@ internal static NetworkFabricL3IsolationDomainPatch DeserializeNetworkFabricL3Is { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("redistributeConnectedSubnets"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - redistributeConnectedSubnets = new RedistributeConnectedSubnet(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("redistributeStaticRoutes"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - redistributeStaticRoutes = new RedistributeStaticRoute(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("aggregateRouteConfiguration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - aggregateRouteConfiguration = AggregateRouteConfiguration.DeserializeAggregateRouteConfiguration(property0.Value, options); - continue; - } - if (property0.NameEquals("connectedSubnetRoutePolicy"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - connectedSubnetRoutePolicy = ConnectedSubnetRoutePolicy.DeserializeConnectedSubnetRoutePolicy(property0.Value, options); - continue; - } - } + properties = L3IsolationDomainPatchProperties.DeserializeL3IsolationDomainPatchProperties(property.Value, options); continue; } if (options.Format != "W") @@ -168,14 +122,7 @@ internal static NetworkFabricL3IsolationDomainPatch DeserializeNetworkFabricL3Is } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkFabricL3IsolationDomainPatch( - tags ?? new ChangeTrackingDictionary(), - serializedAdditionalRawData, - annotation, - redistributeConnectedSubnets, - redistributeStaticRoutes, - aggregateRouteConfiguration, - connectedSubnetRoutePolicy); + return new NetworkFabricL3IsolationDomainPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricL3IsolationDomainPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricL3IsolationDomainPatch.cs index 248803c1f83e..64e7094363e7 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricL3IsolationDomainPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricL3IsolationDomainPatch.cs @@ -11,39 +11,60 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// The L3 Isolation Domain patch resource definition. - public partial class NetworkFabricL3IsolationDomainPatch : NetworkRackPatch + public partial class NetworkFabricL3IsolationDomainPatch { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public NetworkFabricL3IsolationDomainPatch() { + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Resource tags. + /// Resource properties. /// Keeps track of any properties unknown to the library. - /// Switch configuration description. - /// Advertise Connected Subnets. Ex: "True" | "False". - /// Advertise Static Routes. Ex: "True" | "False". - /// Aggregate route configurations. - /// Connected Subnet RoutePolicy. - internal NetworkFabricL3IsolationDomainPatch(IDictionary tags, IDictionary serializedAdditionalRawData, string annotation, RedistributeConnectedSubnet? redistributeConnectedSubnets, RedistributeStaticRoute? redistributeStaticRoutes, AggregateRouteConfiguration aggregateRouteConfiguration, ConnectedSubnetRoutePolicy connectedSubnetRoutePolicy) : base(tags, serializedAdditionalRawData) + internal NetworkFabricL3IsolationDomainPatch(IDictionary tags, L3IsolationDomainPatchProperties properties, IDictionary serializedAdditionalRawData) { - Annotation = annotation; - RedistributeConnectedSubnets = redistributeConnectedSubnets; - RedistributeStaticRoutes = redistributeStaticRoutes; - AggregateRouteConfiguration = aggregateRouteConfiguration; - ConnectedSubnetRoutePolicy = connectedSubnetRoutePolicy; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Switch configuration description. - public string Annotation { get; set; } - /// Advertise Connected Subnets. Ex: "True" | "False". - public RedistributeConnectedSubnet? RedistributeConnectedSubnets { get; set; } - /// Advertise Static Routes. Ex: "True" | "False". - public RedistributeStaticRoute? RedistributeStaticRoutes { get; set; } - /// Aggregate route configurations. - public AggregateRouteConfiguration AggregateRouteConfiguration { get; set; } - /// Connected Subnet RoutePolicy. - public ConnectedSubnetRoutePolicy ConnectedSubnetRoutePolicy { get; set; } + /// Resource tags. + public IDictionary Tags { get; } + /// Resource properties. + public L3IsolationDomainPatchProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricListResult.Serialization.cs new file mode 100644 index 000000000000..5e61abfcffcf --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class NetworkFabricListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkFabricListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkFabricListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkFabricListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkFabricListResult(document.RootElement, options); + } + + internal static NetworkFabricListResult DeserializeNetworkFabricListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkFabricData.DeserializeNetworkFabricData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkFabricListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkFabricListResult)} does not support writing '{options.Format}' format."); + } + } + + NetworkFabricListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkFabricListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkFabricListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricListResult.cs new file mode 100644 index 000000000000..bde9bb7d9d41 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a NetworkFabric list operation. + internal partial class NetworkFabricListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The NetworkFabric items on this page. + /// is null. + internal NetworkFabricListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The NetworkFabric items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NetworkFabricListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkFabricListResult() + { + } + + /// The NetworkFabric items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricLockAction.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricLockAction.cs new file mode 100644 index 000000000000..31fd9eef6362 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricLockAction.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Network fabric lock action. + public readonly partial struct NetworkFabricLockAction : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public NetworkFabricLockAction(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LockValue = "Lock"; + private const string UnlockValue = "Unlock"; + + /// Perform lock operation. + public static NetworkFabricLockAction Lock { get; } = new NetworkFabricLockAction(LockValue); + /// Perform unlock operation. + public static NetworkFabricLockAction Unlock { get; } = new NetworkFabricLockAction(UnlockValue); + /// Determines if two values are the same. + public static bool operator ==(NetworkFabricLockAction left, NetworkFabricLockAction right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NetworkFabricLockAction left, NetworkFabricLockAction right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator NetworkFabricLockAction(string value) => new NetworkFabricLockAction(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NetworkFabricLockAction other && Equals(other); + /// + public bool Equals(NetworkFabricLockAction other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricLockContent.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricLockContent.Serialization.cs new file mode 100644 index 000000000000..db788a23dfb6 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricLockContent.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkFabricLockContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkFabricLockContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(LockType)) + { + writer.WritePropertyName("lockType"u8); + writer.WriteStringValue(LockType.Value.ToString()); + } + if (Optional.IsDefined(Action)) + { + writer.WritePropertyName("action"u8); + writer.WriteStringValue(Action.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkFabricLockContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkFabricLockContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkFabricLockContent(document.RootElement, options); + } + + internal static NetworkFabricLockContent DeserializeNetworkFabricLockContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NetworkFabricLockType? lockType = default; + NetworkFabricLockAction? action = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lockType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lockType = new NetworkFabricLockType(property.Value.GetString()); + continue; + } + if (property.NameEquals("action"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + action = new NetworkFabricLockAction(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkFabricLockContent(lockType, action, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkFabricLockContent)} does not support writing '{options.Format}' format."); + } + } + + NetworkFabricLockContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkFabricLockContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkFabricLockContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricLockContent.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricLockContent.cs new file mode 100644 index 000000000000..3992d58e9ed9 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricLockContent.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Network Fabric Lock Request. + public partial class NetworkFabricLockContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NetworkFabricLockContent() + { + } + + /// Initializes a new instance of . + /// Type of lock to be applied. + /// Action to be performed on the lock. + /// Keeps track of any properties unknown to the library. + internal NetworkFabricLockContent(NetworkFabricLockType? lockType, NetworkFabricLockAction? action, IDictionary serializedAdditionalRawData) + { + LockType = lockType; + Action = action; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Type of lock to be applied. + public NetworkFabricLockType? LockType { get; set; } + /// Action to be performed on the lock. + public NetworkFabricLockAction? Action { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricLockType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricLockType.cs new file mode 100644 index 000000000000..6d7565757279 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricLockType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Network fabric lock type. + public readonly partial struct NetworkFabricLockType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public NetworkFabricLockType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AdministrativeValue = "Administrative"; + private const string ConfigurationValue = "Configuration"; + + /// A administrative lock/unlock operation will be performed. + public static NetworkFabricLockType Administrative { get; } = new NetworkFabricLockType(AdministrativeValue); + /// A lock/unlock operation will be performed on the configuration. + public static NetworkFabricLockType Configuration { get; } = new NetworkFabricLockType(ConfigurationValue); + /// Determines if two values are the same. + public static bool operator ==(NetworkFabricLockType left, NetworkFabricLockType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NetworkFabricLockType left, NetworkFabricLockType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator NetworkFabricLockType(string value) => new NetworkFabricLockType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NetworkFabricLockType other && Equals(other); + /// + public bool Equals(NetworkFabricLockType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricNeighborGroupPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricNeighborGroupPatch.Serialization.cs index be9e965de73e..299761729654 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricNeighborGroupPatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricNeighborGroupPatch.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,20 +34,37 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(NetworkFabricNeighborGroupPatch)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) + if (Optional.IsCollectionDefined(Tags)) { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); } - if (Optional.IsDefined(Destination)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("destination"u8); - writer.WriteObjectValue(Destination, options); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } } - writer.WriteEndObject(); } NetworkFabricNeighborGroupPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -71,8 +88,7 @@ internal static NetworkFabricNeighborGroupPatch DeserializeNetworkFabricNeighbor return null; } IDictionary tags = default; - string annotation = default; - NeighborGroupDestination destination = default; + NeighborGroupPatchProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -95,26 +111,9 @@ internal static NetworkFabricNeighborGroupPatch DeserializeNetworkFabricNeighbor { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("destination"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - destination = NeighborGroupDestination.DeserializeNeighborGroupDestination(property0.Value, options); - continue; - } - } + properties = NeighborGroupPatchProperties.DeserializeNeighborGroupPatchProperties(property.Value, options); continue; } if (options.Format != "W") @@ -123,7 +122,7 @@ internal static NetworkFabricNeighborGroupPatch DeserializeNetworkFabricNeighbor } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkFabricNeighborGroupPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, annotation, destination); + return new NetworkFabricNeighborGroupPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricNeighborGroupPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricNeighborGroupPatch.cs index 65104fb236bc..d9a3b09e0016 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricNeighborGroupPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricNeighborGroupPatch.cs @@ -11,27 +11,60 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// The Neighbor Group Patch definition. - public partial class NetworkFabricNeighborGroupPatch : NetworkRackPatch + public partial class NetworkFabricNeighborGroupPatch { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public NetworkFabricNeighborGroupPatch() { + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Resource tags. + /// Neighbor Group Patch properties. /// Keeps track of any properties unknown to the library. - /// Switch configuration description. - /// An array of destination IPv4 Addresses or IPv6 Addresses. - internal NetworkFabricNeighborGroupPatch(IDictionary tags, IDictionary serializedAdditionalRawData, string annotation, NeighborGroupDestination destination) : base(tags, serializedAdditionalRawData) + internal NetworkFabricNeighborGroupPatch(IDictionary tags, NeighborGroupPatchProperties properties, IDictionary serializedAdditionalRawData) { - Annotation = annotation; - Destination = destination; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Switch configuration description. - public string Annotation { get; set; } - /// An array of destination IPv4 Addresses or IPv6 Addresses. - public NeighborGroupDestination Destination { get; set; } + /// Resource tags. + public IDictionary Tags { get; } + /// Neighbor Group Patch properties. + public NeighborGroupPatchProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatch.Serialization.cs index c8b879e5b658..0e5c8f79f173 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatch.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,50 +34,42 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(NetworkFabricPatch)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) - { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); - } - if (Optional.IsDefined(RackCount)) + if (Optional.IsCollectionDefined(Tags)) { - writer.WritePropertyName("rackCount"u8); - writer.WriteNumberValue(RackCount.Value); - } - if (Optional.IsDefined(ServerCountPerRack)) - { - writer.WritePropertyName("serverCountPerRack"u8); - writer.WriteNumberValue(ServerCountPerRack.Value); - } - if (Optional.IsDefined(IPv4Prefix)) - { - writer.WritePropertyName("ipv4Prefix"u8); - writer.WriteStringValue(IPv4Prefix); - } - if (Optional.IsDefined(IPv6Prefix)) - { - writer.WritePropertyName("ipv6Prefix"u8); - writer.WriteStringValue(IPv6Prefix); + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); } - if (Optional.IsDefined(FabricAsn)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("fabricASN"u8); - writer.WriteNumberValue(FabricAsn.Value); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - if (Optional.IsDefined(TerminalServerConfiguration)) + if (Optional.IsDefined(Identity)) { - writer.WritePropertyName("terminalServerConfiguration"u8); - writer.WriteObjectValue(TerminalServerConfiguration, options); + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); } - if (Optional.IsDefined(ManagementNetworkConfiguration)) + if (options.Format != "W" && _serializedAdditionalRawData != null) { - writer.WritePropertyName("managementNetworkConfiguration"u8); - writer.WriteObjectValue(ManagementNetworkConfiguration, options); + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } } - writer.WriteEndObject(); } NetworkFabricPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -101,14 +93,8 @@ internal static NetworkFabricPatch DeserializeNetworkFabricPatch(JsonElement ele return null; } IDictionary tags = default; - string annotation = default; - int? rackCount = default; - int? serverCountPerRack = default; - string ipv4Prefix = default; - string ipv6Prefix = default; - long? fabricAsn = default; - NetworkFabricPatchablePropertiesTerminalServerConfiguration terminalServerConfiguration = default; - ManagementNetworkConfigurationPatchableProperties managementNetworkConfiguration = default; + NetworkFabricPatchProperties properties = default; + ManagedServiceIdentityPatch identity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,72 +117,18 @@ internal static NetworkFabricPatch DeserializeNetworkFabricPatch(JsonElement ele { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) + properties = NetworkFabricPatchProperties.DeserializeNetworkFabricPatchProperties(property.Value, options); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("rackCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - rackCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("serverCountPerRack"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - serverCountPerRack = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("ipv4Prefix"u8)) - { - ipv4Prefix = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("ipv6Prefix"u8)) - { - ipv6Prefix = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("fabricASN"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - fabricAsn = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("terminalServerConfiguration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - terminalServerConfiguration = NetworkFabricPatchablePropertiesTerminalServerConfiguration.DeserializeNetworkFabricPatchablePropertiesTerminalServerConfiguration(property0.Value, options); - continue; - } - if (property0.NameEquals("managementNetworkConfiguration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - managementNetworkConfiguration = ManagementNetworkConfigurationPatchableProperties.DeserializeManagementNetworkConfigurationPatchableProperties(property0.Value, options); - continue; - } + continue; } + identity = ManagedServiceIdentityPatch.DeserializeManagedServiceIdentityPatch(property.Value, options); continue; } if (options.Format != "W") @@ -205,17 +137,7 @@ internal static NetworkFabricPatch DeserializeNetworkFabricPatch(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkFabricPatch( - tags ?? new ChangeTrackingDictionary(), - serializedAdditionalRawData, - annotation, - rackCount, - serverCountPerRack, - ipv4Prefix, - ipv6Prefix, - fabricAsn, - terminalServerConfiguration, - managementNetworkConfiguration); + return new NetworkFabricPatch(tags ?? new ChangeTrackingDictionary(), properties, identity, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatch.cs index 4c87e45e643f..81ec25c99f79 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatch.cs @@ -11,51 +11,64 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// The Network Fabric resource definition. - public partial class NetworkFabricPatch : NetworkRackPatch + public partial class NetworkFabricPatch { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public NetworkFabricPatch() { + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Resource tags. + /// Network Fabric Patch properties. + /// The managed service identities assigned to this resource. /// Keeps track of any properties unknown to the library. - /// Switch configuration description. - /// Number of compute racks associated to Network Fabric. - /// Number of servers.Possible values are from 1-16. - /// IPv4Prefix for Management Network. Example: 10.1.0.0/19. - /// IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. - /// ASN of CE devices for CE/PE connectivity. - /// Network and credentials configuration already applied to terminal server. - /// Configuration to be used to setup the management network. - internal NetworkFabricPatch(IDictionary tags, IDictionary serializedAdditionalRawData, string annotation, int? rackCount, int? serverCountPerRack, string ipv4Prefix, string ipv6Prefix, long? fabricAsn, NetworkFabricPatchablePropertiesTerminalServerConfiguration terminalServerConfiguration, ManagementNetworkConfigurationPatchableProperties managementNetworkConfiguration) : base(tags, serializedAdditionalRawData) + internal NetworkFabricPatch(IDictionary tags, NetworkFabricPatchProperties properties, ManagedServiceIdentityPatch identity, IDictionary serializedAdditionalRawData) { - Annotation = annotation; - RackCount = rackCount; - ServerCountPerRack = serverCountPerRack; - IPv4Prefix = ipv4Prefix; - IPv6Prefix = ipv6Prefix; - FabricAsn = fabricAsn; - TerminalServerConfiguration = terminalServerConfiguration; - ManagementNetworkConfiguration = managementNetworkConfiguration; + Tags = tags; + Properties = properties; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Switch configuration description. - public string Annotation { get; set; } - /// Number of compute racks associated to Network Fabric. - public int? RackCount { get; set; } - /// Number of servers.Possible values are from 1-16. - public int? ServerCountPerRack { get; set; } - /// IPv4Prefix for Management Network. Example: 10.1.0.0/19. - public string IPv4Prefix { get; set; } - /// IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. - public string IPv6Prefix { get; set; } - /// ASN of CE devices for CE/PE connectivity. - public long? FabricAsn { get; set; } - /// Network and credentials configuration already applied to terminal server. - public NetworkFabricPatchablePropertiesTerminalServerConfiguration TerminalServerConfiguration { get; set; } - /// Configuration to be used to setup the management network. - public ManagementNetworkConfigurationPatchableProperties ManagementNetworkConfiguration { get; set; } + /// Resource tags. + public IDictionary Tags { get; } + /// Network Fabric Patch properties. + public NetworkFabricPatchProperties Properties { get; set; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentityPatch Identity { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatchProperties.Serialization.cs new file mode 100644 index 000000000000..4c772439908b --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatchProperties.Serialization.cs @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkFabricPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkFabricPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (Optional.IsDefined(RackCount)) + { + writer.WritePropertyName("rackCount"u8); + writer.WriteNumberValue(RackCount.Value); + } + if (Optional.IsDefined(ServerCountPerRack)) + { + writer.WritePropertyName("serverCountPerRack"u8); + writer.WriteNumberValue(ServerCountPerRack.Value); + } + if (Optional.IsDefined(IPv4Prefix)) + { + writer.WritePropertyName("ipv4Prefix"u8); + writer.WriteStringValue(IPv4Prefix); + } + if (Optional.IsDefined(IPv6Prefix)) + { + writer.WritePropertyName("ipv6Prefix"u8); + writer.WriteStringValue(IPv6Prefix); + } + if (Optional.IsDefined(FabricAsn)) + { + writer.WritePropertyName("fabricASN"u8); + writer.WriteNumberValue(FabricAsn.Value); + } + if (Optional.IsDefined(StorageAccountConfiguration)) + { + writer.WritePropertyName("storageAccountConfiguration"u8); + writer.WriteObjectValue(StorageAccountConfiguration, options); + } + if (Optional.IsDefined(TerminalServerConfiguration)) + { + writer.WritePropertyName("terminalServerConfiguration"u8); + writer.WriteObjectValue(TerminalServerConfiguration, options); + } + if (Optional.IsDefined(ManagementNetworkConfiguration)) + { + writer.WritePropertyName("managementNetworkConfiguration"u8); + writer.WriteObjectValue(ManagementNetworkConfiguration, options); + } + if (Optional.IsDefined(HardwareAlertThreshold)) + { + writer.WritePropertyName("hardwareAlertThreshold"u8); + writer.WriteNumberValue(HardwareAlertThreshold.Value); + } + if (Optional.IsCollectionDefined(ControlPlaneAcls)) + { + writer.WritePropertyName("controlPlaneAcls"u8); + writer.WriteStartArray(); + foreach (var item in ControlPlaneAcls) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(TrustedIPPrefixes)) + { + writer.WritePropertyName("trustedIpPrefixes"u8); + writer.WriteStartArray(); + foreach (var item in TrustedIPPrefixes) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(UniqueRdConfiguration)) + { + writer.WritePropertyName("uniqueRdConfiguration"u8); + writer.WriteObjectValue(UniqueRdConfiguration, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkFabricPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkFabricPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkFabricPatchProperties(document.RootElement, options); + } + + internal static NetworkFabricPatchProperties DeserializeNetworkFabricPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + int? rackCount = default; + int? serverCountPerRack = default; + string ipv4Prefix = default; + string ipv6Prefix = default; + long? fabricAsn = default; + StorageAccountPatchConfiguration storageAccountConfiguration = default; + TerminalServerPatchConfiguration terminalServerConfiguration = default; + ManagementNetworkPatchConfiguration managementNetworkConfiguration = default; + int? hardwareAlertThreshold = default; + IList controlPlaneAcls = default; + IList trustedIPPrefixes = default; + UniqueRouteDistinguisherPatchProperties uniqueRdConfiguration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("rackCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rackCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("serverCountPerRack"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serverCountPerRack = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("ipv4Prefix"u8)) + { + ipv4Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipv6Prefix"u8)) + { + ipv6Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricASN"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fabricAsn = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("storageAccountConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageAccountConfiguration = StorageAccountPatchConfiguration.DeserializeStorageAccountPatchConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("terminalServerConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + terminalServerConfiguration = TerminalServerPatchConfiguration.DeserializeTerminalServerPatchConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("managementNetworkConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managementNetworkConfiguration = ManagementNetworkPatchConfiguration.DeserializeManagementNetworkPatchConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("hardwareAlertThreshold"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hardwareAlertThreshold = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("controlPlaneAcls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + controlPlaneAcls = array; + continue; + } + if (property.NameEquals("trustedIpPrefixes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + trustedIPPrefixes = array; + continue; + } + if (property.NameEquals("uniqueRdConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uniqueRdConfiguration = UniqueRouteDistinguisherPatchProperties.DeserializeUniqueRouteDistinguisherPatchProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkFabricPatchProperties( + annotation, + rackCount, + serverCountPerRack, + ipv4Prefix, + ipv6Prefix, + fabricAsn, + storageAccountConfiguration, + terminalServerConfiguration, + managementNetworkConfiguration, + hardwareAlertThreshold, + controlPlaneAcls ?? new ChangeTrackingList(), + trustedIPPrefixes ?? new ChangeTrackingList(), + uniqueRdConfiguration, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkFabricPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkFabricPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkFabricPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkFabricPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatchProperties.cs new file mode 100644 index 000000000000..5ccd127df8d7 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatchProperties.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Network Fabric Patch properties. + public partial class NetworkFabricPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NetworkFabricPatchProperties() + { + ControlPlaneAcls = new ChangeTrackingList(); + TrustedIPPrefixes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Number of compute racks associated to Network Fabric. + /// Number of servers.Possible values are from 1-16. + /// IPv4Prefix for Management Network. Example: 10.1.0.0/19. + /// IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. + /// ASN of CE devices for CE/PE connectivity. + /// Bring your own storage account configurations for Network Fabric. + /// Network and credentials configuration already applied to terminal server. + /// Configuration to be used to setup the management network. + /// Hardware alert threshold percentage. Possible values are from 20 to 100. + /// Control Plane Access Control List ARM resource IDs. + /// Trusted IP Prefix ARM resource IDs. + /// Unique Route Distinguisher configuration. + /// Keeps track of any properties unknown to the library. + internal NetworkFabricPatchProperties(string annotation, int? rackCount, int? serverCountPerRack, string ipv4Prefix, string ipv6Prefix, long? fabricAsn, StorageAccountPatchConfiguration storageAccountConfiguration, TerminalServerPatchConfiguration terminalServerConfiguration, ManagementNetworkPatchConfiguration managementNetworkConfiguration, int? hardwareAlertThreshold, IList controlPlaneAcls, IList trustedIPPrefixes, UniqueRouteDistinguisherPatchProperties uniqueRdConfiguration, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + RackCount = rackCount; + ServerCountPerRack = serverCountPerRack; + IPv4Prefix = ipv4Prefix; + IPv6Prefix = ipv6Prefix; + FabricAsn = fabricAsn; + StorageAccountConfiguration = storageAccountConfiguration; + TerminalServerConfiguration = terminalServerConfiguration; + ManagementNetworkConfiguration = managementNetworkConfiguration; + HardwareAlertThreshold = hardwareAlertThreshold; + ControlPlaneAcls = controlPlaneAcls; + TrustedIPPrefixes = trustedIPPrefixes; + UniqueRdConfiguration = uniqueRdConfiguration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// Number of compute racks associated to Network Fabric. + public int? RackCount { get; set; } + /// Number of servers.Possible values are from 1-16. + public int? ServerCountPerRack { get; set; } + /// IPv4Prefix for Management Network. Example: 10.1.0.0/19. + public string IPv4Prefix { get; set; } + /// IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. + public string IPv6Prefix { get; set; } + /// ASN of CE devices for CE/PE connectivity. + public long? FabricAsn { get; set; } + /// Bring your own storage account configurations for Network Fabric. + public StorageAccountPatchConfiguration StorageAccountConfiguration { get; set; } + /// Network and credentials configuration already applied to terminal server. + public TerminalServerPatchConfiguration TerminalServerConfiguration { get; set; } + /// Configuration to be used to setup the management network. + public ManagementNetworkPatchConfiguration ManagementNetworkConfiguration { get; set; } + /// Hardware alert threshold percentage. Possible values are from 20 to 100. + public int? HardwareAlertThreshold { get; set; } + /// Control Plane Access Control List ARM resource IDs. + public IList ControlPlaneAcls { get; } + /// Trusted IP Prefix ARM resource IDs. + public IList TrustedIPPrefixes { get; } + /// Unique Route Distinguisher configuration. + public UniqueRouteDistinguisherPatchProperties UniqueRdConfiguration { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatchablePropertiesTerminalServerConfiguration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatchablePropertiesTerminalServerConfiguration.cs deleted file mode 100644 index f9d0270957a0..000000000000 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatchablePropertiesTerminalServerConfiguration.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ManagedNetworkFabric.Models -{ - /// Network and credentials configuration already applied to terminal server. - public partial class NetworkFabricPatchablePropertiesTerminalServerConfiguration : TerminalServerPatchableProperties - { - /// Initializes a new instance of . - public NetworkFabricPatchablePropertiesTerminalServerConfiguration() - { - } - - /// Initializes a new instance of . - /// Username for the terminal server connection. - /// Password for the terminal server connection. - /// Serial Number of Terminal server. - /// Keeps track of any properties unknown to the library. - /// IPv4 Address Prefix. - /// IPv6 Address Prefix. - /// Secondary IPv4 Address Prefix. - /// Secondary IPv6 Address Prefix. - internal NetworkFabricPatchablePropertiesTerminalServerConfiguration(string username, string password, string serialNumber, IDictionary serializedAdditionalRawData, string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix) : base(username, password, serialNumber, serializedAdditionalRawData) - { - PrimaryIPv4Prefix = primaryIPv4Prefix; - PrimaryIPv6Prefix = primaryIPv6Prefix; - SecondaryIPv4Prefix = secondaryIPv4Prefix; - SecondaryIPv6Prefix = secondaryIPv6Prefix; - } - - /// IPv4 Address Prefix. - public string PrimaryIPv4Prefix { get; set; } - /// IPv6 Address Prefix. - public string PrimaryIPv6Prefix { get; set; } - /// Secondary IPv4 Address Prefix. - public string SecondaryIPv4Prefix { get; set; } - /// Secondary IPv6 Address Prefix. - public string SecondaryIPv6Prefix { get; set; } - } -} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPortCondition.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPortCondition.cs index a920a04a3ad0..140fd834fe4a 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPortCondition.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPortCondition.cs @@ -43,7 +43,7 @@ public partial class NetworkFabricPortCondition /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . /// Layer4 protocol type that needs to be matched. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPortType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPortType.cs index 2076750dc0a6..e9c0087bc8fb 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPortType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPortType.cs @@ -24,11 +24,14 @@ public NetworkFabricPortType(string value) private const string SourcePortValue = "SourcePort"; private const string DestinationPortValue = "DestinationPort"; + private const string BidirectionalValue = "Bidirectional"; - /// SourcePort. + /// PortType SourcePort. public static NetworkFabricPortType SourcePort { get; } = new NetworkFabricPortType(SourcePortValue); - /// DestinationPort. + /// PortType DestinationPort. public static NetworkFabricPortType DestinationPort { get; } = new NetworkFabricPortType(DestinationPortValue); + /// PortType Bidirectional. + public static NetworkFabricPortType Bidirectional { get; } = new NetworkFabricPortType(BidirectionalValue); /// Determines if two values are the same. public static bool operator ==(NetworkFabricPortType left, NetworkFabricPortType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricProvisioningState.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricProvisioningState.cs index 31924afd0f15..b544edfe729b 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricProvisioningState.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricProvisioningState.cs @@ -29,17 +29,17 @@ public NetworkFabricProvisioningState(string value) private const string FailedValue = "Failed"; private const string CanceledValue = "Canceled"; - /// Accepted. + /// Accepted Provisioning State. public static NetworkFabricProvisioningState Accepted { get; } = new NetworkFabricProvisioningState(AcceptedValue); - /// Succeeded. + /// Succeeded Provisioning State. public static NetworkFabricProvisioningState Succeeded { get; } = new NetworkFabricProvisioningState(SucceededValue); - /// Updating. + /// Updating Provisioning State. public static NetworkFabricProvisioningState Updating { get; } = new NetworkFabricProvisioningState(UpdatingValue); - /// Deleting. + /// Deleting Provisioning State. public static NetworkFabricProvisioningState Deleting { get; } = new NetworkFabricProvisioningState(DeletingValue); - /// Failed. + /// Failed Provisioning State. public static NetworkFabricProvisioningState Failed { get; } = new NetworkFabricProvisioningState(FailedValue); - /// Canceled. + /// Canceled Provisioning State. public static NetworkFabricProvisioningState Canceled { get; } = new NetworkFabricProvisioningState(CanceledValue); /// Determines if two values are the same. public static bool operator ==(NetworkFabricProvisioningState left, NetworkFabricProvisioningState right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyPatch.Serialization.cs index 3fdbc296ddad..8c568cd3dfb1 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyPatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyPatch.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,25 +34,37 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(NetworkFabricRoutePolicyPatch)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(DefaultAction)) + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("defaultAction"u8); - writer.WriteStringValue(DefaultAction.Value.ToString()); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - if (Optional.IsCollectionDefined(Statements)) + if (options.Format != "W" && _serializedAdditionalRawData != null) { - writer.WritePropertyName("statements"u8); - writer.WriteStartArray(); - foreach (var item in Statements) + foreach (var item in _serializedAdditionalRawData) { - writer.WriteObjectValue(item, options); + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif } - writer.WriteEndArray(); } - writer.WriteEndObject(); } NetworkFabricRoutePolicyPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -76,8 +88,7 @@ internal static NetworkFabricRoutePolicyPatch DeserializeNetworkFabricRoutePolic return null; } IDictionary tags = default; - CommunityActionType? defaultAction = default; - IList statements = default; + RoutePolicyPatchableProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -100,35 +111,9 @@ internal static NetworkFabricRoutePolicyPatch DeserializeNetworkFabricRoutePolic { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("defaultAction"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - defaultAction = new CommunityActionType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("statements"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(RoutePolicyStatementProperties.DeserializeRoutePolicyStatementProperties(item, options)); - } - statements = array; - continue; - } - } + properties = RoutePolicyPatchableProperties.DeserializeRoutePolicyPatchableProperties(property.Value, options); continue; } if (options.Format != "W") @@ -137,7 +122,7 @@ internal static NetworkFabricRoutePolicyPatch DeserializeNetworkFabricRoutePolic } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkFabricRoutePolicyPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, defaultAction, statements ?? new ChangeTrackingList()); + return new NetworkFabricRoutePolicyPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyPatch.cs index a92349aa6d0e..103c23a5fe00 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricRoutePolicyPatch.cs @@ -11,28 +11,60 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// The Route Policy patch resource definition. - public partial class NetworkFabricRoutePolicyPatch : NetworkRackPatch + public partial class NetworkFabricRoutePolicyPatch { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public NetworkFabricRoutePolicyPatch() { - Statements = new ChangeTrackingList(); + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Resource tags. + /// The RoutePolicy patchable properties. /// Keeps track of any properties unknown to the library. - /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. - /// Route Policy statements. - internal NetworkFabricRoutePolicyPatch(IDictionary tags, IDictionary serializedAdditionalRawData, CommunityActionType? defaultAction, IList statements) : base(tags, serializedAdditionalRawData) + internal NetworkFabricRoutePolicyPatch(IDictionary tags, RoutePolicyPatchableProperties properties, IDictionary serializedAdditionalRawData) { - DefaultAction = defaultAction; - Statements = statements; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. - public CommunityActionType? DefaultAction { get; set; } - /// Route Policy statements. - public IList Statements { get; } + /// Resource tags. + public IDictionary Tags { get; } + /// The RoutePolicy patchable properties. + public RoutePolicyPatchableProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRacksListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkuListResult.Serialization.cs similarity index 61% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRacksListResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkuListResult.Serialization.cs index 2c8fa45910a5..610d6703dc40 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRacksListResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkuListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class NetworkRacksListResult : IUtf8JsonSerializable, IJsonModel + internal partial class NetworkFabricSkuListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkRacksListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NetworkFabricSkuListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NetworkRacksListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NetworkFabricSkuListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkRacksListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NetworkFabricSkuListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkRacksListResult(document.RootElement, options); + return DeserializeNetworkFabricSkuListResult(document.RootElement, options); } - internal static NetworkRacksListResult DeserializeNetworkRacksListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static NetworkFabricSkuListResult DeserializeNetworkFabricSkuListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,29 +83,29 @@ internal static NetworkRacksListResult DeserializeNetworkRacksListResult(JsonEle { return null; } - IReadOnlyList value = default; - string nextLink = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(NetworkRackData.DeserializeNetworkRackData(item, options)); + array.Add(NetworkFabricSkuData.DeserializeNetworkFabricSkuData(item, options)); } value = array; continue; } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +114,38 @@ internal static NetworkRacksListResult DeserializeNetworkRacksListResult(JsonEle } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkRacksListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NetworkFabricSkuListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(NetworkRacksListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkFabricSkuListResult)} does not support writing '{options.Format}' format."); } } - NetworkRacksListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NetworkFabricSkuListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkRacksListResult(document.RootElement, options); + return DeserializeNetworkFabricSkuListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NetworkRacksListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkFabricSkuListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkuListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkuListResult.cs new file mode 100644 index 000000000000..7be35c5580b7 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkuListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a NetworkFabricSku list operation. + internal partial class NetworkFabricSkuListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The NetworkFabricSku items on this page. + /// is null. + internal NetworkFabricSkuListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The NetworkFabricSku items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NetworkFabricSkuListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkFabricSkuListResult() + { + } + + /// The NetworkFabricSku items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkuProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkuProperties.Serialization.cs new file mode 100644 index 000000000000..467f3fe27c0a --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkuProperties.Serialization.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkFabricSkuProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkFabricSkuProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(SkuType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(SkuType.Value.ToString()); + } + if (Optional.IsDefined(MaxComputeRacks)) + { + writer.WritePropertyName("maxComputeRacks"u8); + writer.WriteNumberValue(MaxComputeRacks.Value); + } + if (Optional.IsDefined(MaximumServerCount)) + { + writer.WritePropertyName("maximumServerCount"u8); + writer.WriteNumberValue(MaximumServerCount.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(SupportedVersions)) + { + writer.WritePropertyName("supportedVersions"u8); + writer.WriteStartArray(); + foreach (var item in SupportedVersions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Details)) + { + writer.WritePropertyName("details"u8); + writer.WriteStringValue(Details); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkFabricSkuProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkFabricSkuProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkFabricSkuProperties(document.RootElement, options); + } + + internal static NetworkFabricSkuProperties DeserializeNetworkFabricSkuProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NetworkFabricSkuType? type = default; + int? maxComputeRacks = default; + int? maximumServerCount = default; + IReadOnlyList supportedVersions = default; + string details = default; + NetworkFabricProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new NetworkFabricSkuType(property.Value.GetString()); + continue; + } + if (property.NameEquals("maxComputeRacks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxComputeRacks = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maximumServerCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maximumServerCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("supportedVersions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + supportedVersions = array; + continue; + } + if (property.NameEquals("details"u8)) + { + details = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NetworkFabricProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkFabricSkuProperties( + type, + maxComputeRacks, + maximumServerCount, + supportedVersions ?? new ChangeTrackingList(), + details, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkFabricSkuProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkFabricSkuProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkFabricSkuProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkFabricSkuProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkuProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkuProperties.cs new file mode 100644 index 000000000000..1cd30bac32c9 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkuProperties.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Network Fabric SKU Properties define properties of the resource. + public partial class NetworkFabricSkuProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NetworkFabricSkuProperties() + { + SupportedVersions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Type of Network Fabric SKU. + /// Maximum number of compute racks available for this Network Fabric SKU. The value of max count racks is 4 for 4 rack SKU and 8 for 8 rack SKU. + /// Maximum number of servers available for this Network Fabric SKU. + /// List of supported Network Fabric SKU versions. + /// URL providing detailed configuration of the fabric SKU. + /// Provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal NetworkFabricSkuProperties(NetworkFabricSkuType? skuType, int? maxComputeRacks, int? maximumServerCount, IReadOnlyList supportedVersions, string details, NetworkFabricProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + SkuType = skuType; + MaxComputeRacks = maxComputeRacks; + MaximumServerCount = maximumServerCount; + SupportedVersions = supportedVersions; + Details = details; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Type of Network Fabric SKU. + public NetworkFabricSkuType? SkuType { get; } + /// Maximum number of compute racks available for this Network Fabric SKU. The value of max count racks is 4 for 4 rack SKU and 8 for 8 rack SKU. + public int? MaxComputeRacks { get; set; } + /// Maximum number of servers available for this Network Fabric SKU. + public int? MaximumServerCount { get; set; } + /// List of supported Network Fabric SKU versions. + public IReadOnlyList SupportedVersions { get; } + /// URL providing detailed configuration of the fabric SKU. + public string Details { get; } + /// Provisioning state of the resource. + public NetworkFabricProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkuType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkuType.cs index 3eb42b333909..9ce5a8b76782 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkuType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricSkuType.cs @@ -25,9 +25,9 @@ public NetworkFabricSkuType(string value) private const string SingleRackValue = "SingleRack"; private const string MultiRackValue = "MultiRack"; - /// SingleRack. + /// FabricSkuType-SingleRack. public static NetworkFabricSkuType SingleRack { get; } = new NetworkFabricSkuType(SingleRackValue); - /// MultiRack. + /// FabricSkuType-MultiRack. public static NetworkFabricSkuType MultiRack { get; } = new NetworkFabricSkuType(MultiRackValue); /// Determines if two values are the same. public static bool operator ==(NetworkFabricSkuType left, NetworkFabricSkuType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricUpgradeAction.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricUpgradeAction.cs new file mode 100644 index 000000000000..faaaec7a1570 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricUpgradeAction.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Action to be performed while upgrading the fabric. + public readonly partial struct NetworkFabricUpgradeAction : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public NetworkFabricUpgradeAction(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StartValue = "Start"; + private const string CompleteValue = "Complete"; + + /// UpgradeAction-Start. + public static NetworkFabricUpgradeAction Start { get; } = new NetworkFabricUpgradeAction(StartValue); + /// UpgradeAction -Complete. + public static NetworkFabricUpgradeAction Complete { get; } = new NetworkFabricUpgradeAction(CompleteValue); + /// Determines if two values are the same. + public static bool operator ==(NetworkFabricUpgradeAction left, NetworkFabricUpgradeAction right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NetworkFabricUpgradeAction left, NetworkFabricUpgradeAction right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator NetworkFabricUpgradeAction(string value) => new NetworkFabricUpgradeAction(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NetworkFabricUpgradeAction other && Equals(other); + /// + public bool Equals(NetworkFabricUpgradeAction other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricValidateAction.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricValidateAction.cs index e849f3503024..3708beb8fb9a 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricValidateAction.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricValidateAction.cs @@ -26,11 +26,11 @@ public NetworkFabricValidateAction(string value) private const string ConfigurationValue = "Configuration"; private const string ConnectivityValue = "Connectivity"; - /// Cabling. + /// ValidateAction-Cabling. public static NetworkFabricValidateAction Cabling { get; } = new NetworkFabricValidateAction(CablingValue); - /// Configuration. + /// ValidateAction-Configuration. public static NetworkFabricValidateAction Configuration { get; } = new NetworkFabricValidateAction(ConfigurationValue); - /// Connectivity. + /// ValidateAction-Connectivity. public static NetworkFabricValidateAction Connectivity { get; } = new NetworkFabricValidateAction(ConnectivityValue); /// Determines if two values are the same. public static bool operator ==(NetworkFabricValidateAction left, NetworkFabricValidateAction right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceInterfacesList.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkInterfaceListResult.Serialization.cs similarity index 63% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceInterfacesList.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkInterfaceListResult.Serialization.cs index 012348de36de..ed120cfe5cc5 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceInterfacesList.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkInterfaceListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class NetworkDeviceInterfacesList : IUtf8JsonSerializable, IJsonModel + internal partial class NetworkInterfaceListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkDeviceInterfacesList)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NetworkInterfaceListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NetworkDeviceInterfacesList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NetworkInterfaceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkDeviceInterfacesList)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NetworkInterfaceListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkDeviceInterfacesList(document.RootElement, options); + return DeserializeNetworkInterfaceListResult(document.RootElement, options); } - internal static NetworkDeviceInterfacesList DeserializeNetworkDeviceInterfacesList(JsonElement element, ModelReaderWriterOptions options = null) + internal static NetworkInterfaceListResult DeserializeNetworkInterfaceListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -87,17 +84,13 @@ internal static NetworkDeviceInterfacesList DeserializeNetworkDeviceInterfacesLi return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static NetworkDeviceInterfacesList DeserializeNetworkDeviceInterfacesLi } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +114,38 @@ internal static NetworkDeviceInterfacesList DeserializeNetworkDeviceInterfacesLi } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkDeviceInterfacesList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NetworkInterfaceListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(NetworkDeviceInterfacesList)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkInterfaceListResult)} does not support writing '{options.Format}' format."); } } - NetworkDeviceInterfacesList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NetworkInterfaceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkDeviceInterfacesList(document.RootElement, options); + return DeserializeNetworkInterfaceListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NetworkDeviceInterfacesList)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkInterfaceListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkInterfaceListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkInterfaceListResult.cs new file mode 100644 index 000000000000..55733d460f81 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkInterfaceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a NetworkInterface list operation. + internal partial class NetworkInterfaceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The NetworkInterface items on this page. + /// is null. + internal NetworkInterfaceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The NetworkInterface items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NetworkInterfaceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkInterfaceListResult() + { + } + + /// The NetworkInterface items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkInterfacePatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkInterfacePatchProperties.Serialization.cs new file mode 100644 index 000000000000..0aadfeac3464 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkInterfacePatchProperties.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkInterfacePatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkInterfacePatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(AdditionalDescription)) + { + writer.WritePropertyName("additionalDescription"u8); + writer.WriteStringValue(AdditionalDescription); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkInterfacePatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkInterfacePatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkInterfacePatchProperties(document.RootElement, options); + } + + internal static NetworkInterfacePatchProperties DeserializeNetworkInterfacePatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + string description = default; + string additionalDescription = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("additionalDescription"u8)) + { + additionalDescription = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkInterfacePatchProperties(annotation, description, additionalDescription, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkInterfacePatchProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkInterfacePatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkInterfacePatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkInterfacePatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkInterfacePatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkInterfacePatchProperties.cs new file mode 100644 index 000000000000..b95a4dff6e41 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkInterfacePatchProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Network Interface Patch properties. + public partial class NetworkInterfacePatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NetworkInterfacePatchProperties() + { + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Description of the interface. + /// Additional description of the interface. + /// Keeps track of any properties unknown to the library. + internal NetworkInterfacePatchProperties(string annotation, string description, string additionalDescription, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + Description = description; + AdditionalDescription = additionalDescription; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// Description of the interface. + public string Description { get; set; } + /// Additional description of the interface. + public string AdditionalDescription { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricsListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorListResult.Serialization.cs similarity index 67% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricsListResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorListResult.Serialization.cs index e5cb85ae9670..7831d077002d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricsListResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class NetworkFabricsListResult : IUtf8JsonSerializable, IJsonModel + internal partial class NetworkMonitorListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkFabricsListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NetworkMonitorListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NetworkFabricsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NetworkMonitorListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkFabricsListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NetworkMonitorListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkFabricsListResult(document.RootElement, options); + return DeserializeNetworkMonitorListResult(document.RootElement, options); } - internal static NetworkFabricsListResult DeserializeNetworkFabricsListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static NetworkMonitorListResult DeserializeNetworkMonitorListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,29 +83,29 @@ internal static NetworkFabricsListResult DeserializeNetworkFabricsListResult(Jso { return null; } - IReadOnlyList value = default; - string nextLink = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(NetworkFabricData.DeserializeNetworkFabricData(item, options)); + array.Add(NetworkMonitorData.DeserializeNetworkMonitorData(item, options)); } value = array; continue; } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +114,38 @@ internal static NetworkFabricsListResult DeserializeNetworkFabricsListResult(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkFabricsListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NetworkMonitorListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(NetworkFabricsListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkMonitorListResult)} does not support writing '{options.Format}' format."); } } - NetworkFabricsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NetworkMonitorListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkFabricsListResult(document.RootElement, options); + return DeserializeNetworkMonitorListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NetworkFabricsListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkMonitorListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorListResult.cs new file mode 100644 index 000000000000..81fc7d36c887 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a NetworkMonitor list operation. + internal partial class NetworkMonitorListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The NetworkMonitor items on this page. + /// is null. + internal NetworkMonitorListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The NetworkMonitor items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NetworkMonitorListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkMonitorListResult() + { + } + + /// The NetworkMonitor items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorPatch.Serialization.cs new file mode 100644 index 000000000000..596f869896be --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorPatch.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkMonitorPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkMonitorPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkMonitorPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkMonitorPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkMonitorPatch(document.RootElement, options); + } + + internal static NetworkMonitorPatch DeserializeNetworkMonitorPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + NetworkMonitorPatchProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = NetworkMonitorPatchProperties.DeserializeNetworkMonitorPatchProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkMonitorPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkMonitorPatch)} does not support writing '{options.Format}' format."); + } + } + + NetworkMonitorPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkMonitorPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkMonitorPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorPatch.cs new file mode 100644 index 000000000000..b0a853dc5543 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorPatch.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The Network Monitor Patch resource definition. + public partial class NetworkMonitorPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NetworkMonitorPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Network Monitor Patch properties. + /// Keeps track of any properties unknown to the library. + internal NetworkMonitorPatch(IDictionary tags, NetworkMonitorPatchProperties properties, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// Network Monitor Patch properties. + internal NetworkMonitorPatchProperties Properties { get; set; } + /// BGP Monitoring Protocol (BMP) Configurations for the Network Monitor. + public BmpConfigurationPatchProperties NetworkMonitorPatchBmpConfiguration + { + get => Properties is null ? default : Properties.BmpConfiguration; + set + { + if (Properties is null) + Properties = new NetworkMonitorPatchProperties(); + Properties.BmpConfiguration = value; + } + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorPatchProperties.Serialization.cs new file mode 100644 index 000000000000..d4ce81b8af16 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorPatchProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class NetworkMonitorPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkMonitorPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(BmpConfiguration)) + { + writer.WritePropertyName("bmpConfiguration"u8); + writer.WriteObjectValue(BmpConfiguration, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkMonitorPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkMonitorPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkMonitorPatchProperties(document.RootElement, options); + } + + internal static NetworkMonitorPatchProperties DeserializeNetworkMonitorPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BmpConfigurationPatchProperties bmpConfiguration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("bmpConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bmpConfiguration = BmpConfigurationPatchProperties.DeserializeBmpConfigurationPatchProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkMonitorPatchProperties(bmpConfiguration, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkMonitorPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkMonitorPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkMonitorPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkMonitorPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricsListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorPatchProperties.cs similarity index 68% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricsListResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorPatchProperties.cs index ba21e2fe48ce..ec25c9d2a061 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricsListResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorPatchProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of Network Fabrics. - internal partial class NetworkFabricsListResult + /// The Network Monitor Patch Properties. + internal partial class NetworkMonitorPatchProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,21 @@ internal partial class NetworkFabricsListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal NetworkFabricsListResult() + /// Initializes a new instance of . + public NetworkMonitorPatchProperties() { - Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of Network Fabric resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// BGP Monitoring Protocol (BMP) Configurations for the Network Monitor. /// Keeps track of any properties unknown to the library. - internal NetworkFabricsListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NetworkMonitorPatchProperties(BmpConfigurationPatchProperties bmpConfiguration, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + BmpConfiguration = bmpConfiguration; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of Network Fabric resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// BGP Monitoring Protocol (BMP) Configurations for the Network Monitor. + public BmpConfigurationPatchProperties BmpConfiguration { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorProperties.Serialization.cs new file mode 100644 index 000000000000..508d6d27c123 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorProperties.Serialization.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkMonitorProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkMonitorProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (Optional.IsDefined(BmpConfiguration)) + { + writer.WritePropertyName("bmpConfiguration"u8); + writer.WriteObjectValue(BmpConfiguration, options); + } + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } + if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) + { + writer.WritePropertyName("configurationState"u8); + writer.WriteStringValue(ConfigurationState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) + { + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkMonitorProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkMonitorProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkMonitorProperties(document.RootElement, options); + } + + internal static NetworkMonitorProperties DeserializeNetworkMonitorProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + BmpConfigurationProperties bmpConfiguration = default; + LastOperationProperties lastOperation = default; + NetworkFabricConfigurationState? configurationState = default; + NetworkFabricProvisioningState? provisioningState = default; + NetworkFabricAdministrativeState? administrativeState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("bmpConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bmpConfiguration = BmpConfigurationProperties.DeserializeBmpConfigurationProperties(property.Value, options); + continue; + } + if (property.NameEquals("lastOperation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property.Value, options); + continue; + } + if (property.NameEquals("configurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configurationState = new NetworkFabricConfigurationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NetworkFabricProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("administrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeState = new NetworkFabricAdministrativeState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkMonitorProperties( + annotation, + bmpConfiguration, + lastOperation, + configurationState, + provisioningState, + administrativeState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkMonitorProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkMonitorProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkMonitorProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkMonitorProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorProperties.cs new file mode 100644 index 000000000000..b0f5fb8eb399 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkMonitorProperties.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Network Monitor Properties defines the properties of the resource. + public partial class NetworkMonitorProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NetworkMonitorProperties() + { + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// BMP Configurations for the Network Fabric. + /// Details of the last operation performed on the resource. + /// Configuration state of the resource. + /// Provides you the latest status of the NetworkMonitor resource. + /// Administrative state of the resource. + /// Keeps track of any properties unknown to the library. + internal NetworkMonitorProperties(string annotation, BmpConfigurationProperties bmpConfiguration, LastOperationProperties lastOperation, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + BmpConfiguration = bmpConfiguration; + LastOperation = lastOperation; + ConfigurationState = configurationState; + ProvisioningState = provisioningState; + AdministrativeState = administrativeState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// BMP Configurations for the Network Fabric. + public BmpConfigurationProperties BmpConfiguration { get; set; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + + /// Configuration state of the resource. + public NetworkFabricConfigurationState? ConfigurationState { get; } + /// Provides you the latest status of the NetworkMonitor resource. + public NetworkFabricProvisioningState? ProvisioningState { get; } + /// Administrative state of the resource. + public NetworkFabricAdministrativeState? AdministrativeState { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokersListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerListResult.Serialization.cs similarity index 63% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokersListResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerListResult.Serialization.cs index b78ac2c2db73..ecee87f01912 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokersListResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class NetworkPacketBrokersListResult : IUtf8JsonSerializable, IJsonModel + internal partial class NetworkPacketBrokerListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkPacketBrokersListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NetworkPacketBrokerListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NetworkPacketBrokersListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NetworkPacketBrokerListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkPacketBrokersListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NetworkPacketBrokerListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkPacketBrokersListResult(document.RootElement, options); + return DeserializeNetworkPacketBrokerListResult(document.RootElement, options); } - internal static NetworkPacketBrokersListResult DeserializeNetworkPacketBrokersListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static NetworkPacketBrokerListResult DeserializeNetworkPacketBrokerListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -87,17 +84,13 @@ internal static NetworkPacketBrokersListResult DeserializeNetworkPacketBrokersLi return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static NetworkPacketBrokersListResult DeserializeNetworkPacketBrokersLi } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +114,38 @@ internal static NetworkPacketBrokersListResult DeserializeNetworkPacketBrokersLi } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkPacketBrokersListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NetworkPacketBrokerListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(NetworkPacketBrokersListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkPacketBrokerListResult)} does not support writing '{options.Format}' format."); } } - NetworkPacketBrokersListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NetworkPacketBrokerListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkPacketBrokersListResult(document.RootElement, options); + return DeserializeNetworkPacketBrokerListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NetworkPacketBrokersListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkPacketBrokerListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerListResult.cs new file mode 100644 index 000000000000..40051731c0dd --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a NetworkPacketBroker list operation. + internal partial class NetworkPacketBrokerListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The NetworkPacketBroker items on this page. + /// is null. + internal NetworkPacketBrokerListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The NetworkPacketBroker items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NetworkPacketBrokerListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkPacketBrokerListResult() + { + } + + /// The NetworkPacketBroker items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerPatch.Serialization.cs index 0886f30ceb03..33e5607abd3b 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerPatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerPatch.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,7 +34,32 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(NetworkPacketBrokerPatch)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } NetworkPacketBrokerPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerPatch.cs index 08196a2e54ee..7a16c9c6af45 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerPatch.cs @@ -11,18 +11,56 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// The NetworkPacketBroker patch resource definition. - public partial class NetworkPacketBrokerPatch : NetworkRackPatch + public partial class NetworkPacketBrokerPatch { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public NetworkPacketBrokerPatch() { + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Resource tags. /// Keeps track of any properties unknown to the library. - internal NetworkPacketBrokerPatch(IDictionary tags, IDictionary serializedAdditionalRawData) : base(tags, serializedAdditionalRawData) + internal NetworkPacketBrokerPatch(IDictionary tags, IDictionary serializedAdditionalRawData) { + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; } + + /// Resource tags. + public IDictionary Tags { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerProperties.Serialization.cs new file mode 100644 index 000000000000..eec0472bfe47 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerProperties.Serialization.cs @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkPacketBrokerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkPacketBrokerProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("networkFabricId"u8); + writer.WriteStringValue(NetworkFabricId); + if (options.Format != "W" && Optional.IsCollectionDefined(NetworkDeviceIds)) + { + writer.WritePropertyName("networkDeviceIds"u8); + writer.WriteStartArray(); + foreach (var item in NetworkDeviceIds) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(SourceInterfaceIds)) + { + writer.WritePropertyName("sourceInterfaceIds"u8); + writer.WriteStartArray(); + foreach (var item in SourceInterfaceIds) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(NetworkTapIds)) + { + writer.WritePropertyName("networkTapIds"u8); + writer.WriteStartArray(); + foreach (var item in NetworkTapIds) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(NeighborGroupIds)) + { + writer.WritePropertyName("neighborGroupIds"u8); + writer.WriteStartArray(); + foreach (var item in NeighborGroupIds) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkPacketBrokerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkPacketBrokerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkPacketBrokerProperties(document.RootElement, options); + } + + internal static NetworkPacketBrokerProperties DeserializeNetworkPacketBrokerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier networkFabricId = default; + IReadOnlyList networkDeviceIds = default; + IReadOnlyList sourceInterfaceIds = default; + IReadOnlyList networkTapIds = default; + IReadOnlyList neighborGroupIds = default; + LastOperationProperties lastOperation = default; + NetworkFabricProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("networkFabricId"u8)) + { + networkFabricId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("networkDeviceIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + networkDeviceIds = array; + continue; + } + if (property.NameEquals("sourceInterfaceIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + sourceInterfaceIds = array; + continue; + } + if (property.NameEquals("networkTapIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + networkTapIds = array; + continue; + } + if (property.NameEquals("neighborGroupIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + neighborGroupIds = array; + continue; + } + if (property.NameEquals("lastOperation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NetworkFabricProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkPacketBrokerProperties( + networkFabricId, + networkDeviceIds ?? new ChangeTrackingList(), + sourceInterfaceIds ?? new ChangeTrackingList(), + networkTapIds ?? new ChangeTrackingList(), + neighborGroupIds ?? new ChangeTrackingList(), + lastOperation, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkPacketBrokerProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkPacketBrokerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkPacketBrokerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkPacketBrokerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerProperties.cs new file mode 100644 index 000000000000..4f731c429a31 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkPacketBrokerProperties.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Network Packet Broker Properties defines the properties of the resource. + public partial class NetworkPacketBrokerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// ARM resource ID of the Network Fabric. + /// is null. + public NetworkPacketBrokerProperties(ResourceIdentifier networkFabricId) + { + Argument.AssertNotNull(networkFabricId, nameof(networkFabricId)); + + NetworkFabricId = networkFabricId; + NetworkDeviceIds = new ChangeTrackingList(); + SourceInterfaceIds = new ChangeTrackingList(); + NetworkTapIds = new ChangeTrackingList(); + NeighborGroupIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// ARM resource ID of the Network Fabric. + /// List of ARM resource IDs of Network Devices [NPB]. + /// List of network interfaces across NPB devices that are used to mirror source traffic. + /// List of network Tap IDs configured on NPB. + /// List of neighbor group IDs configured on NPB. + /// Details of the last operation performed on the resource. + /// Provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal NetworkPacketBrokerProperties(ResourceIdentifier networkFabricId, IReadOnlyList networkDeviceIds, IReadOnlyList sourceInterfaceIds, IReadOnlyList networkTapIds, IReadOnlyList neighborGroupIds, LastOperationProperties lastOperation, NetworkFabricProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + NetworkFabricId = networkFabricId; + NetworkDeviceIds = networkDeviceIds; + SourceInterfaceIds = sourceInterfaceIds; + NetworkTapIds = networkTapIds; + NeighborGroupIds = neighborGroupIds; + LastOperation = lastOperation; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkPacketBrokerProperties() + { + } + + /// ARM resource ID of the Network Fabric. + public ResourceIdentifier NetworkFabricId { get; set; } + /// List of ARM resource IDs of Network Devices [NPB]. + public IReadOnlyList NetworkDeviceIds { get; } + /// List of network interfaces across NPB devices that are used to mirror source traffic. + public IReadOnlyList SourceInterfaceIds { get; } + /// List of network Tap IDs configured on NPB. + public IReadOnlyList NetworkTapIds { get; } + /// List of neighbor group IDs configured on NPB. + public IReadOnlyList NeighborGroupIds { get; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + + /// Provisioning state of the resource. + public NetworkFabricProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapsListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackListResult.Serialization.cs similarity index 68% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapsListResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackListResult.Serialization.cs index 242ef3522bc2..81d3e91db09b 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapsListResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class NetworkTapsListResult : IUtf8JsonSerializable, IJsonModel + internal partial class NetworkRackListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkTapsListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NetworkRackListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NetworkTapsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NetworkRackListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkTapsListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NetworkRackListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkTapsListResult(document.RootElement, options); + return DeserializeNetworkRackListResult(document.RootElement, options); } - internal static NetworkTapsListResult DeserializeNetworkTapsListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static NetworkRackListResult DeserializeNetworkRackListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,29 +83,29 @@ internal static NetworkTapsListResult DeserializeNetworkTapsListResult(JsonEleme { return null; } - IReadOnlyList value = default; - string nextLink = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(NetworkTapData.DeserializeNetworkTapData(item, options)); + array.Add(NetworkRackData.DeserializeNetworkRackData(item, options)); } value = array; continue; } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +114,38 @@ internal static NetworkTapsListResult DeserializeNetworkTapsListResult(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkTapsListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NetworkRackListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(NetworkTapsListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkRackListResult)} does not support writing '{options.Format}' format."); } } - NetworkTapsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NetworkRackListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkTapsListResult(document.RootElement, options); + return DeserializeNetworkRackListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NetworkTapsListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkRackListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllersListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackListResult.cs similarity index 61% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllersListResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackListResult.cs index 73099bee79ad..7be5be1c6e81 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricControllersListResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackListResult.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of Network Fabric Controllers. - internal partial class NetworkFabricControllersListResult + /// The response of a NetworkRack list operation. + internal partial class NetworkRackListResult { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +46,35 @@ internal partial class NetworkFabricControllersListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal NetworkFabricControllersListResult() + /// Initializes a new instance of . + /// The NetworkRack items on this page. + /// is null. + internal NetworkRackListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } - /// Initializes a new instance of . - /// List of Network Fabric Controller resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// The NetworkRack items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal NetworkFabricControllersListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NetworkRackListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of Network Fabric Controller resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// Initializes a new instance of for deserialization. + internal NetworkRackListResult() + { + } + + /// The NetworkRack items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackPatch.cs index 63083011b9ae..839d4b523bbc 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackPatch.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// Base tracked resource type for PATCH updates. + /// Network Rack patch resource definition. public partial class NetworkRackPatch { /// @@ -43,7 +43,7 @@ public partial class NetworkRackPatch /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . public NetworkRackPatch() diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackProperties.Serialization.cs new file mode 100644 index 000000000000..e20a21e041a3 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackProperties.Serialization.cs @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkRackProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkRackProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (Optional.IsDefined(NetworkRackType)) + { + writer.WritePropertyName("networkRackType"u8); + writer.WriteStringValue(NetworkRackType.Value.ToString()); + } + writer.WritePropertyName("networkFabricId"u8); + writer.WriteStringValue(NetworkFabricId); + if (options.Format != "W" && Optional.IsCollectionDefined(NetworkDevices)) + { + writer.WritePropertyName("networkDevices"u8); + writer.WriteStartArray(); + foreach (var item in NetworkDevices) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkRackProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkRackProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkRackProperties(document.RootElement, options); + } + + internal static NetworkRackProperties DeserializeNetworkRackProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + NetworkRackType? networkRackType = default; + ResourceIdentifier networkFabricId = default; + IReadOnlyList networkDevices = default; + LastOperationProperties lastOperation = default; + NetworkFabricProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkRackType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkRackType = new NetworkRackType(property.Value.GetString()); + continue; + } + if (property.NameEquals("networkFabricId"u8)) + { + networkFabricId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("networkDevices"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + networkDevices = array; + continue; + } + if (property.NameEquals("lastOperation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NetworkFabricProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkRackProperties( + annotation, + networkRackType, + networkFabricId, + networkDevices ?? new ChangeTrackingList(), + lastOperation, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkRackProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkRackProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkRackProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkRackProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackProperties.cs new file mode 100644 index 000000000000..71e96ca05065 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackProperties.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Network Rack Properties defines the properties of the resource. + public partial class NetworkRackProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// ARM resource ID of the Network Fabric. + /// is null. + public NetworkRackProperties(ResourceIdentifier networkFabricId) + { + Argument.AssertNotNull(networkFabricId, nameof(networkFabricId)); + + NetworkFabricId = networkFabricId; + NetworkDevices = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Network Rack SKU name. + /// ARM resource ID of the Network Fabric. + /// List of network device ARM resource IDs. + /// Details of the last operation performed on the resource. + /// Provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal NetworkRackProperties(string annotation, NetworkRackType? networkRackType, ResourceIdentifier networkFabricId, IReadOnlyList networkDevices, LastOperationProperties lastOperation, NetworkFabricProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + NetworkRackType = networkRackType; + NetworkFabricId = networkFabricId; + NetworkDevices = networkDevices; + LastOperation = lastOperation; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkRackProperties() + { + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// Network Rack SKU name. + public NetworkRackType? NetworkRackType { get; set; } + /// ARM resource ID of the Network Fabric. + public ResourceIdentifier NetworkFabricId { get; set; } + /// List of network device ARM resource IDs. + public IReadOnlyList NetworkDevices { get; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + + /// Provisioning state of the resource. + public NetworkFabricProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackType.cs index 8c225ab6ea27..325538eeee01 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkRackType.cs @@ -26,11 +26,11 @@ public NetworkRackType(string value) private const string ComputeValue = "Compute"; private const string CombinedValue = "Combined"; - /// Aggregate. + /// NetworkRackType-Aggregate. public static NetworkRackType Aggregate { get; } = new NetworkRackType(AggregateValue); - /// Compute. + /// NetworkRackType-Compute. public static NetworkRackType Compute { get; } = new NetworkRackType(ComputeValue); - /// Combined. + /// NetworkRackType-Combined. public static NetworkRackType Combined { get; } = new NetworkRackType(CombinedValue); /// Determines if two values are the same. public static bool operator ==(NetworkRackType left, NetworkRackType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapDestinationProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapDestinationProperties.Serialization.cs index eeaeec6da4c5..bde61e4aad58 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapDestinationProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapDestinationProperties.Serialization.cs @@ -34,21 +34,12 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(NetworkTapDestinationProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(DestinationType)) - { - writer.WritePropertyName("destinationType"u8); - writer.WriteStringValue(DestinationType.Value.ToString()); - } - if (Optional.IsDefined(DestinationId)) - { - writer.WritePropertyName("destinationId"u8); - writer.WriteStringValue(DestinationId); - } + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("destinationType"u8); + writer.WriteStringValue(DestinationType.ToString()); + writer.WritePropertyName("destinationId"u8); + writer.WriteStringValue(DestinationId); if (Optional.IsDefined(IsolationDomainProperties)) { writer.WritePropertyName("isolationDomainProperties"u8); @@ -97,7 +88,7 @@ internal static NetworkTapDestinationProperties DeserializeNetworkTapDestination return null; } string name = default; - NetworkTapDestinationType? destinationType = default; + NetworkTapDestinationType destinationType = default; ResourceIdentifier destinationId = default; IsolationDomainProperties isolationDomainProperties = default; ResourceIdentifier destinationTapRuleId = default; @@ -112,19 +103,11 @@ internal static NetworkTapDestinationProperties DeserializeNetworkTapDestination } if (property.NameEquals("destinationType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } destinationType = new NetworkTapDestinationType(property.Value.GetString()); continue; } if (property.NameEquals("destinationId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } destinationId = new ResourceIdentifier(property.Value.GetString()); continue; } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapDestinationProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapDestinationProperties.cs index 4840f4435883..0e77704b18b2 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapDestinationProperties.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapDestinationProperties.cs @@ -44,11 +44,21 @@ public partial class NetworkTapDestinationProperties /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - public NetworkTapDestinationProperties() + /// Destination name. + /// Type of destination. Input can be IsolationDomain or Direct. + /// The destination Id. ARM Resource ID of either NNI or Internal Networks. + /// or is null. + public NetworkTapDestinationProperties(string name, NetworkTapDestinationType destinationType, ResourceIdentifier destinationId) { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(destinationId, nameof(destinationId)); + + Name = name; + DestinationType = destinationType; + DestinationId = destinationId; } /// Initializes a new instance of . @@ -58,7 +68,7 @@ public NetworkTapDestinationProperties() /// Isolation Domain Properties. /// ARM Resource ID of destination Tap Rule that contains match configurations. /// Keeps track of any properties unknown to the library. - internal NetworkTapDestinationProperties(string name, NetworkTapDestinationType? destinationType, ResourceIdentifier destinationId, IsolationDomainProperties isolationDomainProperties, ResourceIdentifier destinationTapRuleId, IDictionary serializedAdditionalRawData) + internal NetworkTapDestinationProperties(string name, NetworkTapDestinationType destinationType, ResourceIdentifier destinationId, IsolationDomainProperties isolationDomainProperties, ResourceIdentifier destinationTapRuleId, IDictionary serializedAdditionalRawData) { Name = name; DestinationType = destinationType; @@ -68,10 +78,15 @@ internal NetworkTapDestinationProperties(string name, NetworkTapDestinationType? _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal NetworkTapDestinationProperties() + { + } + /// Destination name. public string Name { get; set; } /// Type of destination. Input can be IsolationDomain or Direct. - public NetworkTapDestinationType? DestinationType { get; set; } + public NetworkTapDestinationType DestinationType { get; set; } /// The destination Id. ARM Resource ID of either NNI or Internal Networks. public ResourceIdentifier DestinationId { get; set; } /// Isolation Domain Properties. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapDestinationType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapDestinationType.cs index 583cd0dd2857..da13273c2456 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapDestinationType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapDestinationType.cs @@ -25,9 +25,9 @@ public NetworkTapDestinationType(string value) private const string IsolationDomainValue = "IsolationDomain"; private const string DirectValue = "Direct"; - /// IsolationDomain. + /// DestinationType-IsolationDomain. public static NetworkTapDestinationType IsolationDomain { get; } = new NetworkTapDestinationType(IsolationDomainValue); - /// Direct. + /// DestinationType-Direct. public static NetworkTapDestinationType Direct { get; } = new NetworkTapDestinationType(DirectValue); /// Determines if two values are the same. public static bool operator ==(NetworkTapDestinationType left, NetworkTapDestinationType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapEncapsulationType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapEncapsulationType.cs index e91db20f51c5..549896016372 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapEncapsulationType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapEncapsulationType.cs @@ -25,9 +25,9 @@ public NetworkTapEncapsulationType(string value) private const string NoneValue = "None"; private const string GTPv1Value = "GTPv1"; - /// None. + /// None EncapsulationType. public static NetworkTapEncapsulationType None { get; } = new NetworkTapEncapsulationType(NoneValue); - /// GTPv1. + /// GTPv1 EncapsulationType. public static NetworkTapEncapsulationType GTPv1 { get; } = new NetworkTapEncapsulationType(GTPv1Value); /// Determines if two values are the same. public static bool operator ==(NetworkTapEncapsulationType left, NetworkTapEncapsulationType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixesListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapListResult.Serialization.cs similarity index 66% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixesListResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapListResult.Serialization.cs index 6a4bd873421b..a5eeeb29b9ff 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/IPPrefixesListResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class IPPrefixesListResult : IUtf8JsonSerializable, IJsonModel + internal partial class NetworkTapListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IPPrefixesListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NetworkTapListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - IPPrefixesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NetworkTapListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(IPPrefixesListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NetworkTapListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeIPPrefixesListResult(document.RootElement, options); + return DeserializeNetworkTapListResult(document.RootElement, options); } - internal static IPPrefixesListResult DeserializeIPPrefixesListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static NetworkTapListResult DeserializeNetworkTapListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,29 +83,29 @@ internal static IPPrefixesListResult DeserializeIPPrefixesListResult(JsonElement { return null; } - IReadOnlyList value = default; - string nextLink = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(NetworkFabricIPPrefixData.DeserializeNetworkFabricIPPrefixData(item, options)); + array.Add(NetworkTapData.DeserializeNetworkTapData(item, options)); } value = array; continue; } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +114,38 @@ internal static IPPrefixesListResult DeserializeIPPrefixesListResult(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new IPPrefixesListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NetworkTapListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(IPPrefixesListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkTapListResult)} does not support writing '{options.Format}' format."); } } - IPPrefixesListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NetworkTapListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeIPPrefixesListResult(document.RootElement, options); + return DeserializeNetworkTapListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(IPPrefixesListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkTapListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapListResult.cs new file mode 100644 index 000000000000..9a8f21bb5d96 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a NetworkTap list operation. + internal partial class NetworkTapListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The NetworkTap items on this page. + /// is null. + internal NetworkTapListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The NetworkTap items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NetworkTapListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkTapListResult() + { + } + + /// The NetworkTap items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatch.Serialization.cs index 933dbf6b9c31..ad505332ba63 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatch.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,30 +34,37 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(NetworkTapPatch)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) + if (Optional.IsCollectionDefined(Tags)) { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); } - if (Optional.IsDefined(PollingType)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("pollingType"u8); - writer.WriteStringValue(PollingType.Value.ToString()); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - if (Optional.IsCollectionDefined(Destinations)) + if (options.Format != "W" && _serializedAdditionalRawData != null) { - writer.WritePropertyName("destinations"u8); - writer.WriteStartArray(); - foreach (var item in Destinations) + foreach (var item in _serializedAdditionalRawData) { - writer.WriteObjectValue(item, options); + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif } - writer.WriteEndArray(); } - writer.WriteEndObject(); } NetworkTapPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -81,9 +88,7 @@ internal static NetworkTapPatch DeserializeNetworkTapPatch(JsonElement element, return null; } IDictionary tags = default; - string annotation = default; - NetworkTapPollingType? pollingType = default; - IList destinations = default; + NetworkTapPatchProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -106,40 +111,9 @@ internal static NetworkTapPatch DeserializeNetworkTapPatch(JsonElement element, { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("pollingType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - pollingType = new NetworkTapPollingType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("destinations"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(NetworkTapPatchableParametersDestinationsItem.DeserializeNetworkTapPatchableParametersDestinationsItem(item, options)); - } - destinations = array; - continue; - } - } + properties = NetworkTapPatchProperties.DeserializeNetworkTapPatchProperties(property.Value, options); continue; } if (options.Format != "W") @@ -148,7 +122,7 @@ internal static NetworkTapPatch DeserializeNetworkTapPatch(JsonElement element, } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkTapPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, annotation, pollingType, destinations ?? new ChangeTrackingList()); + return new NetworkTapPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatch.cs index f6e10d829e07..0118fff34781 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatch.cs @@ -11,32 +11,60 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// The NetworkFabric resource definition. - public partial class NetworkTapPatch : NetworkRackPatch + public partial class NetworkTapPatch { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public NetworkTapPatch() { - Destinations = new ChangeTrackingList(); + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Resource tags. + /// Resource properties. /// Keeps track of any properties unknown to the library. - /// Switch configuration description. - /// Polling type. - /// List of destination properties to send the filter traffic. - internal NetworkTapPatch(IDictionary tags, IDictionary serializedAdditionalRawData, string annotation, NetworkTapPollingType? pollingType, IList destinations) : base(tags, serializedAdditionalRawData) + internal NetworkTapPatch(IDictionary tags, NetworkTapPatchProperties properties, IDictionary serializedAdditionalRawData) { - Annotation = annotation; - PollingType = pollingType; - Destinations = destinations; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Switch configuration description. - public string Annotation { get; set; } - /// Polling type. - public NetworkTapPollingType? PollingType { get; set; } - /// List of destination properties to send the filter traffic. - public IList Destinations { get; } + /// Resource tags. + public IDictionary Tags { get; } + /// Resource properties. + public NetworkTapPatchProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatchProperties.Serialization.cs new file mode 100644 index 000000000000..9cbc005a1e95 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatchProperties.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkTapPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkTapPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (Optional.IsDefined(PollingType)) + { + writer.WritePropertyName("pollingType"u8); + writer.WriteStringValue(PollingType.Value.ToString()); + } + if (Optional.IsCollectionDefined(Destinations)) + { + writer.WritePropertyName("destinations"u8); + writer.WriteStartArray(); + foreach (var item in Destinations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkTapPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkTapPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkTapPatchProperties(document.RootElement, options); + } + + internal static NetworkTapPatchProperties DeserializeNetworkTapPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + NetworkTapPollingType? pollingType = default; + IList destinations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("pollingType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pollingType = new NetworkTapPollingType(property.Value.GetString()); + continue; + } + if (property.NameEquals("destinations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DestinationPatchProperties.DeserializeDestinationPatchProperties(item, options)); + } + destinations = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkTapPatchProperties(annotation, pollingType, destinations ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkTapPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkTapPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkTapPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkTapPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatchProperties.cs new file mode 100644 index 000000000000..9fe72d81cb77 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatchProperties.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The Network Tap resource patch definition. + public partial class NetworkTapPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NetworkTapPatchProperties() + { + Destinations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Polling type. + /// List of destination properties to send the filter traffic. + /// Keeps track of any properties unknown to the library. + internal NetworkTapPatchProperties(string annotation, NetworkTapPollingType? pollingType, IList destinations, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + PollingType = pollingType; + Destinations = destinations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// Polling type. + public NetworkTapPollingType? PollingType { get; set; } + /// List of destination properties to send the filter traffic. + public IList Destinations { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatchableParametersDestinationsItem.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatchableParametersDestinationsItem.cs deleted file mode 100644 index e4aedc305252..000000000000 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPatchableParametersDestinationsItem.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.ManagedNetworkFabric.Models -{ - /// Destination. - public partial class NetworkTapPatchableParametersDestinationsItem : NetworkTapDestinationProperties - { - /// Initializes a new instance of . - public NetworkTapPatchableParametersDestinationsItem() - { - } - - /// Initializes a new instance of . - /// Destination name. - /// Type of destination. Input can be IsolationDomain or Direct. - /// The destination Id. ARM Resource ID of either NNI or Internal Networks. - /// Isolation Domain Properties. - /// ARM Resource ID of destination Tap Rule that contains match configurations. - /// Keeps track of any properties unknown to the library. - internal NetworkTapPatchableParametersDestinationsItem(string name, NetworkTapDestinationType? destinationType, ResourceIdentifier destinationId, IsolationDomainProperties isolationDomainProperties, ResourceIdentifier destinationTapRuleId, IDictionary serializedAdditionalRawData) : base(name, destinationType, destinationId, isolationDomainProperties, destinationTapRuleId, serializedAdditionalRawData) - { - } - } -} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPollingType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPollingType.cs index 580508928090..dada06500b58 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPollingType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPollingType.cs @@ -25,9 +25,9 @@ public NetworkTapPollingType(string value) private const string PullValue = "Pull"; private const string PushValue = "Push"; - /// Pull. + /// PollingType-Pull. public static NetworkTapPollingType Pull { get; } = new NetworkTapPollingType(PullValue); - /// Push. + /// PollingType-Push. public static NetworkTapPollingType Push { get; } = new NetworkTapPollingType(PushValue); /// Determines if two values are the same. public static bool operator ==(NetworkTapPollingType left, NetworkTapPollingType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapProperties.Serialization.cs new file mode 100644 index 000000000000..c8f42c7165c4 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapProperties.Serialization.cs @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkTapProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkTapProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + writer.WritePropertyName("networkPacketBrokerId"u8); + writer.WriteStringValue(NetworkPacketBrokerId); + if (options.Format != "W" && Optional.IsDefined(SourceTapRuleId)) + { + writer.WritePropertyName("sourceTapRuleId"u8); + writer.WriteStringValue(SourceTapRuleId); + } + writer.WritePropertyName("destinations"u8); + writer.WriteStartArray(); + foreach (var item in Destinations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(PollingType)) + { + writer.WritePropertyName("pollingType"u8); + writer.WriteStringValue(PollingType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } + if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) + { + writer.WritePropertyName("configurationState"u8); + writer.WriteStringValue(ConfigurationState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) + { + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkTapProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkTapProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkTapProperties(document.RootElement, options); + } + + internal static NetworkTapProperties DeserializeNetworkTapProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + ResourceIdentifier networkPacketBrokerId = default; + ResourceIdentifier sourceTapRuleId = default; + IList destinations = default; + NetworkTapPollingType? pollingType = default; + LastOperationProperties lastOperation = default; + NetworkFabricConfigurationState? configurationState = default; + NetworkFabricProvisioningState? provisioningState = default; + NetworkFabricAdministrativeState? administrativeState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkPacketBrokerId"u8)) + { + networkPacketBrokerId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceTapRuleId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceTapRuleId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("destinations"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkTapDestinationProperties.DeserializeNetworkTapDestinationProperties(item, options)); + } + destinations = array; + continue; + } + if (property.NameEquals("pollingType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pollingType = new NetworkTapPollingType(property.Value.GetString()); + continue; + } + if (property.NameEquals("lastOperation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property.Value, options); + continue; + } + if (property.NameEquals("configurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configurationState = new NetworkFabricConfigurationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NetworkFabricProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("administrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeState = new NetworkFabricAdministrativeState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkTapProperties( + annotation, + networkPacketBrokerId, + sourceTapRuleId, + destinations, + pollingType, + lastOperation, + configurationState, + provisioningState, + administrativeState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkTapProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkTapProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkTapProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkTapProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapProperties.cs new file mode 100644 index 000000000000..f0b37b9bbe46 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapProperties.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Network Tap Properties defines the properties of the resource. + public partial class NetworkTapProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// ARM resource ID of the Network Packet Broker. + /// List of destinations to send the filter traffic. + /// or is null. + public NetworkTapProperties(ResourceIdentifier networkPacketBrokerId, IEnumerable destinations) + { + Argument.AssertNotNull(networkPacketBrokerId, nameof(networkPacketBrokerId)); + Argument.AssertNotNull(destinations, nameof(destinations)); + + NetworkPacketBrokerId = networkPacketBrokerId; + Destinations = destinations.ToList(); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// ARM resource ID of the Network Packet Broker. + /// Source Tap Rule Id. ARM Resource ID of the Network Tap Rule. + /// List of destinations to send the filter traffic. + /// Polling type. + /// Details of the last operation performed on the resource. + /// Gets the configurations state of the resource. + /// Provides you the latest status of the NFC service, whether it is Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on the status of Network Tap provisioning. + /// Administrative state of the resource. Example -Enabled/Disabled. + /// Keeps track of any properties unknown to the library. + internal NetworkTapProperties(string annotation, ResourceIdentifier networkPacketBrokerId, ResourceIdentifier sourceTapRuleId, IList destinations, NetworkTapPollingType? pollingType, LastOperationProperties lastOperation, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + NetworkPacketBrokerId = networkPacketBrokerId; + SourceTapRuleId = sourceTapRuleId; + Destinations = destinations; + PollingType = pollingType; + LastOperation = lastOperation; + ConfigurationState = configurationState; + ProvisioningState = provisioningState; + AdministrativeState = administrativeState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkTapProperties() + { + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// ARM resource ID of the Network Packet Broker. + public ResourceIdentifier NetworkPacketBrokerId { get; set; } + /// Source Tap Rule Id. ARM Resource ID of the Network Tap Rule. + public ResourceIdentifier SourceTapRuleId { get; } + /// List of destinations to send the filter traffic. + public IList Destinations { get; } + /// Polling type. + public NetworkTapPollingType? PollingType { get; set; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + + /// Gets the configurations state of the resource. + public NetworkFabricConfigurationState? ConfigurationState { get; } + /// Provides you the latest status of the NFC service, whether it is Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on the status of Network Tap provisioning. + public NetworkFabricProvisioningState? ProvisioningState { get; } + /// Administrative state of the resource. Example -Enabled/Disabled. + public NetworkFabricAdministrativeState? AdministrativeState { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPropertiesDestinationsItem.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPropertiesDestinationsItem.Serialization.cs deleted file mode 100644 index e3acd8d184ac..000000000000 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPropertiesDestinationsItem.Serialization.cs +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ManagedNetworkFabric.Models -{ - public partial class NetworkTapPropertiesDestinationsItem : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkTapPropertiesDestinationsItem)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - } - - NetworkTapPropertiesDestinationsItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkTapPropertiesDestinationsItem)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkTapPropertiesDestinationsItem(document.RootElement, options); - } - - internal static NetworkTapPropertiesDestinationsItem DeserializeNetworkTapPropertiesDestinationsItem(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - NetworkTapDestinationType? destinationType = default; - ResourceIdentifier destinationId = default; - IsolationDomainProperties isolationDomainProperties = default; - ResourceIdentifier destinationTapRuleId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("destinationType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - destinationType = new NetworkTapDestinationType(property.Value.GetString()); - continue; - } - if (property.NameEquals("destinationId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - destinationId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("isolationDomainProperties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isolationDomainProperties = IsolationDomainProperties.DeserializeIsolationDomainProperties(property.Value, options); - continue; - } - if (property.NameEquals("destinationTapRuleId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - destinationTapRuleId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NetworkTapPropertiesDestinationsItem( - name, - destinationType, - destinationId, - isolationDomainProperties, - destinationTapRuleId, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); - default: - throw new FormatException($"The model {nameof(NetworkTapPropertiesDestinationsItem)} does not support writing '{options.Format}' format."); - } - } - - NetworkTapPropertiesDestinationsItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkTapPropertiesDestinationsItem(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NetworkTapPropertiesDestinationsItem)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPropertiesDestinationsItem.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPropertiesDestinationsItem.cs deleted file mode 100644 index 46a78a1663ab..000000000000 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapPropertiesDestinationsItem.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.ManagedNetworkFabric.Models -{ - /// Destination. - public partial class NetworkTapPropertiesDestinationsItem : NetworkTapDestinationProperties - { - /// Initializes a new instance of . - public NetworkTapPropertiesDestinationsItem() - { - } - - /// Initializes a new instance of . - /// Destination name. - /// Type of destination. Input can be IsolationDomain or Direct. - /// The destination Id. ARM Resource ID of either NNI or Internal Networks. - /// Isolation Domain Properties. - /// ARM Resource ID of destination Tap Rule that contains match configurations. - /// Keeps track of any properties unknown to the library. - internal NetworkTapPropertiesDestinationsItem(string name, NetworkTapDestinationType? destinationType, ResourceIdentifier destinationId, IsolationDomainProperties isolationDomainProperties, ResourceIdentifier destinationTapRuleId, IDictionary serializedAdditionalRawData) : base(name, destinationType, destinationId, isolationDomainProperties, destinationTapRuleId, serializedAdditionalRawData) - { - } - } -} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleAction.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleAction.cs index efb5118e82c5..ae7cb4627b13 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleAction.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleAction.cs @@ -56,7 +56,7 @@ public NetworkTapRuleAction() /// Truncate. 0 indicates do not truncate. /// The parameter to enable or disable the timestamp. /// Destination Id. The ARM resource Id may be either Network To Network Interconnect or NeighborGroup. - /// The name of the match configuration. This is used when Goto type is provided. If Goto type is selected and no match configuration name is provided. It goes to next configuration. + /// The name of the match configuration. This is used when Goto type is provided. /// Keeps track of any properties unknown to the library. internal NetworkTapRuleAction(TapRuleActionType? tapRuleActionType, string truncate, NetworkFabricBooleanValue? isTimestampEnabled, ResourceIdentifier destinationId, string matchConfigurationName, IDictionary serializedAdditionalRawData) { @@ -76,7 +76,7 @@ internal NetworkTapRuleAction(TapRuleActionType? tapRuleActionType, string trunc public NetworkFabricBooleanValue? IsTimestampEnabled { get; set; } /// Destination Id. The ARM resource Id may be either Network To Network Interconnect or NeighborGroup. public ResourceIdentifier DestinationId { get; set; } - /// The name of the match configuration. This is used when Goto type is provided. If Goto type is selected and no match configuration name is provided. It goes to next configuration. + /// The name of the match configuration. This is used when Goto type is provided. public string MatchConfigurationName { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleActionPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleActionPatch.Serialization.cs new file mode 100644 index 000000000000..c5e40f4e008a --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleActionPatch.Serialization.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkTapRuleActionPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkTapRuleActionPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TapRuleActionType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(TapRuleActionType.Value.ToString()); + } + if (Optional.IsDefined(Truncate)) + { + writer.WritePropertyName("truncate"u8); + writer.WriteStringValue(Truncate); + } + if (Optional.IsDefined(IsTimestampEnabled)) + { + writer.WritePropertyName("isTimestampEnabled"u8); + writer.WriteStringValue(IsTimestampEnabled.Value.ToString()); + } + if (Optional.IsDefined(DestinationId)) + { + writer.WritePropertyName("destinationId"u8); + writer.WriteStringValue(DestinationId); + } + if (Optional.IsDefined(MatchConfigurationName)) + { + writer.WritePropertyName("matchConfigurationName"u8); + writer.WriteStringValue(MatchConfigurationName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkTapRuleActionPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkTapRuleActionPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkTapRuleActionPatch(document.RootElement, options); + } + + internal static NetworkTapRuleActionPatch DeserializeNetworkTapRuleActionPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TapRuleActionType? type = default; + string truncate = default; + NetworkFabricBooleanValue? isTimestampEnabled = default; + ResourceIdentifier destinationId = default; + string matchConfigurationName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new TapRuleActionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("truncate"u8)) + { + truncate = property.Value.GetString(); + continue; + } + if (property.NameEquals("isTimestampEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isTimestampEnabled = new NetworkFabricBooleanValue(property.Value.GetString()); + continue; + } + if (property.NameEquals("destinationId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + destinationId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("matchConfigurationName"u8)) + { + matchConfigurationName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkTapRuleActionPatch( + type, + truncate, + isTimestampEnabled, + destinationId, + matchConfigurationName, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkTapRuleActionPatch)} does not support writing '{options.Format}' format."); + } + } + + NetworkTapRuleActionPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkTapRuleActionPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkTapRuleActionPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleActionPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleActionPatch.cs new file mode 100644 index 000000000000..56875d117ba9 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleActionPatch.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Action that need to performed. + public partial class NetworkTapRuleActionPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NetworkTapRuleActionPatch() + { + } + + /// Initializes a new instance of . + /// Type of actions that can be performed. + /// Truncate. 0 indicates do not truncate. + /// The parameter to enable or disable the timestamp. + /// Destination Id. The ARM resource Id may be either Network To Network Interconnect or NeighborGroup. + /// The name of the match configuration. This is used when Goto type is provided. + /// Keeps track of any properties unknown to the library. + internal NetworkTapRuleActionPatch(TapRuleActionType? tapRuleActionType, string truncate, NetworkFabricBooleanValue? isTimestampEnabled, ResourceIdentifier destinationId, string matchConfigurationName, IDictionary serializedAdditionalRawData) + { + TapRuleActionType = tapRuleActionType; + Truncate = truncate; + IsTimestampEnabled = isTimestampEnabled; + DestinationId = destinationId; + MatchConfigurationName = matchConfigurationName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Type of actions that can be performed. + public TapRuleActionType? TapRuleActionType { get; set; } + /// Truncate. 0 indicates do not truncate. + public string Truncate { get; set; } + /// The parameter to enable or disable the timestamp. + public NetworkFabricBooleanValue? IsTimestampEnabled { get; set; } + /// Destination Id. The ARM resource Id may be either Network To Network Interconnect or NeighborGroup. + public ResourceIdentifier DestinationId { get; set; } + /// The name of the match configuration. This is used when Goto type is provided. + public string MatchConfigurationName { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicesListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleListResult.Serialization.cs similarity index 67% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicesListResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleListResult.Serialization.cs index c5120165daf1..a36b16e8013b 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDevicesListResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class NetworkDevicesListResult : IUtf8JsonSerializable, IJsonModel + internal partial class NetworkTapRuleListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkDevicesListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NetworkTapRuleListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NetworkDevicesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NetworkTapRuleListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkDevicesListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NetworkTapRuleListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkDevicesListResult(document.RootElement, options); + return DeserializeNetworkTapRuleListResult(document.RootElement, options); } - internal static NetworkDevicesListResult DeserializeNetworkDevicesListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static NetworkTapRuleListResult DeserializeNetworkTapRuleListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,29 +83,29 @@ internal static NetworkDevicesListResult DeserializeNetworkDevicesListResult(Jso { return null; } - IReadOnlyList value = default; - string nextLink = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(NetworkDeviceData.DeserializeNetworkDeviceData(item, options)); + array.Add(NetworkTapRuleData.DeserializeNetworkTapRuleData(item, options)); } value = array; continue; } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +114,38 @@ internal static NetworkDevicesListResult DeserializeNetworkDevicesListResult(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkDevicesListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NetworkTapRuleListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(NetworkDevicesListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkTapRuleListResult)} does not support writing '{options.Format}' format."); } } - NetworkDevicesListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NetworkTapRuleListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkDevicesListResult(document.RootElement, options); + return DeserializeNetworkTapRuleListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NetworkDevicesListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkTapRuleListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleListResult.cs new file mode 100644 index 000000000000..d77e3c443353 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a NetworkTapRule list operation. + internal partial class NetworkTapRuleListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The NetworkTapRule items on this page. + /// is null. + internal NetworkTapRuleListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The NetworkTapRule items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NetworkTapRuleListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkTapRuleListResult() + { + } + + /// The NetworkTapRule items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchCondition.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchCondition.Serialization.cs index 781f2be35a3b..9249e7657d0a 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchCondition.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchCondition.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,7 +34,26 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(NetworkTapRuleMatchCondition)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(ProtocolTypes)) + { + writer.WritePropertyName("protocolTypes"u8); + writer.WriteStartArray(); + foreach (var item in ProtocolTypes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(VlanMatchCondition)) + { + writer.WritePropertyName("vlanMatchCondition"u8); + writer.WriteObjectValue(VlanMatchCondition, options); + } + if (Optional.IsDefined(IPCondition)) + { + writer.WritePropertyName("ipCondition"u8); + writer.WriteObjectValue(IPCondition, options); + } if (Optional.IsDefined(EncapsulationType)) { writer.WritePropertyName("encapsulationType"u8); @@ -45,6 +64,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("portCondition"u8); writer.WriteObjectValue(PortCondition, options); } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } NetworkTapRuleMatchCondition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -67,63 +101,63 @@ internal static NetworkTapRuleMatchCondition DeserializeNetworkTapRuleMatchCondi { return null; } - NetworkTapEncapsulationType? encapsulationType = default; - NetworkFabricPortCondition portCondition = default; IList protocolTypes = default; VlanMatchCondition vlanMatchCondition = default; IPMatchCondition ipCondition = default; + NetworkTapEncapsulationType? encapsulationType = default; + NetworkFabricPortCondition portCondition = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("encapsulationType"u8)) + if (property.NameEquals("protocolTypes"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - encapsulationType = new NetworkTapEncapsulationType(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + protocolTypes = array; continue; } - if (property.NameEquals("portCondition"u8)) + if (property.NameEquals("vlanMatchCondition"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - portCondition = NetworkFabricPortCondition.DeserializeNetworkFabricPortCondition(property.Value, options); + vlanMatchCondition = VlanMatchCondition.DeserializeVlanMatchCondition(property.Value, options); continue; } - if (property.NameEquals("protocolTypes"u8)) + if (property.NameEquals("ipCondition"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - protocolTypes = array; + ipCondition = IPMatchCondition.DeserializeIPMatchCondition(property.Value, options); continue; } - if (property.NameEquals("vlanMatchCondition"u8)) + if (property.NameEquals("encapsulationType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - vlanMatchCondition = VlanMatchCondition.DeserializeVlanMatchCondition(property.Value, options); + encapsulationType = new NetworkTapEncapsulationType(property.Value.GetString()); continue; } - if (property.NameEquals("ipCondition"u8)) + if (property.NameEquals("portCondition"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - ipCondition = IPMatchCondition.DeserializeIPMatchCondition(property.Value, options); + portCondition = NetworkFabricPortCondition.DeserializeNetworkFabricPortCondition(property.Value, options); continue; } if (options.Format != "W") @@ -136,9 +170,9 @@ internal static NetworkTapRuleMatchCondition DeserializeNetworkTapRuleMatchCondi protocolTypes ?? new ChangeTrackingList(), vlanMatchCondition, ipCondition, - serializedAdditionalRawData, encapsulationType, - portCondition); + portCondition, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchCondition.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchCondition.cs index 8ec3ae8c1233..a76e127f8229 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchCondition.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchCondition.cs @@ -11,26 +11,69 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// Defines the match condition that is supported to filter the traffic. - public partial class NetworkTapRuleMatchCondition : CommonMatchConditions + public partial class NetworkTapRuleMatchCondition { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public NetworkTapRuleMatchCondition() { + ProtocolTypes = new ChangeTrackingList(); } /// Initializes a new instance of . /// List of the protocols that need to be matched. /// Vlan match condition that needs to be matched. /// IP condition that needs to be matched. - /// Keeps track of any properties unknown to the library. /// Encapsulation Type that needs to be matched. /// Defines the port condition that needs to be matched. - internal NetworkTapRuleMatchCondition(IList protocolTypes, VlanMatchCondition vlanMatchCondition, IPMatchCondition ipCondition, IDictionary serializedAdditionalRawData, NetworkTapEncapsulationType? encapsulationType, NetworkFabricPortCondition portCondition) : base(protocolTypes, vlanMatchCondition, ipCondition, serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NetworkTapRuleMatchCondition(IList protocolTypes, VlanMatchCondition vlanMatchCondition, IPMatchCondition ipCondition, NetworkTapEncapsulationType? encapsulationType, NetworkFabricPortCondition portCondition, IDictionary serializedAdditionalRawData) { + ProtocolTypes = protocolTypes; + VlanMatchCondition = vlanMatchCondition; + IPCondition = ipCondition; EncapsulationType = encapsulationType; PortCondition = portCondition; + _serializedAdditionalRawData = serializedAdditionalRawData; } + /// List of the protocols that need to be matched. + public IList ProtocolTypes { get; } + /// Vlan match condition that needs to be matched. + public VlanMatchCondition VlanMatchCondition { get; set; } + /// IP condition that needs to be matched. + public IPMatchCondition IPCondition { get; set; } /// Encapsulation Type that needs to be matched. public NetworkTapEncapsulationType? EncapsulationType { get; set; } /// Defines the port condition that needs to be matched. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchConditionPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchConditionPatch.Serialization.cs new file mode 100644 index 000000000000..1b87bdb18400 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchConditionPatch.Serialization.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkTapRuleMatchConditionPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkTapRuleMatchConditionPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(ProtocolTypes)) + { + writer.WritePropertyName("protocolTypes"u8); + writer.WriteStartArray(); + foreach (var item in ProtocolTypes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(VlanMatchCondition)) + { + writer.WritePropertyName("vlanMatchCondition"u8); + writer.WriteObjectValue(VlanMatchCondition, options); + } + if (Optional.IsDefined(IPCondition)) + { + writer.WritePropertyName("ipCondition"u8); + writer.WriteObjectValue(IPCondition, options); + } + if (Optional.IsDefined(EncapsulationType)) + { + writer.WritePropertyName("encapsulationType"u8); + writer.WriteStringValue(EncapsulationType.Value.ToString()); + } + if (Optional.IsDefined(PortCondition)) + { + writer.WritePropertyName("portCondition"u8); + writer.WriteObjectValue(PortCondition, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkTapRuleMatchConditionPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkTapRuleMatchConditionPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkTapRuleMatchConditionPatch(document.RootElement, options); + } + + internal static NetworkTapRuleMatchConditionPatch DeserializeNetworkTapRuleMatchConditionPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList protocolTypes = default; + VlanMatchConditionPatch vlanMatchCondition = default; + IPMatchConditionPatch ipCondition = default; + NetworkTapEncapsulationType? encapsulationType = default; + PortConditionPatch portCondition = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("protocolTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + protocolTypes = array; + continue; + } + if (property.NameEquals("vlanMatchCondition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vlanMatchCondition = VlanMatchConditionPatch.DeserializeVlanMatchConditionPatch(property.Value, options); + continue; + } + if (property.NameEquals("ipCondition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ipCondition = IPMatchConditionPatch.DeserializeIPMatchConditionPatch(property.Value, options); + continue; + } + if (property.NameEquals("encapsulationType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encapsulationType = new NetworkTapEncapsulationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("portCondition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + portCondition = PortConditionPatch.DeserializePortConditionPatch(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkTapRuleMatchConditionPatch( + protocolTypes ?? new ChangeTrackingList(), + vlanMatchCondition, + ipCondition, + encapsulationType, + portCondition, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkTapRuleMatchConditionPatch)} does not support writing '{options.Format}' format."); + } + } + + NetworkTapRuleMatchConditionPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkTapRuleMatchConditionPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkTapRuleMatchConditionPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonMatchConditions.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchConditionPatch.cs similarity index 62% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonMatchConditions.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchConditionPatch.cs index f85f1c63f514..4f76d51dce3e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/CommonMatchConditions.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchConditionPatch.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// Defines the common match conditions of the ACL and Network Tap Rule. - public partial class CommonMatchConditions + /// Defines the match condition that is supported to filter the traffic. + public partial class NetworkTapRuleMatchConditionPatch { /// /// Keeps track of any properties unknown to the library. @@ -43,32 +43,40 @@ public partial class CommonMatchConditions /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public CommonMatchConditions() + /// Initializes a new instance of . + public NetworkTapRuleMatchConditionPatch() { ProtocolTypes = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// List of the protocols that need to be matched. /// Vlan match condition that needs to be matched. /// IP condition that needs to be matched. + /// Encapsulation Type that needs to be matched. + /// Defines the port condition that needs to be matched. /// Keeps track of any properties unknown to the library. - internal CommonMatchConditions(IList protocolTypes, VlanMatchCondition vlanMatchCondition, IPMatchCondition ipCondition, IDictionary serializedAdditionalRawData) + internal NetworkTapRuleMatchConditionPatch(IList protocolTypes, VlanMatchConditionPatch vlanMatchCondition, IPMatchConditionPatch ipCondition, NetworkTapEncapsulationType? encapsulationType, PortConditionPatch portCondition, IDictionary serializedAdditionalRawData) { ProtocolTypes = protocolTypes; VlanMatchCondition = vlanMatchCondition; IPCondition = ipCondition; + EncapsulationType = encapsulationType; + PortCondition = portCondition; _serializedAdditionalRawData = serializedAdditionalRawData; } /// List of the protocols that need to be matched. public IList ProtocolTypes { get; } /// Vlan match condition that needs to be matched. - public VlanMatchCondition VlanMatchCondition { get; set; } + public VlanMatchConditionPatch VlanMatchCondition { get; set; } /// IP condition that needs to be matched. - public IPMatchCondition IPCondition { get; set; } + public IPMatchConditionPatch IPCondition { get; set; } + /// Encapsulation Type that needs to be matched. + public NetworkTapEncapsulationType? EncapsulationType { get; set; } + /// Defines the port condition that needs to be matched. + public PortConditionPatch PortCondition { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchConfigurationPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchConfigurationPatch.Serialization.cs new file mode 100644 index 000000000000..afa3ad123bb0 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchConfigurationPatch.Serialization.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkTapRuleMatchConfigurationPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkTapRuleMatchConfigurationPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MatchConfigurationName)) + { + writer.WritePropertyName("matchConfigurationName"u8); + writer.WriteStringValue(MatchConfigurationName); + } + if (Optional.IsDefined(SequenceNumber)) + { + writer.WritePropertyName("sequenceNumber"u8); + writer.WriteNumberValue(SequenceNumber.Value); + } + if (Optional.IsDefined(IPAddressType)) + { + writer.WritePropertyName("ipAddressType"u8); + writer.WriteStringValue(IPAddressType.Value.ToString()); + } + if (Optional.IsCollectionDefined(MatchConditions)) + { + writer.WritePropertyName("matchConditions"u8); + writer.WriteStartArray(); + foreach (var item in MatchConditions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Actions)) + { + writer.WritePropertyName("actions"u8); + writer.WriteStartArray(); + foreach (var item in Actions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkTapRuleMatchConfigurationPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkTapRuleMatchConfigurationPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkTapRuleMatchConfigurationPatch(document.RootElement, options); + } + + internal static NetworkTapRuleMatchConfigurationPatch DeserializeNetworkTapRuleMatchConfigurationPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string matchConfigurationName = default; + long? sequenceNumber = default; + NetworkFabricIPAddressType? ipAddressType = default; + IList matchConditions = default; + IList actions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("matchConfigurationName"u8)) + { + matchConfigurationName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sequenceNumber"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sequenceNumber = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("ipAddressType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ipAddressType = new NetworkFabricIPAddressType(property.Value.GetString()); + continue; + } + if (property.NameEquals("matchConditions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkTapRuleMatchConditionPatch.DeserializeNetworkTapRuleMatchConditionPatch(item, options)); + } + matchConditions = array; + continue; + } + if (property.NameEquals("actions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkTapRuleActionPatch.DeserializeNetworkTapRuleActionPatch(item, options)); + } + actions = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkTapRuleMatchConfigurationPatch( + matchConfigurationName, + sequenceNumber, + ipAddressType, + matchConditions ?? new ChangeTrackingList(), + actions ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkTapRuleMatchConfigurationPatch)} does not support writing '{options.Format}' format."); + } + } + + NetworkTapRuleMatchConfigurationPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkTapRuleMatchConfigurationPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkTapRuleMatchConfigurationPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchConfigurationPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchConfigurationPatch.cs new file mode 100644 index 000000000000..3c6e78889592 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleMatchConfigurationPatch.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Defines the match configuration that are supported to filter the traffic. + public partial class NetworkTapRuleMatchConfigurationPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NetworkTapRuleMatchConfigurationPatch() + { + MatchConditions = new ChangeTrackingList(); + Actions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The name of the match configuration. + /// Sequence Number of the match configuration.. + /// Type of IP Address. IPv4 or IPv6. + /// List of the match conditions. + /// List of actions that need to be performed for the matched conditions. + /// Keeps track of any properties unknown to the library. + internal NetworkTapRuleMatchConfigurationPatch(string matchConfigurationName, long? sequenceNumber, NetworkFabricIPAddressType? ipAddressType, IList matchConditions, IList actions, IDictionary serializedAdditionalRawData) + { + MatchConfigurationName = matchConfigurationName; + SequenceNumber = sequenceNumber; + IPAddressType = ipAddressType; + MatchConditions = matchConditions; + Actions = actions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the match configuration. + public string MatchConfigurationName { get; set; } + /// Sequence Number of the match configuration.. + public long? SequenceNumber { get; set; } + /// Type of IP Address. IPv4 or IPv6. + public NetworkFabricIPAddressType? IPAddressType { get; set; } + /// List of the match conditions. + public IList MatchConditions { get; } + /// List of actions that need to be performed for the matched conditions. + public IList Actions { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulePatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulePatch.Serialization.cs index c9e64bfe04e9..6bb9fef67d9d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulePatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulePatch.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,45 +34,37 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(NetworkTapRulePatch)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) - { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); - } - if (Optional.IsDefined(ConfigurationType)) - { - writer.WritePropertyName("configurationType"u8); - writer.WriteStringValue(ConfigurationType.Value.ToString()); - } - if (Optional.IsDefined(TapRulesUri)) - { - writer.WritePropertyName("tapRulesUrl"u8); - writer.WriteStringValue(TapRulesUri.AbsoluteUri); - } - if (Optional.IsCollectionDefined(MatchConfigurations)) + if (Optional.IsCollectionDefined(Tags)) { - writer.WritePropertyName("matchConfigurations"u8); - writer.WriteStartArray(); - foreach (var item in MatchConfigurations) + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) { - writer.WriteObjectValue(item, options); + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); } - writer.WriteEndArray(); + writer.WriteEndObject(); } - if (Optional.IsCollectionDefined(DynamicMatchConfigurations)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("dynamicMatchConfigurations"u8); - writer.WriteStartArray(); - foreach (var item in DynamicMatchConfigurations) + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) { - writer.WriteObjectValue(item, options); + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif } - writer.WriteEndArray(); } - writer.WriteEndObject(); } NetworkTapRulePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -96,11 +88,7 @@ internal static NetworkTapRulePatch DeserializeNetworkTapRulePatch(JsonElement e return null; } IDictionary tags = default; - string annotation = default; - NetworkFabricConfigurationType? configurationType = default; - Uri tapRulesUrl = default; - IList matchConfigurations = default; - IList dynamicMatchConfigurations = default; + NetworkTapRulePatchProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -123,63 +111,9 @@ internal static NetworkTapRulePatch DeserializeNetworkTapRulePatch(JsonElement e { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("configurationType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - configurationType = new NetworkFabricConfigurationType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("tapRulesUrl"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - tapRulesUrl = new Uri(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("matchConfigurations"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(NetworkTapRuleMatchConfiguration.DeserializeNetworkTapRuleMatchConfiguration(item, options)); - } - matchConfigurations = array; - continue; - } - if (property0.NameEquals("dynamicMatchConfigurations"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(CommonDynamicMatchConfiguration.DeserializeCommonDynamicMatchConfiguration(item, options)); - } - dynamicMatchConfigurations = array; - continue; - } - } + properties = NetworkTapRulePatchProperties.DeserializeNetworkTapRulePatchProperties(property.Value, options); continue; } if (options.Format != "W") @@ -188,14 +122,7 @@ internal static NetworkTapRulePatch DeserializeNetworkTapRulePatch(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkTapRulePatch( - tags ?? new ChangeTrackingDictionary(), - serializedAdditionalRawData, - annotation, - configurationType, - tapRulesUrl, - matchConfigurations ?? new ChangeTrackingList(), - dynamicMatchConfigurations ?? new ChangeTrackingList()); + return new NetworkTapRulePatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulePatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulePatch.cs index 399f325ce6c7..7f58c5c1866a 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulePatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulePatch.cs @@ -11,41 +11,60 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// The NetworkTapRule resource definition. - public partial class NetworkTapRulePatch : NetworkRackPatch + public partial class NetworkTapRulePatch { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public NetworkTapRulePatch() { - MatchConfigurations = new ChangeTrackingList(); - DynamicMatchConfigurations = new ChangeTrackingList(); + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Resource tags. + /// Network Tap Rule Patch properties. /// Keeps track of any properties unknown to the library. - /// Switch configuration description. - /// Input method to configure Network Tap Rule. - /// Network Tap Rules file URL. - /// List of match configurations. - /// List of dynamic match configurations. - internal NetworkTapRulePatch(IDictionary tags, IDictionary serializedAdditionalRawData, string annotation, NetworkFabricConfigurationType? configurationType, Uri tapRulesUri, IList matchConfigurations, IList dynamicMatchConfigurations) : base(tags, serializedAdditionalRawData) + internal NetworkTapRulePatch(IDictionary tags, NetworkTapRulePatchProperties properties, IDictionary serializedAdditionalRawData) { - Annotation = annotation; - ConfigurationType = configurationType; - TapRulesUri = tapRulesUri; - MatchConfigurations = matchConfigurations; - DynamicMatchConfigurations = dynamicMatchConfigurations; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Switch configuration description. - public string Annotation { get; set; } - /// Input method to configure Network Tap Rule. - public NetworkFabricConfigurationType? ConfigurationType { get; set; } - /// Network Tap Rules file URL. - public Uri TapRulesUri { get; set; } - /// List of match configurations. - public IList MatchConfigurations { get; } - /// List of dynamic match configurations. - public IList DynamicMatchConfigurations { get; } + /// Resource tags. + public IDictionary Tags { get; } + /// Network Tap Rule Patch properties. + public NetworkTapRulePatchProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulePatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulePatchProperties.Serialization.cs new file mode 100644 index 000000000000..dfa98d81aac2 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulePatchProperties.Serialization.cs @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkTapRulePatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkTapRulePatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (Optional.IsDefined(ConfigurationType)) + { + writer.WritePropertyName("configurationType"u8); + writer.WriteStringValue(ConfigurationType.Value.ToString()); + } + if (Optional.IsDefined(TapRulesUri)) + { + writer.WritePropertyName("tapRulesUrl"u8); + writer.WriteStringValue(TapRulesUri.AbsoluteUri); + } + if (Optional.IsDefined(GlobalNetworkTapRuleActions)) + { + writer.WritePropertyName("globalNetworkTapRuleActions"u8); + writer.WriteObjectValue(GlobalNetworkTapRuleActions, options); + } + if (Optional.IsCollectionDefined(MatchConfigurations)) + { + writer.WritePropertyName("matchConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in MatchConfigurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(DynamicMatchConfigurations)) + { + writer.WritePropertyName("dynamicMatchConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in DynamicMatchConfigurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkTapRulePatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkTapRulePatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkTapRulePatchProperties(document.RootElement, options); + } + + internal static NetworkTapRulePatchProperties DeserializeNetworkTapRulePatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + NetworkFabricConfigurationType? configurationType = default; + Uri tapRulesUrl = default; + GlobalNetworkTapRuleActionPatchProperties globalNetworkTapRuleActions = default; + IList matchConfigurations = default; + IList dynamicMatchConfigurations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("configurationType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configurationType = new NetworkFabricConfigurationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("tapRulesUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tapRulesUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("globalNetworkTapRuleActions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + globalNetworkTapRuleActions = GlobalNetworkTapRuleActionPatchProperties.DeserializeGlobalNetworkTapRuleActionPatchProperties(property.Value, options); + continue; + } + if (property.NameEquals("matchConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkTapRuleMatchConfigurationPatch.DeserializeNetworkTapRuleMatchConfigurationPatch(item, options)); + } + matchConfigurations = array; + continue; + } + if (property.NameEquals("dynamicMatchConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CommonDynamicMatchConfigurationPatch.DeserializeCommonDynamicMatchConfigurationPatch(item, options)); + } + dynamicMatchConfigurations = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkTapRulePatchProperties( + annotation, + configurationType, + tapRulesUrl, + globalNetworkTapRuleActions, + matchConfigurations ?? new ChangeTrackingList(), + dynamicMatchConfigurations ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkTapRulePatchProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkTapRulePatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkTapRulePatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkTapRulePatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulePatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulePatchProperties.cs new file mode 100644 index 000000000000..465722af45ca --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRulePatchProperties.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Network Tap Rule Patch properties. + public partial class NetworkTapRulePatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NetworkTapRulePatchProperties() + { + MatchConfigurations = new ChangeTrackingList(); + DynamicMatchConfigurations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Input method to configure Network Tap Rule. + /// Network Tap Rules file URL. + /// Global network tap rule actions. + /// List of match configurations. + /// List of dynamic match configurations. + /// Keeps track of any properties unknown to the library. + internal NetworkTapRulePatchProperties(string annotation, NetworkFabricConfigurationType? configurationType, Uri tapRulesUri, GlobalNetworkTapRuleActionPatchProperties globalNetworkTapRuleActions, IList matchConfigurations, IList dynamicMatchConfigurations, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + ConfigurationType = configurationType; + TapRulesUri = tapRulesUri; + GlobalNetworkTapRuleActions = globalNetworkTapRuleActions; + MatchConfigurations = matchConfigurations; + DynamicMatchConfigurations = dynamicMatchConfigurations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// Input method to configure Network Tap Rule. + public NetworkFabricConfigurationType? ConfigurationType { get; set; } + /// Network Tap Rules file URL. + public Uri TapRulesUri { get; set; } + /// Global network tap rule actions. + public GlobalNetworkTapRuleActionPatchProperties GlobalNetworkTapRuleActions { get; set; } + /// List of match configurations. + public IList MatchConfigurations { get; } + /// List of dynamic match configurations. + public IList DynamicMatchConfigurations { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleProperties.Serialization.cs new file mode 100644 index 000000000000..c70e575a6a05 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleProperties.Serialization.cs @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkTapRuleProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkTapRuleProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + writer.WritePropertyName("configurationType"u8); + writer.WriteStringValue(ConfigurationType.ToString()); + if (Optional.IsDefined(TapRulesUri)) + { + writer.WritePropertyName("tapRulesUrl"u8); + writer.WriteStringValue(TapRulesUri.AbsoluteUri); + } + if (Optional.IsCollectionDefined(MatchConfigurations)) + { + writer.WritePropertyName("matchConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in MatchConfigurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(DynamicMatchConfigurations)) + { + writer.WritePropertyName("dynamicMatchConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in DynamicMatchConfigurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NetworkTapId)) + { + writer.WritePropertyName("networkTapId"u8); + writer.WriteStringValue(NetworkTapId); + } + if (Optional.IsDefined(PollingIntervalInSeconds)) + { + writer.WritePropertyName("pollingIntervalInSeconds"u8); + writer.WriteNumberValue(PollingIntervalInSeconds.Value.ToSerialSingle()); + } + if (options.Format != "W" && Optional.IsDefined(LastSyncedOn)) + { + writer.WritePropertyName("lastSyncedTime"u8); + writer.WriteStringValue(LastSyncedOn.Value, "O"); + } + if (Optional.IsDefined(GlobalNetworkTapRuleActions)) + { + writer.WritePropertyName("globalNetworkTapRuleActions"u8); + writer.WriteObjectValue(GlobalNetworkTapRuleActions, options); + } + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } + if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) + { + writer.WritePropertyName("configurationState"u8); + writer.WriteStringValue(ConfigurationState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) + { + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkTapRuleProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkTapRuleProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkTapRuleProperties(document.RootElement, options); + } + + internal static NetworkTapRuleProperties DeserializeNetworkTapRuleProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + NetworkFabricConfigurationType configurationType = default; + Uri tapRulesUrl = default; + IList matchConfigurations = default; + IList dynamicMatchConfigurations = default; + string networkTapId = default; + PollingIntervalInSecond? pollingIntervalInSeconds = default; + DateTimeOffset? lastSyncedTime = default; + GlobalNetworkTapRuleActionProperties globalNetworkTapRuleActions = default; + LastOperationProperties lastOperation = default; + NetworkFabricConfigurationState? configurationState = default; + NetworkFabricProvisioningState? provisioningState = default; + NetworkFabricAdministrativeState? administrativeState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("configurationType"u8)) + { + configurationType = new NetworkFabricConfigurationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("tapRulesUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tapRulesUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("matchConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkTapRuleMatchConfiguration.DeserializeNetworkTapRuleMatchConfiguration(item, options)); + } + matchConfigurations = array; + continue; + } + if (property.NameEquals("dynamicMatchConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CommonDynamicMatchConfiguration.DeserializeCommonDynamicMatchConfiguration(item, options)); + } + dynamicMatchConfigurations = array; + continue; + } + if (property.NameEquals("networkTapId"u8)) + { + networkTapId = property.Value.GetString(); + continue; + } + if (property.NameEquals("pollingIntervalInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pollingIntervalInSeconds = new PollingIntervalInSecond(property.Value.GetSingle()); + continue; + } + if (property.NameEquals("lastSyncedTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSyncedTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("globalNetworkTapRuleActions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + globalNetworkTapRuleActions = GlobalNetworkTapRuleActionProperties.DeserializeGlobalNetworkTapRuleActionProperties(property.Value, options); + continue; + } + if (property.NameEquals("lastOperation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property.Value, options); + continue; + } + if (property.NameEquals("configurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configurationState = new NetworkFabricConfigurationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NetworkFabricProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("administrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeState = new NetworkFabricAdministrativeState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkTapRuleProperties( + annotation, + configurationType, + tapRulesUrl, + matchConfigurations ?? new ChangeTrackingList(), + dynamicMatchConfigurations ?? new ChangeTrackingList(), + networkTapId, + pollingIntervalInSeconds, + lastSyncedTime, + globalNetworkTapRuleActions, + lastOperation, + configurationState, + provisioningState, + administrativeState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkTapRuleProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkTapRuleProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkTapRuleProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkTapRuleProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleProperties.cs new file mode 100644 index 000000000000..338920046e97 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkTapRuleProperties.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Network Tap Rule Properties defines the resource properties. + public partial class NetworkTapRuleProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Input method to configure Network Tap Rule. + public NetworkTapRuleProperties(NetworkFabricConfigurationType configurationType) + { + ConfigurationType = configurationType; + MatchConfigurations = new ChangeTrackingList(); + DynamicMatchConfigurations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Input method to configure Network Tap Rule. + /// Network Tap Rules file URL. + /// List of match configurations. + /// List of dynamic match configurations. + /// The ARM resource Id of the NetworkTap. + /// Polling interval in seconds. + /// The last sync timestamp. + /// Global network tap rule actions. + /// Details of the last operation performed on the resource. + /// Configuration state of the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// Keeps track of any properties unknown to the library. + internal NetworkTapRuleProperties(string annotation, NetworkFabricConfigurationType configurationType, Uri tapRulesUri, IList matchConfigurations, IList dynamicMatchConfigurations, string networkTapId, PollingIntervalInSecond? pollingIntervalInSeconds, DateTimeOffset? lastSyncedOn, GlobalNetworkTapRuleActionProperties globalNetworkTapRuleActions, LastOperationProperties lastOperation, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + ConfigurationType = configurationType; + TapRulesUri = tapRulesUri; + MatchConfigurations = matchConfigurations; + DynamicMatchConfigurations = dynamicMatchConfigurations; + NetworkTapId = networkTapId; + PollingIntervalInSeconds = pollingIntervalInSeconds; + LastSyncedOn = lastSyncedOn; + GlobalNetworkTapRuleActions = globalNetworkTapRuleActions; + LastOperation = lastOperation; + ConfigurationState = configurationState; + ProvisioningState = provisioningState; + AdministrativeState = administrativeState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkTapRuleProperties() + { + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// Input method to configure Network Tap Rule. + public NetworkFabricConfigurationType ConfigurationType { get; set; } + /// Network Tap Rules file URL. + public Uri TapRulesUri { get; set; } + /// List of match configurations. + public IList MatchConfigurations { get; } + /// List of dynamic match configurations. + public IList DynamicMatchConfigurations { get; } + /// The ARM resource Id of the NetworkTap. + public string NetworkTapId { get; } + /// Polling interval in seconds. + public PollingIntervalInSecond? PollingIntervalInSeconds { get; set; } + /// The last sync timestamp. + public DateTimeOffset? LastSyncedOn { get; } + /// Global network tap rule actions. + public GlobalNetworkTapRuleActionProperties GlobalNetworkTapRuleActions { get; set; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + + /// Configuration state of the resource. + public NetworkFabricConfigurationState? ConfigurationState { get; } + /// Provisioning state of the resource. + public NetworkFabricProvisioningState? ProvisioningState { get; } + /// Administrative state of the resource. + public NetworkFabricAdministrativeState? AdministrativeState { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectsList.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectListResult.Serialization.cs similarity index 64% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectsList.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectListResult.Serialization.cs index 6a8d7911d17e..7a3fd6837ef9 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectsList.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class NetworkToNetworkInterconnectsList : IUtf8JsonSerializable, IJsonModel + internal partial class NetworkToNetworkInterconnectListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectsList)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NetworkToNetworkInterconnectsList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NetworkToNetworkInterconnectListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectsList)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkToNetworkInterconnectsList(document.RootElement, options); + return DeserializeNetworkToNetworkInterconnectListResult(document.RootElement, options); } - internal static NetworkToNetworkInterconnectsList DeserializeNetworkToNetworkInterconnectsList(JsonElement element, ModelReaderWriterOptions options = null) + internal static NetworkToNetworkInterconnectListResult DeserializeNetworkToNetworkInterconnectListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -87,17 +84,13 @@ internal static NetworkToNetworkInterconnectsList DeserializeNetworkToNetworkInt return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static NetworkToNetworkInterconnectsList DeserializeNetworkToNetworkInt } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,38 +114,38 @@ internal static NetworkToNetworkInterconnectsList DeserializeNetworkToNetworkInt } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkToNetworkInterconnectsList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NetworkToNetworkInterconnectListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectsList)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectListResult)} does not support writing '{options.Format}' format."); } } - NetworkToNetworkInterconnectsList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NetworkToNetworkInterconnectListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkToNetworkInterconnectsList(document.RootElement, options); + return DeserializeNetworkToNetworkInterconnectListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectsList)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectListResult.cs new file mode 100644 index 000000000000..791374952a78 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a NetworkToNetworkInterconnect list operation. + internal partial class NetworkToNetworkInterconnectListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The NetworkToNetworkInterconnect items on this page. + /// is null. + internal NetworkToNetworkInterconnectListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The NetworkToNetworkInterconnect items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NetworkToNetworkInterconnectListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkToNetworkInterconnectListResult() + { + } + + /// The NetworkToNetworkInterconnect items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectOptionBLayer3Configuration.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectOptionBLayer3Configuration.Serialization.cs deleted file mode 100644 index dc4ea1d1d51a..000000000000 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectOptionBLayer3Configuration.Serialization.cs +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ManagedNetworkFabric.Models -{ - public partial class NetworkToNetworkInterconnectOptionBLayer3Configuration : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectOptionBLayer3Configuration)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - } - - NetworkToNetworkInterconnectOptionBLayer3Configuration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectOptionBLayer3Configuration)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkToNetworkInterconnectOptionBLayer3Configuration(document.RootElement, options); - } - - internal static NetworkToNetworkInterconnectOptionBLayer3Configuration DeserializeNetworkToNetworkInterconnectOptionBLayer3Configuration(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - long? peerAsn = default; - int? vlanId = default; - long? fabricAsn = default; - string primaryIPv4Prefix = default; - string primaryIPv6Prefix = default; - string secondaryIPv4Prefix = default; - string secondaryIPv6Prefix = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("peerASN"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - peerAsn = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("vlanId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - vlanId = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("fabricASN"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - fabricAsn = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("primaryIpv4Prefix"u8)) - { - primaryIPv4Prefix = property.Value.GetString(); - continue; - } - if (property.NameEquals("primaryIpv6Prefix"u8)) - { - primaryIPv6Prefix = property.Value.GetString(); - continue; - } - if (property.NameEquals("secondaryIpv4Prefix"u8)) - { - secondaryIPv4Prefix = property.Value.GetString(); - continue; - } - if (property.NameEquals("secondaryIpv6Prefix"u8)) - { - secondaryIPv6Prefix = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NetworkToNetworkInterconnectOptionBLayer3Configuration( - primaryIPv4Prefix, - primaryIPv6Prefix, - secondaryIPv4Prefix, - secondaryIPv6Prefix, - serializedAdditionalRawData, - peerAsn, - vlanId, - fabricAsn); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); - default: - throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectOptionBLayer3Configuration)} does not support writing '{options.Format}' format."); - } - } - - NetworkToNetworkInterconnectOptionBLayer3Configuration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkToNetworkInterconnectOptionBLayer3Configuration(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectOptionBLayer3Configuration)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectOptionBLayer3Configuration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectOptionBLayer3Configuration.cs deleted file mode 100644 index cb8a5edf10de..000000000000 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectOptionBLayer3Configuration.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ManagedNetworkFabric.Models -{ - /// Common properties for Layer3Configuration. - public partial class NetworkToNetworkInterconnectOptionBLayer3Configuration : OptionBLayer3Configuration - { - /// Initializes a new instance of . - public NetworkToNetworkInterconnectOptionBLayer3Configuration() - { - } - - /// Initializes a new instance of . - /// IPv4 Address Prefix. - /// IPv6 Address Prefix. - /// Secondary IPv4 Address Prefix. - /// Secondary IPv6 Address Prefix. - /// Keeps track of any properties unknown to the library. - /// ASN of PE devices for CE/PE connectivity.Example : 28. - /// VLAN for CE/PE Layer 3 connectivity.Example : 501. - /// ASN of CE devices for CE/PE connectivity. - internal NetworkToNetworkInterconnectOptionBLayer3Configuration(string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix, IDictionary serializedAdditionalRawData, long? peerAsn, int? vlanId, long? fabricAsn) : base(primaryIPv4Prefix, primaryIPv6Prefix, secondaryIPv4Prefix, secondaryIPv6Prefix, serializedAdditionalRawData, peerAsn, vlanId, fabricAsn) - { - } - } -} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectPatch.Serialization.cs index 32c1d8c53d62..152149b4e8e3 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectPatch.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectPatch.Serialization.cs @@ -28,7 +28,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -36,45 +36,41 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectPatch)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Layer2Configuration)) - { - writer.WritePropertyName("layer2Configuration"u8); - writer.WriteObjectValue(Layer2Configuration, options); - } - if (Optional.IsDefined(OptionBLayer3Configuration)) - { - writer.WritePropertyName("optionBLayer3Configuration"u8); - writer.WriteObjectValue(OptionBLayer3Configuration, options); - } - if (Optional.IsDefined(NpbStaticRouteConfiguration)) + if (options.Format != "W" && Optional.IsDefined(Id)) { - writer.WritePropertyName("npbStaticRouteConfiguration"u8); - writer.WriteObjectValue(NpbStaticRouteConfiguration, options); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); } - if (Optional.IsDefined(ImportRoutePolicy)) + if (options.Format != "W" && Optional.IsDefined(NetworkToNetworkInterconnectPatchType)) { - writer.WritePropertyName("importRoutePolicy"u8); - writer.WriteObjectValue(ImportRoutePolicy, options); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(NetworkToNetworkInterconnectPatchType); } - if (Optional.IsDefined(ExportRoutePolicy)) + if (options.Format != "W" && Optional.IsDefined(SystemData)) { - writer.WritePropertyName("exportRoutePolicy"u8); - writer.WriteObjectValue(ExportRoutePolicy, options); + writer.WritePropertyName("systemData"u8); + ((IJsonModel)SystemData).Write(writer, options); } - if (Optional.IsDefined(EgressAclId)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("egressAclId"u8); - writer.WriteStringValue(EgressAclId); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - if (Optional.IsDefined(IngressAclId)) + if (options.Format != "W" && _serializedAdditionalRawData != null) { - writer.WritePropertyName("ingressAclId"u8); - writer.WriteStringValue(IngressAclId); + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } } - writer.WriteEndObject(); } NetworkToNetworkInterconnectPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -98,33 +94,25 @@ internal static NetworkToNetworkInterconnectPatch DeserializeNetworkToNetworkInt return null; } ResourceIdentifier id = default; - string name = default; - ResourceType type = default; + string type = default; SystemData systemData = default; - Layer2Configuration layer2Configuration = default; - OptionBLayer3Configuration optionBLayer3Configuration = default; - NpbStaticRouteConfiguration npbStaticRouteConfiguration = default; - ImportRoutePolicyInformation importRoutePolicy = default; - ExportRoutePolicyInformation exportRoutePolicy = default; - ResourceIdentifier egressAclId = default; - ResourceIdentifier ingressAclId = default; + NetworkToNetworkInterconnectPatchProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } id = new ResourceIdentifier(property.Value.GetString()); continue; } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } if (property.NameEquals("type"u8)) { - type = new ResourceType(property.Value.GetString()); + type = property.Value.GetString(); continue; } if (property.NameEquals("systemData"u8)) @@ -140,75 +128,9 @@ internal static NetworkToNetworkInterconnectPatch DeserializeNetworkToNetworkInt { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("layer2Configuration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - layer2Configuration = Layer2Configuration.DeserializeLayer2Configuration(property0.Value, options); - continue; - } - if (property0.NameEquals("optionBLayer3Configuration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - optionBLayer3Configuration = OptionBLayer3Configuration.DeserializeOptionBLayer3Configuration(property0.Value, options); - continue; - } - if (property0.NameEquals("npbStaticRouteConfiguration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - npbStaticRouteConfiguration = NpbStaticRouteConfiguration.DeserializeNpbStaticRouteConfiguration(property0.Value, options); - continue; - } - if (property0.NameEquals("importRoutePolicy"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - importRoutePolicy = ImportRoutePolicyInformation.DeserializeImportRoutePolicyInformation(property0.Value, options); - continue; - } - if (property0.NameEquals("exportRoutePolicy"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - exportRoutePolicy = ExportRoutePolicyInformation.DeserializeExportRoutePolicyInformation(property0.Value, options); - continue; - } - if (property0.NameEquals("egressAclId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - egressAclId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("ingressAclId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - ingressAclId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - } + properties = NetworkToNetworkInterconnectPatchProperties.DeserializeNetworkToNetworkInterconnectPatchProperties(property.Value, options); continue; } if (options.Format != "W") @@ -217,19 +139,7 @@ internal static NetworkToNetworkInterconnectPatch DeserializeNetworkToNetworkInt } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkToNetworkInterconnectPatch( - id, - name, - type, - systemData, - layer2Configuration, - optionBLayer3Configuration, - npbStaticRouteConfiguration, - importRoutePolicy, - exportRoutePolicy, - egressAclId, - ingressAclId, - serializedAdditionalRawData); + return new NetworkToNetworkInterconnectPatch(id, type, systemData, properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectPatch.cs index 32c075d048a1..3b81a2945736 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectPatch.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectPatch.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// The Network To Network Interconnect resource patch definition. - public partial class NetworkToNetworkInterconnectPatch : ResourceData + public partial class NetworkToNetworkInterconnectPatch { /// /// Keeps track of any properties unknown to the library. @@ -53,43 +53,27 @@ public NetworkToNetworkInterconnectPatch() } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Common properties for Layer2Configuration. - /// Common properties for Layer3Configuration. - /// NPB Static Route Configuration properties. - /// Import Route Policy information. - /// Export Route Policy information. - /// Egress Acl. ARM resource ID of Access Control Lists. - /// Ingress Acl. ARM resource ID of Access Control Lists. + /// Fully qualified resource ID for the resource. E.g. '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'. + /// The type of the resource. E.g. 'Microsoft.Compute/virtualMachines' or 'Microsoft.Storage/storageAccounts'. + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Resource properties. /// Keeps track of any properties unknown to the library. - internal NetworkToNetworkInterconnectPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, Layer2Configuration layer2Configuration, OptionBLayer3Configuration optionBLayer3Configuration, NpbStaticRouteConfiguration npbStaticRouteConfiguration, ImportRoutePolicyInformation importRoutePolicy, ExportRoutePolicyInformation exportRoutePolicy, ResourceIdentifier egressAclId, ResourceIdentifier ingressAclId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal NetworkToNetworkInterconnectPatch(ResourceIdentifier id, string networkToNetworkInterconnectPatchType, SystemData systemData, NetworkToNetworkInterconnectPatchProperties properties, IDictionary serializedAdditionalRawData) { - Layer2Configuration = layer2Configuration; - OptionBLayer3Configuration = optionBLayer3Configuration; - NpbStaticRouteConfiguration = npbStaticRouteConfiguration; - ImportRoutePolicy = importRoutePolicy; - ExportRoutePolicy = exportRoutePolicy; - EgressAclId = egressAclId; - IngressAclId = ingressAclId; + Id = id; + NetworkToNetworkInterconnectPatchType = networkToNetworkInterconnectPatchType; + SystemData = systemData; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Common properties for Layer2Configuration. - public Layer2Configuration Layer2Configuration { get; set; } - /// Common properties for Layer3Configuration. - public OptionBLayer3Configuration OptionBLayer3Configuration { get; set; } - /// NPB Static Route Configuration properties. - public NpbStaticRouteConfiguration NpbStaticRouteConfiguration { get; set; } - /// Import Route Policy information. - public ImportRoutePolicyInformation ImportRoutePolicy { get; set; } - /// Export Route Policy information. - public ExportRoutePolicyInformation ExportRoutePolicy { get; set; } - /// Egress Acl. ARM resource ID of Access Control Lists. - public ResourceIdentifier EgressAclId { get; set; } - /// Ingress Acl. ARM resource ID of Access Control Lists. - public ResourceIdentifier IngressAclId { get; set; } + /// Fully qualified resource ID for the resource. E.g. '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'. + public ResourceIdentifier Id { get; } + /// The type of the resource. E.g. 'Microsoft.Compute/virtualMachines' or 'Microsoft.Storage/storageAccounts'. + public string NetworkToNetworkInterconnectPatchType { get; } + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + public SystemData SystemData { get; } + /// Resource properties. + public NetworkToNetworkInterconnectPatchProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectPatchProperties.Serialization.cs new file mode 100644 index 000000000000..77f5675bf30d --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectPatchProperties.Serialization.cs @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkToNetworkInterconnectPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Layer2Configuration)) + { + writer.WritePropertyName("layer2Configuration"u8); + writer.WriteObjectValue(Layer2Configuration, options); + } + if (Optional.IsDefined(OptionBLayer3Configuration)) + { + writer.WritePropertyName("optionBLayer3Configuration"u8); + writer.WriteObjectValue(OptionBLayer3Configuration, options); + } + if (Optional.IsDefined(NpbStaticRouteConfiguration)) + { + writer.WritePropertyName("npbStaticRouteConfiguration"u8); + writer.WriteObjectValue(NpbStaticRouteConfiguration, options); + } + if (Optional.IsDefined(StaticRouteConfiguration)) + { + writer.WritePropertyName("staticRouteConfiguration"u8); + writer.WriteObjectValue(StaticRouteConfiguration, options); + } + if (Optional.IsDefined(ImportRoutePolicy)) + { + writer.WritePropertyName("importRoutePolicy"u8); + writer.WriteObjectValue(ImportRoutePolicy, options); + } + if (Optional.IsDefined(ExportRoutePolicy)) + { + writer.WritePropertyName("exportRoutePolicy"u8); + writer.WriteObjectValue(ExportRoutePolicy, options); + } + if (Optional.IsDefined(EgressAclId)) + { + writer.WritePropertyName("egressAclId"u8); + writer.WriteStringValue(EgressAclId); + } + if (Optional.IsDefined(IngressAclId)) + { + writer.WritePropertyName("ingressAclId"u8); + writer.WriteStringValue(IngressAclId); + } + if (Optional.IsDefined(MicroBfdState)) + { + writer.WritePropertyName("microBfdState"u8); + writer.WriteStringValue(MicroBfdState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkToNetworkInterconnectPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkToNetworkInterconnectPatchProperties(document.RootElement, options); + } + + internal static NetworkToNetworkInterconnectPatchProperties DeserializeNetworkToNetworkInterconnectPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Layer2ConfigurationPatch layer2Configuration = default; + OptionBLayer3ConfigurationPatchProperties optionBLayer3Configuration = default; + NpbStaticRouteConfigurationPatch npbStaticRouteConfiguration = default; + NniStaticRoutePatchConfiguration staticRouteConfiguration = default; + ImportRoutePolicyInformationPatch importRoutePolicy = default; + ExportRoutePolicyInformationPatch exportRoutePolicy = default; + ResourceIdentifier egressAclId = default; + ResourceIdentifier ingressAclId = default; + MicroBfdState? microBfdState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("layer2Configuration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + layer2Configuration = Layer2ConfigurationPatch.DeserializeLayer2ConfigurationPatch(property.Value, options); + continue; + } + if (property.NameEquals("optionBLayer3Configuration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + optionBLayer3Configuration = OptionBLayer3ConfigurationPatchProperties.DeserializeOptionBLayer3ConfigurationPatchProperties(property.Value, options); + continue; + } + if (property.NameEquals("npbStaticRouteConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + npbStaticRouteConfiguration = NpbStaticRouteConfigurationPatch.DeserializeNpbStaticRouteConfigurationPatch(property.Value, options); + continue; + } + if (property.NameEquals("staticRouteConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + staticRouteConfiguration = NniStaticRoutePatchConfiguration.DeserializeNniStaticRoutePatchConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("importRoutePolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + importRoutePolicy = ImportRoutePolicyInformationPatch.DeserializeImportRoutePolicyInformationPatch(property.Value, options); + continue; + } + if (property.NameEquals("exportRoutePolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exportRoutePolicy = ExportRoutePolicyInformationPatch.DeserializeExportRoutePolicyInformationPatch(property.Value, options); + continue; + } + if (property.NameEquals("egressAclId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + egressAclId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("ingressAclId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ingressAclId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("microBfdState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + microBfdState = new MicroBfdState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkToNetworkInterconnectPatchProperties( + layer2Configuration, + optionBLayer3Configuration, + npbStaticRouteConfiguration, + staticRouteConfiguration, + importRoutePolicy, + exportRoutePolicy, + egressAclId, + ingressAclId, + microBfdState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkToNetworkInterconnectPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkToNetworkInterconnectPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectPatchProperties.cs new file mode 100644 index 000000000000..d2a5ac6aec97 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectPatchProperties.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Network Tap Rule Patch properties. + public partial class NetworkToNetworkInterconnectPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NetworkToNetworkInterconnectPatchProperties() + { + } + + /// Initializes a new instance of . + /// Common properties for Layer2Configuration. + /// Common properties for Layer3Configuration. + /// NPB Static Route Configuration properties. + /// Static Route Configuration. + /// Import Route Policy information. + /// Export Route Policy information. + /// Egress Acl. ARM resource ID of Access Control Lists. + /// Ingress Acl. ARM resource ID of Access Control Lists. + /// Micro BFD enabled/disabled state. + /// Keeps track of any properties unknown to the library. + internal NetworkToNetworkInterconnectPatchProperties(Layer2ConfigurationPatch layer2Configuration, OptionBLayer3ConfigurationPatchProperties optionBLayer3Configuration, NpbStaticRouteConfigurationPatch npbStaticRouteConfiguration, NniStaticRoutePatchConfiguration staticRouteConfiguration, ImportRoutePolicyInformationPatch importRoutePolicy, ExportRoutePolicyInformationPatch exportRoutePolicy, ResourceIdentifier egressAclId, ResourceIdentifier ingressAclId, MicroBfdState? microBfdState, IDictionary serializedAdditionalRawData) + { + Layer2Configuration = layer2Configuration; + OptionBLayer3Configuration = optionBLayer3Configuration; + NpbStaticRouteConfiguration = npbStaticRouteConfiguration; + StaticRouteConfiguration = staticRouteConfiguration; + ImportRoutePolicy = importRoutePolicy; + ExportRoutePolicy = exportRoutePolicy; + EgressAclId = egressAclId; + IngressAclId = ingressAclId; + MicroBfdState = microBfdState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Common properties for Layer2Configuration. + public Layer2ConfigurationPatch Layer2Configuration { get; set; } + /// Common properties for Layer3Configuration. + public OptionBLayer3ConfigurationPatchProperties OptionBLayer3Configuration { get; set; } + /// NPB Static Route Configuration properties. + public NpbStaticRouteConfigurationPatch NpbStaticRouteConfiguration { get; set; } + /// Static Route Configuration. + public NniStaticRoutePatchConfiguration StaticRouteConfiguration { get; set; } + /// Import Route Policy information. + public ImportRoutePolicyInformationPatch ImportRoutePolicy { get; set; } + /// Export Route Policy information. + public ExportRoutePolicyInformationPatch ExportRoutePolicy { get; set; } + /// Egress Acl. ARM resource ID of Access Control Lists. + public ResourceIdentifier EgressAclId { get; set; } + /// Ingress Acl. ARM resource ID of Access Control Lists. + public ResourceIdentifier IngressAclId { get; set; } + /// Micro BFD enabled/disabled state. + public MicroBfdState? MicroBfdState { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectProperties.Serialization.cs new file mode 100644 index 000000000000..74ac39cf73d2 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectProperties.Serialization.cs @@ -0,0 +1,384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NetworkToNetworkInterconnectProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NniType)) + { + writer.WritePropertyName("nniType"u8); + writer.WriteStringValue(NniType.Value.ToString()); + } + if (Optional.IsDefined(IsManagementType)) + { + writer.WritePropertyName("isManagementType"u8); + writer.WriteStringValue(IsManagementType.Value.ToString()); + } + writer.WritePropertyName("useOptionB"u8); + writer.WriteStringValue(UseOptionB.ToString()); + if (Optional.IsDefined(Layer2Configuration)) + { + writer.WritePropertyName("layer2Configuration"u8); + writer.WriteObjectValue(Layer2Configuration, options); + } + if (Optional.IsDefined(OptionBLayer3Configuration)) + { + writer.WritePropertyName("optionBLayer3Configuration"u8); + writer.WriteObjectValue(OptionBLayer3Configuration, options); + } + if (Optional.IsDefined(NpbStaticRouteConfiguration)) + { + writer.WritePropertyName("npbStaticRouteConfiguration"u8); + writer.WriteObjectValue(NpbStaticRouteConfiguration, options); + } + if (Optional.IsDefined(StaticRouteConfiguration)) + { + writer.WritePropertyName("staticRouteConfiguration"u8); + writer.WriteObjectValue(StaticRouteConfiguration, options); + } + if (Optional.IsDefined(ImportRoutePolicy)) + { + writer.WritePropertyName("importRoutePolicy"u8); + writer.WriteObjectValue(ImportRoutePolicy, options); + } + if (Optional.IsDefined(ExportRoutePolicy)) + { + writer.WritePropertyName("exportRoutePolicy"u8); + writer.WriteObjectValue(ExportRoutePolicy, options); + } + if (Optional.IsDefined(EgressAclId)) + { + writer.WritePropertyName("egressAclId"u8); + writer.WriteStringValue(EgressAclId); + } + if (Optional.IsDefined(IngressAclId)) + { + writer.WritePropertyName("ingressAclId"u8); + writer.WriteStringValue(IngressAclId); + } + if (Optional.IsDefined(MicroBfdState)) + { + writer.WritePropertyName("microBfdState"u8); + writer.WriteStringValue(MicroBfdState.Value.ToString()); + } + if (Optional.IsDefined(ConditionalDefaultRouteConfiguration)) + { + writer.WritePropertyName("conditionalDefaultRouteConfiguration"u8); + writer.WriteObjectValue(ConditionalDefaultRouteConfiguration, options); + } + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } + if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) + { + writer.WritePropertyName("configurationState"u8); + writer.WriteStringValue(ConfigurationState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) + { + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkToNetworkInterconnectProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkToNetworkInterconnectProperties(document.RootElement, options); + } + + internal static NetworkToNetworkInterconnectProperties DeserializeNetworkToNetworkInterconnectProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NniType? nniType = default; + IsManagementType? isManagementType = default; + NetworkFabricBooleanValue useOptionB = default; + Layer2Configuration layer2Configuration = default; + OptionBLayer3Configuration optionBLayer3Configuration = default; + NpbStaticRouteConfiguration npbStaticRouteConfiguration = default; + NniStaticRouteConfiguration staticRouteConfiguration = default; + ImportRoutePolicyInformation importRoutePolicy = default; + ExportRoutePolicyInformation exportRoutePolicy = default; + ResourceIdentifier egressAclId = default; + ResourceIdentifier ingressAclId = default; + MicroBfdState? microBfdState = default; + ConditionalDefaultRouteProperties conditionalDefaultRouteConfiguration = default; + LastOperationProperties lastOperation = default; + NetworkFabricConfigurationState? configurationState = default; + NetworkFabricProvisioningState? provisioningState = default; + NetworkFabricAdministrativeState? administrativeState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nniType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nniType = new NniType(property.Value.GetString()); + continue; + } + if (property.NameEquals("isManagementType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isManagementType = new IsManagementType(property.Value.GetString()); + continue; + } + if (property.NameEquals("useOptionB"u8)) + { + useOptionB = new NetworkFabricBooleanValue(property.Value.GetString()); + continue; + } + if (property.NameEquals("layer2Configuration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + layer2Configuration = Layer2Configuration.DeserializeLayer2Configuration(property.Value, options); + continue; + } + if (property.NameEquals("optionBLayer3Configuration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + optionBLayer3Configuration = OptionBLayer3Configuration.DeserializeOptionBLayer3Configuration(property.Value, options); + continue; + } + if (property.NameEquals("npbStaticRouteConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + npbStaticRouteConfiguration = NpbStaticRouteConfiguration.DeserializeNpbStaticRouteConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("staticRouteConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + staticRouteConfiguration = NniStaticRouteConfiguration.DeserializeNniStaticRouteConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("importRoutePolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + importRoutePolicy = ImportRoutePolicyInformation.DeserializeImportRoutePolicyInformation(property.Value, options); + continue; + } + if (property.NameEquals("exportRoutePolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exportRoutePolicy = ExportRoutePolicyInformation.DeserializeExportRoutePolicyInformation(property.Value, options); + continue; + } + if (property.NameEquals("egressAclId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + egressAclId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("ingressAclId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ingressAclId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("microBfdState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + microBfdState = new MicroBfdState(property.Value.GetString()); + continue; + } + if (property.NameEquals("conditionalDefaultRouteConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + conditionalDefaultRouteConfiguration = ConditionalDefaultRouteProperties.DeserializeConditionalDefaultRouteProperties(property.Value, options); + continue; + } + if (property.NameEquals("lastOperation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property.Value, options); + continue; + } + if (property.NameEquals("configurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configurationState = new NetworkFabricConfigurationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NetworkFabricProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("administrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeState = new NetworkFabricAdministrativeState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkToNetworkInterconnectProperties( + nniType, + isManagementType, + useOptionB, + layer2Configuration, + optionBLayer3Configuration, + npbStaticRouteConfiguration, + staticRouteConfiguration, + importRoutePolicy, + exportRoutePolicy, + egressAclId, + ingressAclId, + microBfdState, + conditionalDefaultRouteConfiguration, + lastOperation, + configurationState, + provisioningState, + administrativeState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkToNetworkInterconnectProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkToNetworkInterconnectProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkToNetworkInterconnectProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectProperties.cs new file mode 100644 index 000000000000..1099ce845f14 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkToNetworkInterconnectProperties.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Configuration used to setup CE-PE connectivity. + public partial class NetworkToNetworkInterconnectProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Based on this option layer3 parameters are mandatory. Example: True/False. + public NetworkToNetworkInterconnectProperties(NetworkFabricBooleanValue useOptionB) + { + UseOptionB = useOptionB; + } + + /// Initializes a new instance of . + /// Type of NNI used. Example: CE | NPB. + /// Configuration to use NNI for Infrastructure Management. Example: True/False. + /// Based on this option layer3 parameters are mandatory. Example: True/False. + /// Common properties for Layer2 Configuration. + /// Common properties for Layer3Configuration. + /// NPB Static Route Configuration properties. + /// Static Route Configuration. + /// Import Route Policy information. + /// Export Route Policy information. + /// Egress Acl. ARM resource ID of Access Control Lists. + /// Ingress Acl. ARM resource ID of Access Control Lists. + /// Micro Bidirectional Forwarding Detection (BFD) enabled/disabled state. + /// Conditional Default Route Configuration properties. + /// Details of the last operation performed on the resource. + /// Configuration state of the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// Keeps track of any properties unknown to the library. + internal NetworkToNetworkInterconnectProperties(NniType? nniType, IsManagementType? isManagementType, NetworkFabricBooleanValue useOptionB, Layer2Configuration layer2Configuration, OptionBLayer3Configuration optionBLayer3Configuration, NpbStaticRouteConfiguration npbStaticRouteConfiguration, NniStaticRouteConfiguration staticRouteConfiguration, ImportRoutePolicyInformation importRoutePolicy, ExportRoutePolicyInformation exportRoutePolicy, ResourceIdentifier egressAclId, ResourceIdentifier ingressAclId, MicroBfdState? microBfdState, ConditionalDefaultRouteProperties conditionalDefaultRouteConfiguration, LastOperationProperties lastOperation, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) + { + NniType = nniType; + IsManagementType = isManagementType; + UseOptionB = useOptionB; + Layer2Configuration = layer2Configuration; + OptionBLayer3Configuration = optionBLayer3Configuration; + NpbStaticRouteConfiguration = npbStaticRouteConfiguration; + StaticRouteConfiguration = staticRouteConfiguration; + ImportRoutePolicy = importRoutePolicy; + ExportRoutePolicy = exportRoutePolicy; + EgressAclId = egressAclId; + IngressAclId = ingressAclId; + MicroBfdState = microBfdState; + ConditionalDefaultRouteConfiguration = conditionalDefaultRouteConfiguration; + LastOperation = lastOperation; + ConfigurationState = configurationState; + ProvisioningState = provisioningState; + AdministrativeState = administrativeState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkToNetworkInterconnectProperties() + { + } + + /// Type of NNI used. Example: CE | NPB. + public NniType? NniType { get; set; } + /// Configuration to use NNI for Infrastructure Management. Example: True/False. + public IsManagementType? IsManagementType { get; set; } + /// Based on this option layer3 parameters are mandatory. Example: True/False. + public NetworkFabricBooleanValue UseOptionB { get; set; } + /// Common properties for Layer2 Configuration. + public Layer2Configuration Layer2Configuration { get; set; } + /// Common properties for Layer3Configuration. + public OptionBLayer3Configuration OptionBLayer3Configuration { get; set; } + /// NPB Static Route Configuration properties. + public NpbStaticRouteConfiguration NpbStaticRouteConfiguration { get; set; } + /// Static Route Configuration. + public NniStaticRouteConfiguration StaticRouteConfiguration { get; set; } + /// Import Route Policy information. + public ImportRoutePolicyInformation ImportRoutePolicy { get; set; } + /// Export Route Policy information. + public ExportRoutePolicyInformation ExportRoutePolicy { get; set; } + /// Egress Acl. ARM resource ID of Access Control Lists. + public ResourceIdentifier EgressAclId { get; set; } + /// Ingress Acl. ARM resource ID of Access Control Lists. + public ResourceIdentifier IngressAclId { get; set; } + /// Micro Bidirectional Forwarding Detection (BFD) enabled/disabled state. + public MicroBfdState? MicroBfdState { get; set; } + /// Conditional Default Route Configuration properties. + public ConditionalDefaultRouteProperties ConditionalDefaultRouteConfiguration { get; set; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + + /// Configuration state of the resource. + public NetworkFabricConfigurationState? ConfigurationState { get; } + /// Provisioning state of the resource. + public NetworkFabricProvisioningState? ProvisioningState { get; } + /// Administrative state of the resource. + public NetworkFabricAdministrativeState? AdministrativeState { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBfdAdministrativeStateContent.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBfdAdministrativeStateContent.Serialization.cs new file mode 100644 index 000000000000..415ccb770faa --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBfdAdministrativeStateContent.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NniBfdAdministrativeStateContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NniBfdAdministrativeStateContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RouteType)) + { + writer.WritePropertyName("routeType"u8); + writer.WriteStringValue(RouteType.Value.ToString()); + } + if (Optional.IsDefined(AdministrativeState)) + { + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NniBfdAdministrativeStateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NniBfdAdministrativeStateContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNniBfdAdministrativeStateContent(document.RootElement, options); + } + + internal static NniBfdAdministrativeStateContent DeserializeNniBfdAdministrativeStateContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RouteType? routeType = default; + BfdAdministrativeState? administrativeState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("routeType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + routeType = new RouteType(property.Value.GetString()); + continue; + } + if (property.NameEquals("administrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeState = new BfdAdministrativeState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NniBfdAdministrativeStateContent(routeType, administrativeState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NniBfdAdministrativeStateContent)} does not support writing '{options.Format}' format."); + } + } + + NniBfdAdministrativeStateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNniBfdAdministrativeStateContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NniBfdAdministrativeStateContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupsListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBfdAdministrativeStateContent.cs similarity index 65% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupsListResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBfdAdministrativeStateContent.cs index 13c8ccf49936..077a9929b057 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NeighborGroupsListResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBfdAdministrativeStateContent.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of Neighbor Group. - internal partial class NeighborGroupsListResult + /// NNI Bidirectional Forwarding Detection (BFD) Administrative State request. + public partial class NniBfdAdministrativeStateContent { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,25 @@ internal partial class NeighborGroupsListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal NeighborGroupsListResult() + /// Initializes a new instance of . + public NniBfdAdministrativeStateContent() { - Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of Neighbor Group resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// Route Type. Choose either Static or OptionA. + /// State. Select either enable or disable. /// Keeps track of any properties unknown to the library. - internal NeighborGroupsListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NniBfdAdministrativeStateContent(RouteType? routeType, BfdAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + RouteType = routeType; + AdministrativeState = administrativeState; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of Neighbor Group resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// Route Type. Choose either Static or OptionA. + public RouteType? RouteType { get; set; } + /// State. Select either enable or disable. + public BfdAdministrativeState? AdministrativeState { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBfdAdministrativeStateResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBfdAdministrativeStateResult.Serialization.cs new file mode 100644 index 000000000000..9ece0d4414ce --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBfdAdministrativeStateResult.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NniBfdAdministrativeStateResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NniBfdAdministrativeStateResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RouteType)) + { + writer.WritePropertyName("routeType"u8); + writer.WriteStringValue(RouteType.Value.ToString()); + } + if (Optional.IsDefined(AdministrativeState)) + { + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + ((IJsonModel)Error).Write(writer, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NniBfdAdministrativeStateResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NniBfdAdministrativeStateResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNniBfdAdministrativeStateResult(document.RootElement, options); + } + + internal static NniBfdAdministrativeStateResult DeserializeNniBfdAdministrativeStateResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RouteType? routeType = default; + BfdAdministrativeState? administrativeState = default; + ResponseError error = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("routeType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + routeType = new RouteType(property.Value.GetString()); + continue; + } + if (property.NameEquals("administrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeState = new BfdAdministrativeState(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerManagedNetworkFabricContext.Default); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NniBfdAdministrativeStateResult(routeType, administrativeState, error, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NniBfdAdministrativeStateResult)} does not support writing '{options.Format}' format."); + } + } + + NniBfdAdministrativeStateResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNniBfdAdministrativeStateResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NniBfdAdministrativeStateResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBfdAdministrativeStateResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBfdAdministrativeStateResult.cs new file mode 100644 index 000000000000..918f5d1a69a7 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBfdAdministrativeStateResult.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// NNI Bidirectional Forwarding Detection (BFD) Administrative State response. + public partial class NniBfdAdministrativeStateResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal NniBfdAdministrativeStateResult() + { + } + + /// Initializes a new instance of . + /// Route Type. Choose either Static or OptionA. + /// State. Select either enable or disable. + /// The error object. + /// Keeps track of any properties unknown to the library. + internal NniBfdAdministrativeStateResult(RouteType? routeType, BfdAdministrativeState? administrativeState, ResponseError error, IDictionary serializedAdditionalRawData) + { + RouteType = routeType; + AdministrativeState = administrativeState; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Route Type. Choose either Static or OptionA. + public RouteType? RouteType { get; } + /// State. Select either enable or disable. + public BfdAdministrativeState? AdministrativeState { get; } + /// The error object. + public ResponseError Error { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBmpPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBmpPatchProperties.Serialization.cs new file mode 100644 index 000000000000..0c5f9b54414a --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBmpPatchProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class NniBmpPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NniBmpPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ConfigurationState)) + { + writer.WritePropertyName("configurationState"u8); + writer.WriteStringValue(ConfigurationState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NniBmpPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NniBmpPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNniBmpPatchProperties(document.RootElement, options); + } + + internal static NniBmpPatchProperties DeserializeNniBmpPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BmpConfigurationState? configurationState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("configurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configurationState = new BmpConfigurationState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NniBmpPatchProperties(configurationState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NniBmpPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + NniBmpPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNniBmpPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NniBmpPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricErrorResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBmpPatchProperties.cs similarity index 71% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricErrorResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBmpPatchProperties.cs index c1e2efe9e1f4..366c72a3c5db 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricErrorResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBmpPatchProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - public partial class NetworkFabricErrorResult + /// BGP Monitoring Protocol (BMP) patch properties. + internal partial class NniBmpPatchProperties { /// /// Keeps track of any properties unknown to the library. @@ -43,23 +43,23 @@ public partial class NetworkFabricErrorResult /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal NetworkFabricErrorResult() + /// Initializes a new instance of . + public NniBmpPatchProperties() { } - /// Initializes a new instance of . - /// The error object. + /// Initializes a new instance of . + /// (BGP Monitoring Protocol (BMP) configuration state. /// Keeps track of any properties unknown to the library. - internal NetworkFabricErrorResult(ResponseError error, IDictionary serializedAdditionalRawData) + internal NniBmpPatchProperties(BmpConfigurationState? configurationState, IDictionary serializedAdditionalRawData) { - Error = error; + ConfigurationState = configurationState; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The error object. - public ResponseError Error { get; } + /// (BGP Monitoring Protocol (BMP) configuration state. + public BmpConfigurationState? ConfigurationState { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBmpProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBmpProperties.Serialization.cs new file mode 100644 index 000000000000..5b06dbbb871d --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBmpProperties.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class NniBmpProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NniBmpProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("configurationState"u8); + writer.WriteStringValue(ConfigurationState.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NniBmpProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NniBmpProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNniBmpProperties(document.RootElement, options); + } + + internal static NniBmpProperties DeserializeNniBmpProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BmpConfigurationState configurationState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("configurationState"u8)) + { + configurationState = new BmpConfigurationState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NniBmpProperties(configurationState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NniBmpProperties)} does not support writing '{options.Format}' format."); + } + } + + NniBmpProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNniBmpProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NniBmpProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceSkusListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBmpProperties.cs similarity index 66% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceSkusListResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBmpProperties.cs index 569f1f44b4a8..7ebe19b1e293 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkDeviceSkusListResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniBmpProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of Network Device SKUs. - internal partial class NetworkDeviceSkusListResult + /// BGP Monitoring Protocol (BMP) properties. + internal partial class NniBmpProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,28 @@ internal partial class NetworkDeviceSkusListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal NetworkDeviceSkusListResult() + /// Initializes a new instance of . + /// BGP Monitoring Protocol (BMP) Configuration State. + public NniBmpProperties(BmpConfigurationState configurationState) { - Value = new ChangeTrackingList(); + ConfigurationState = configurationState; } - /// Initializes a new instance of . - /// List of Network Device SKU resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// BGP Monitoring Protocol (BMP) Configuration State. /// Keeps track of any properties unknown to the library. - internal NetworkDeviceSkusListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NniBmpProperties(BmpConfigurationState configurationState, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + ConfigurationState = configurationState; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of Network Device SKU resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// Initializes a new instance of for deserialization. + internal NniBmpProperties() + { + } + + /// BGP Monitoring Protocol (BMP) Configuration State. + public BmpConfigurationState ConfigurationState { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniStaticRouteConfiguration.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniStaticRouteConfiguration.Serialization.cs new file mode 100644 index 000000000000..faad64ed6cf1 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniStaticRouteConfiguration.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NniStaticRouteConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NniStaticRouteConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(BfdConfiguration)) + { + writer.WritePropertyName("bfdConfiguration"u8); + writer.WriteObjectValue(BfdConfiguration, options); + } + if (Optional.IsCollectionDefined(IPv4Routes)) + { + writer.WritePropertyName("ipv4Routes"u8); + writer.WriteStartArray(); + foreach (var item in IPv4Routes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(IPv6Routes)) + { + writer.WritePropertyName("ipv6Routes"u8); + writer.WriteStartArray(); + foreach (var item in IPv6Routes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NniStaticRouteConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NniStaticRouteConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNniStaticRouteConfiguration(document.RootElement, options); + } + + internal static NniStaticRouteConfiguration DeserializeNniStaticRouteConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BfdConfiguration bfdConfiguration = default; + IList ipv4Routes = default; + IList ipv6Routes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("bfdConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bfdConfiguration = BfdConfiguration.DeserializeBfdConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("ipv4Routes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StaticRouteProperties.DeserializeStaticRouteProperties(item, options)); + } + ipv4Routes = array; + continue; + } + if (property.NameEquals("ipv6Routes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StaticRouteProperties.DeserializeStaticRouteProperties(item, options)); + } + ipv6Routes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NniStaticRouteConfiguration(bfdConfiguration, ipv4Routes ?? new ChangeTrackingList(), ipv6Routes ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NniStaticRouteConfiguration)} does not support writing '{options.Format}' format."); + } + } + + NniStaticRouteConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNniStaticRouteConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NniStaticRouteConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniStaticRouteConfiguration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniStaticRouteConfiguration.cs new file mode 100644 index 000000000000..c8dedd98f70f --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniStaticRouteConfiguration.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Static Route Configuration properties for NNI. + public partial class NniStaticRouteConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NniStaticRouteConfiguration() + { + IPv4Routes = new ChangeTrackingList(); + IPv6Routes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// BFD configuration properties. + /// List of IPv4 Routes. + /// List of IPv6 Routes. + /// Keeps track of any properties unknown to the library. + internal NniStaticRouteConfiguration(BfdConfiguration bfdConfiguration, IList ipv4Routes, IList ipv6Routes, IDictionary serializedAdditionalRawData) + { + BfdConfiguration = bfdConfiguration; + IPv4Routes = ipv4Routes; + IPv6Routes = ipv6Routes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// BFD configuration properties. + public BfdConfiguration BfdConfiguration { get; set; } + /// List of IPv4 Routes. + public IList IPv4Routes { get; } + /// List of IPv6 Routes. + public IList IPv6Routes { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniStaticRoutePatchConfiguration.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniStaticRoutePatchConfiguration.Serialization.cs new file mode 100644 index 000000000000..275df71714e3 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniStaticRoutePatchConfiguration.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NniStaticRoutePatchConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NniStaticRoutePatchConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(BfdConfiguration)) + { + writer.WritePropertyName("bfdConfiguration"u8); + writer.WriteObjectValue(BfdConfiguration, options); + } + if (Optional.IsCollectionDefined(IPv4Routes)) + { + writer.WritePropertyName("ipv4Routes"u8); + writer.WriteStartArray(); + foreach (var item in IPv4Routes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(IPv6Routes)) + { + writer.WritePropertyName("ipv6Routes"u8); + writer.WriteStartArray(); + foreach (var item in IPv6Routes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NniStaticRoutePatchConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NniStaticRoutePatchConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNniStaticRoutePatchConfiguration(document.RootElement, options); + } + + internal static NniStaticRoutePatchConfiguration DeserializeNniStaticRoutePatchConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BfdPatchConfiguration bfdConfiguration = default; + IList ipv4Routes = default; + IList ipv6Routes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("bfdConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bfdConfiguration = BfdPatchConfiguration.DeserializeBfdPatchConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("ipv4Routes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StaticRoutePatchProperties.DeserializeStaticRoutePatchProperties(item, options)); + } + ipv4Routes = array; + continue; + } + if (property.NameEquals("ipv6Routes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StaticRoutePatchProperties.DeserializeStaticRoutePatchProperties(item, options)); + } + ipv6Routes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NniStaticRoutePatchConfiguration(bfdConfiguration, ipv4Routes ?? new ChangeTrackingList(), ipv6Routes ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NniStaticRoutePatchConfiguration)} does not support writing '{options.Format}' format."); + } + } + + NniStaticRoutePatchConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNniStaticRoutePatchConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NniStaticRoutePatchConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniStaticRoutePatchConfiguration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniStaticRoutePatchConfiguration.cs new file mode 100644 index 000000000000..c9aa20c22e7a --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniStaticRoutePatchConfiguration.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Static Route Configuration properties for NNI. + public partial class NniStaticRoutePatchConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NniStaticRoutePatchConfiguration() + { + IPv4Routes = new ChangeTrackingList(); + IPv6Routes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Bidirectional Forwarding Detection (BFD) configuration properties. + /// List of IPv4 Routes. + /// List of IPv6 Routes. + /// Keeps track of any properties unknown to the library. + internal NniStaticRoutePatchConfiguration(BfdPatchConfiguration bfdConfiguration, IList ipv4Routes, IList ipv6Routes, IDictionary serializedAdditionalRawData) + { + BfdConfiguration = bfdConfiguration; + IPv4Routes = ipv4Routes; + IPv6Routes = ipv6Routes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Bidirectional Forwarding Detection (BFD) configuration properties. + public BfdPatchConfiguration BfdConfiguration { get; set; } + /// List of IPv4 Routes. + public IList IPv4Routes { get; } + /// List of IPv6 Routes. + public IList IPv6Routes { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniType.cs index 9c568419aa61..d06f1deb5bd8 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NniType.cs @@ -25,9 +25,9 @@ public NniType(string value) private const string CEValue = "CE"; private const string NpbValue = "NPB"; - /// CE. + /// NniType-CE(Customer Edge). public static NniType CE { get; } = new NniType(CEValue); - /// NPB. + /// NniType-NPB(Network Packet Broker). public static NniType Npb { get; } = new NniType(NpbValue); /// Determines if two values are the same. public static bool operator ==(NniType left, NniType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NpbStaticRouteConfigurationPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NpbStaticRouteConfigurationPatch.Serialization.cs new file mode 100644 index 000000000000..b2016af66329 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NpbStaticRouteConfigurationPatch.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class NpbStaticRouteConfigurationPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NpbStaticRouteConfigurationPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(BfdConfiguration)) + { + writer.WritePropertyName("bfdConfiguration"u8); + writer.WriteObjectValue(BfdConfiguration, options); + } + if (Optional.IsCollectionDefined(IPv4Routes)) + { + writer.WritePropertyName("ipv4Routes"u8); + writer.WriteStartArray(); + foreach (var item in IPv4Routes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(IPv6Routes)) + { + writer.WritePropertyName("ipv6Routes"u8); + writer.WriteStartArray(); + foreach (var item in IPv6Routes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NpbStaticRouteConfigurationPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NpbStaticRouteConfigurationPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNpbStaticRouteConfigurationPatch(document.RootElement, options); + } + + internal static NpbStaticRouteConfigurationPatch DeserializeNpbStaticRouteConfigurationPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BfdPatchConfiguration bfdConfiguration = default; + IList ipv4Routes = default; + IList ipv6Routes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("bfdConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bfdConfiguration = BfdPatchConfiguration.DeserializeBfdPatchConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("ipv4Routes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StaticRoutePatchProperties.DeserializeStaticRoutePatchProperties(item, options)); + } + ipv4Routes = array; + continue; + } + if (property.NameEquals("ipv6Routes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StaticRoutePatchProperties.DeserializeStaticRoutePatchProperties(item, options)); + } + ipv6Routes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NpbStaticRouteConfigurationPatch(bfdConfiguration, ipv4Routes ?? new ChangeTrackingList(), ipv6Routes ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NpbStaticRouteConfigurationPatch)} does not support writing '{options.Format}' format."); + } + } + + NpbStaticRouteConfigurationPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNpbStaticRouteConfigurationPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NpbStaticRouteConfigurationPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NpbStaticRouteConfigurationPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NpbStaticRouteConfigurationPatch.cs new file mode 100644 index 000000000000..b9c0f416b9c6 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NpbStaticRouteConfigurationPatch.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// NPB Static Route Configuration properties. + public partial class NpbStaticRouteConfigurationPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NpbStaticRouteConfigurationPatch() + { + IPv4Routes = new ChangeTrackingList(); + IPv6Routes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// BFD Configuration properties. + /// List of IPv4 Routes. + /// List of IPv6 Routes. + /// Keeps track of any properties unknown to the library. + internal NpbStaticRouteConfigurationPatch(BfdPatchConfiguration bfdConfiguration, IList ipv4Routes, IList ipv6Routes, IDictionary serializedAdditionalRawData) + { + BfdConfiguration = bfdConfiguration; + IPv4Routes = ipv4Routes; + IPv6Routes = ipv6Routes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// BFD Configuration properties. + public BfdPatchConfiguration BfdConfiguration { get; set; } + /// List of IPv4 Routes. + public IList IPv4Routes { get; } + /// List of IPv6 Routes. + public IList IPv6Routes { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3Configuration.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3Configuration.Serialization.cs index 50f00f9496bf..dad83ac76684 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3Configuration.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3Configuration.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,7 +34,26 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(OptionBLayer3Configuration)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(PrimaryIPv4Prefix)) + { + writer.WritePropertyName("primaryIpv4Prefix"u8); + writer.WriteStringValue(PrimaryIPv4Prefix); + } + if (Optional.IsDefined(PrimaryIPv6Prefix)) + { + writer.WritePropertyName("primaryIpv6Prefix"u8); + writer.WriteStringValue(PrimaryIPv6Prefix); + } + if (Optional.IsDefined(SecondaryIPv4Prefix)) + { + writer.WritePropertyName("secondaryIpv4Prefix"u8); + writer.WriteStringValue(SecondaryIPv4Prefix); + } + if (Optional.IsDefined(SecondaryIPv6Prefix)) + { + writer.WritePropertyName("secondaryIpv6Prefix"u8); + writer.WriteStringValue(SecondaryIPv6Prefix); + } if (Optional.IsDefined(PeerAsn)) { writer.WritePropertyName("peerASN"u8); @@ -50,6 +69,46 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("fabricASN"u8); writer.WriteNumberValue(FabricAsn.Value); } + if (Optional.IsCollectionDefined(PeLoopbackIPAddress)) + { + writer.WritePropertyName("peLoopbackIpAddress"u8); + writer.WriteStartArray(); + foreach (var item in PeLoopbackIPAddress) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(BmpConfiguration)) + { + writer.WritePropertyName("bmpConfiguration"u8); + writer.WriteObjectValue(BmpConfiguration, options); + } + if (Optional.IsCollectionDefined(PrefixLimits)) + { + writer.WritePropertyName("prefixLimits"u8); + writer.WriteStartArray(); + foreach (var item in PrefixLimits) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } OptionBLayer3Configuration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -72,17 +131,40 @@ internal static OptionBLayer3Configuration DeserializeOptionBLayer3Configuration { return null; } - long? peerAsn = default; - int? vlanId = default; - long? fabricAsn = default; string primaryIPv4Prefix = default; string primaryIPv6Prefix = default; string secondaryIPv4Prefix = default; string secondaryIPv6Prefix = default; + long? peerAsn = default; + int? vlanId = default; + long? fabricAsn = default; + IList peLoopbackIPAddress = default; + NniBmpProperties bmpConfiguration = default; + IList prefixLimits = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("primaryIpv4Prefix"u8)) + { + primaryIPv4Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("primaryIpv6Prefix"u8)) + { + primaryIPv6Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("secondaryIpv4Prefix"u8)) + { + secondaryIPv4Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("secondaryIpv6Prefix"u8)) + { + secondaryIPv6Prefix = property.Value.GetString(); + continue; + } if (property.NameEquals("peerASN"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -110,24 +192,41 @@ internal static OptionBLayer3Configuration DeserializeOptionBLayer3Configuration fabricAsn = property.Value.GetInt64(); continue; } - if (property.NameEquals("primaryIpv4Prefix"u8)) + if (property.NameEquals("peLoopbackIpAddress"u8)) { - primaryIPv4Prefix = property.Value.GetString(); - continue; - } - if (property.NameEquals("primaryIpv6Prefix"u8)) - { - primaryIPv6Prefix = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + peLoopbackIPAddress = array; continue; } - if (property.NameEquals("secondaryIpv4Prefix"u8)) + if (property.NameEquals("bmpConfiguration"u8)) { - secondaryIPv4Prefix = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bmpConfiguration = NniBmpProperties.DeserializeNniBmpProperties(property.Value, options); continue; } - if (property.NameEquals("secondaryIpv6Prefix"u8)) + if (property.NameEquals("prefixLimits"u8)) { - secondaryIPv6Prefix = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OptionBLayer3PrefixLimitProperties.DeserializeOptionBLayer3PrefixLimitProperties(item, options)); + } + prefixLimits = array; continue; } if (options.Format != "W") @@ -141,10 +240,13 @@ internal static OptionBLayer3Configuration DeserializeOptionBLayer3Configuration primaryIPv6Prefix, secondaryIPv4Prefix, secondaryIPv6Prefix, - serializedAdditionalRawData, peerAsn, vlanId, - fabricAsn); + fabricAsn, + peLoopbackIPAddress ?? new ChangeTrackingList(), + bmpConfiguration, + prefixLimits ?? new ChangeTrackingList(), + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3Configuration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3Configuration.cs index 5a432ea7f09a..b65356f5676b 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3Configuration.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3Configuration.cs @@ -11,11 +11,45 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// OptionB Layer3 Configuration properties. - public partial class OptionBLayer3Configuration : Layer3IPPrefixProperties + public partial class OptionBLayer3Configuration { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public OptionBLayer3Configuration() { + PeLoopbackIPAddress = new ChangeTrackingList(); + PrefixLimits = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -23,22 +57,57 @@ public OptionBLayer3Configuration() /// IPv6 Address Prefix. /// Secondary IPv4 Address Prefix. /// Secondary IPv6 Address Prefix. - /// Keeps track of any properties unknown to the library. /// ASN of PE devices for CE/PE connectivity.Example : 28. /// VLAN for CE/PE Layer 3 connectivity.Example : 501. /// ASN of CE devices for CE/PE connectivity. - internal OptionBLayer3Configuration(string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix, IDictionary serializedAdditionalRawData, long? peerAsn, int? vlanId, long? fabricAsn) : base(primaryIPv4Prefix, primaryIPv6Prefix, secondaryIPv4Prefix, secondaryIPv6Prefix, serializedAdditionalRawData) + /// Provider Edge (PE) Loopback IP Address. + /// BGP Monitoring Protocol (BMP) Configuration. + /// OptionB Layer3 prefix limit configuration. + /// Keeps track of any properties unknown to the library. + internal OptionBLayer3Configuration(string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix, long? peerAsn, int? vlanId, long? fabricAsn, IList peLoopbackIPAddress, NniBmpProperties bmpConfiguration, IList prefixLimits, IDictionary serializedAdditionalRawData) { + PrimaryIPv4Prefix = primaryIPv4Prefix; + PrimaryIPv6Prefix = primaryIPv6Prefix; + SecondaryIPv4Prefix = secondaryIPv4Prefix; + SecondaryIPv6Prefix = secondaryIPv6Prefix; PeerAsn = peerAsn; VlanId = vlanId; FabricAsn = fabricAsn; + PeLoopbackIPAddress = peLoopbackIPAddress; + BmpConfiguration = bmpConfiguration; + PrefixLimits = prefixLimits; + _serializedAdditionalRawData = serializedAdditionalRawData; } + /// IPv4 Address Prefix. + public string PrimaryIPv4Prefix { get; set; } + /// IPv6 Address Prefix. + public string PrimaryIPv6Prefix { get; set; } + /// Secondary IPv4 Address Prefix. + public string SecondaryIPv4Prefix { get; set; } + /// Secondary IPv6 Address Prefix. + public string SecondaryIPv6Prefix { get; set; } /// ASN of PE devices for CE/PE connectivity.Example : 28. public long? PeerAsn { get; set; } /// VLAN for CE/PE Layer 3 connectivity.Example : 501. public int? VlanId { get; set; } /// ASN of CE devices for CE/PE connectivity. public long? FabricAsn { get; } + /// Provider Edge (PE) Loopback IP Address. + public IList PeLoopbackIPAddress { get; } + /// BGP Monitoring Protocol (BMP) Configuration. + internal NniBmpProperties BmpConfiguration { get; set; } + /// BGP Monitoring Protocol (BMP) Configuration State. + public BmpConfigurationState? BmpConfigurationState + { + get => BmpConfiguration is null ? default(BmpConfigurationState?) : BmpConfiguration.ConfigurationState; + set + { + BmpConfiguration = value.HasValue ? new NniBmpProperties(value.Value) : null; + } + } + + /// OptionB Layer3 prefix limit configuration. + public IList PrefixLimits { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3ConfigurationPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3ConfigurationPatchProperties.Serialization.cs new file mode 100644 index 000000000000..c6dbba70e33c --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3ConfigurationPatchProperties.Serialization.cs @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class OptionBLayer3ConfigurationPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OptionBLayer3ConfigurationPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(PrimaryIPv4Prefix)) + { + writer.WritePropertyName("primaryIpv4Prefix"u8); + writer.WriteStringValue(PrimaryIPv4Prefix); + } + if (Optional.IsDefined(PrimaryIPv6Prefix)) + { + writer.WritePropertyName("primaryIpv6Prefix"u8); + writer.WriteStringValue(PrimaryIPv6Prefix); + } + if (Optional.IsDefined(SecondaryIPv4Prefix)) + { + writer.WritePropertyName("secondaryIpv4Prefix"u8); + writer.WriteStringValue(SecondaryIPv4Prefix); + } + if (Optional.IsDefined(SecondaryIPv6Prefix)) + { + writer.WritePropertyName("secondaryIpv6Prefix"u8); + writer.WriteStringValue(SecondaryIPv6Prefix); + } + if (Optional.IsDefined(PeerAsn)) + { + writer.WritePropertyName("peerASN"u8); + writer.WriteNumberValue(PeerAsn.Value); + } + if (Optional.IsDefined(VlanId)) + { + writer.WritePropertyName("vlanId"u8); + writer.WriteNumberValue(VlanId.Value); + } + if (options.Format != "W" && Optional.IsDefined(FabricAsn)) + { + writer.WritePropertyName("fabricASN"u8); + writer.WriteNumberValue(FabricAsn.Value); + } + if (Optional.IsCollectionDefined(PeLoopbackIPAddress)) + { + writer.WritePropertyName("peLoopbackIpAddress"u8); + writer.WriteStartArray(); + foreach (var item in PeLoopbackIPAddress) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(BmpConfiguration)) + { + writer.WritePropertyName("bmpConfiguration"u8); + writer.WriteObjectValue(BmpConfiguration, options); + } + if (Optional.IsCollectionDefined(PrefixLimits)) + { + writer.WritePropertyName("prefixLimits"u8); + writer.WriteStartArray(); + foreach (var item in PrefixLimits) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OptionBLayer3ConfigurationPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OptionBLayer3ConfigurationPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOptionBLayer3ConfigurationPatchProperties(document.RootElement, options); + } + + internal static OptionBLayer3ConfigurationPatchProperties DeserializeOptionBLayer3ConfigurationPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string primaryIPv4Prefix = default; + string primaryIPv6Prefix = default; + string secondaryIPv4Prefix = default; + string secondaryIPv6Prefix = default; + long? peerAsn = default; + int? vlanId = default; + long? fabricAsn = default; + IList peLoopbackIPAddress = default; + NniBmpPatchProperties bmpConfiguration = default; + IList prefixLimits = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("primaryIpv4Prefix"u8)) + { + primaryIPv4Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("primaryIpv6Prefix"u8)) + { + primaryIPv6Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("secondaryIpv4Prefix"u8)) + { + secondaryIPv4Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("secondaryIpv6Prefix"u8)) + { + secondaryIPv6Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("peerASN"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peerAsn = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("vlanId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vlanId = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("fabricASN"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fabricAsn = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("peLoopbackIpAddress"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + peLoopbackIPAddress = array; + continue; + } + if (property.NameEquals("bmpConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bmpConfiguration = NniBmpPatchProperties.DeserializeNniBmpPatchProperties(property.Value, options); + continue; + } + if (property.NameEquals("prefixLimits"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OptionBLayer3PrefixLimitPatchProperties.DeserializeOptionBLayer3PrefixLimitPatchProperties(item, options)); + } + prefixLimits = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OptionBLayer3ConfigurationPatchProperties( + primaryIPv4Prefix, + primaryIPv6Prefix, + secondaryIPv4Prefix, + secondaryIPv6Prefix, + peerAsn, + vlanId, + fabricAsn, + peLoopbackIPAddress ?? new ChangeTrackingList(), + bmpConfiguration, + prefixLimits ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(OptionBLayer3ConfigurationPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + OptionBLayer3ConfigurationPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOptionBLayer3ConfigurationPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OptionBLayer3ConfigurationPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3ConfigurationPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3ConfigurationPatchProperties.cs new file mode 100644 index 000000000000..435d2489001b --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3ConfigurationPatchProperties.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Common properties for Layer3Configuration. + public partial class OptionBLayer3ConfigurationPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public OptionBLayer3ConfigurationPatchProperties() + { + PeLoopbackIPAddress = new ChangeTrackingList(); + PrefixLimits = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// IPv4 Address Prefix. + /// IPv6 Address Prefix. + /// Secondary IPv4 Address Prefix. + /// Secondary IPv6 Address Prefix. + /// ASN of PE devices for CE/PE connectivity.Example : 28. + /// VLAN for CE/PE Layer 3 connectivity.Example : 501. + /// ASN of CE devices for CE/PE connectivity. + /// Provider Edge (PE) Loopback IP Address. + /// BGP Monitoring Protocol (BMP) Configuration. + /// OptionB Layer3 prefix limit configuration. + /// Keeps track of any properties unknown to the library. + internal OptionBLayer3ConfigurationPatchProperties(string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix, long? peerAsn, int? vlanId, long? fabricAsn, IList peLoopbackIPAddress, NniBmpPatchProperties bmpConfiguration, IList prefixLimits, IDictionary serializedAdditionalRawData) + { + PrimaryIPv4Prefix = primaryIPv4Prefix; + PrimaryIPv6Prefix = primaryIPv6Prefix; + SecondaryIPv4Prefix = secondaryIPv4Prefix; + SecondaryIPv6Prefix = secondaryIPv6Prefix; + PeerAsn = peerAsn; + VlanId = vlanId; + FabricAsn = fabricAsn; + PeLoopbackIPAddress = peLoopbackIPAddress; + BmpConfiguration = bmpConfiguration; + PrefixLimits = prefixLimits; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// IPv4 Address Prefix. + public string PrimaryIPv4Prefix { get; set; } + /// IPv6 Address Prefix. + public string PrimaryIPv6Prefix { get; set; } + /// Secondary IPv4 Address Prefix. + public string SecondaryIPv4Prefix { get; set; } + /// Secondary IPv6 Address Prefix. + public string SecondaryIPv6Prefix { get; set; } + /// ASN of PE devices for CE/PE connectivity.Example : 28. + public long? PeerAsn { get; set; } + /// VLAN for CE/PE Layer 3 connectivity.Example : 501. + public int? VlanId { get; set; } + /// ASN of CE devices for CE/PE connectivity. + public long? FabricAsn { get; } + /// Provider Edge (PE) Loopback IP Address. + public IList PeLoopbackIPAddress { get; } + /// BGP Monitoring Protocol (BMP) Configuration. + internal NniBmpPatchProperties BmpConfiguration { get; set; } + /// (BGP Monitoring Protocol (BMP) configuration state. + public BmpConfigurationState? BmpConfigurationState + { + get => BmpConfiguration is null ? default : BmpConfiguration.ConfigurationState; + set + { + if (BmpConfiguration is null) + BmpConfiguration = new NniBmpPatchProperties(); + BmpConfiguration.ConfigurationState = value; + } + } + + /// OptionB Layer3 prefix limit configuration. + public IList PrefixLimits { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3PrefixLimitPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3PrefixLimitPatchProperties.Serialization.cs new file mode 100644 index 000000000000..966679338083 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3PrefixLimitPatchProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class OptionBLayer3PrefixLimitPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OptionBLayer3PrefixLimitPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MaximumRoutes)) + { + writer.WritePropertyName("maximumRoutes"u8); + writer.WriteNumberValue(MaximumRoutes.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OptionBLayer3PrefixLimitPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OptionBLayer3PrefixLimitPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOptionBLayer3PrefixLimitPatchProperties(document.RootElement, options); + } + + internal static OptionBLayer3PrefixLimitPatchProperties DeserializeOptionBLayer3PrefixLimitPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maximumRoutes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maximumRoutes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maximumRoutes = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OptionBLayer3PrefixLimitPatchProperties(maximumRoutes, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(OptionBLayer3PrefixLimitPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + OptionBLayer3PrefixLimitPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOptionBLayer3PrefixLimitPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OptionBLayer3PrefixLimitPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3PrefixLimitPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3PrefixLimitPatchProperties.cs new file mode 100644 index 000000000000..beabad83f0cd --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3PrefixLimitPatchProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// OptionB Layer3 prefix limit patch properties. + public partial class OptionBLayer3PrefixLimitPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public OptionBLayer3PrefixLimitPatchProperties() + { + } + + /// Initializes a new instance of . + /// Maximum number of routes allowed. + /// Keeps track of any properties unknown to the library. + internal OptionBLayer3PrefixLimitPatchProperties(int? maximumRoutes, IDictionary serializedAdditionalRawData) + { + MaximumRoutes = maximumRoutes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Maximum number of routes allowed. + public int? MaximumRoutes { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3PrefixLimitProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3PrefixLimitProperties.Serialization.cs new file mode 100644 index 000000000000..7c54b2cba265 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3PrefixLimitProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class OptionBLayer3PrefixLimitProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OptionBLayer3PrefixLimitProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MaximumRoutes)) + { + writer.WritePropertyName("maximumRoutes"u8); + writer.WriteNumberValue(MaximumRoutes.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OptionBLayer3PrefixLimitProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OptionBLayer3PrefixLimitProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOptionBLayer3PrefixLimitProperties(document.RootElement, options); + } + + internal static OptionBLayer3PrefixLimitProperties DeserializeOptionBLayer3PrefixLimitProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maximumRoutes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maximumRoutes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maximumRoutes = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OptionBLayer3PrefixLimitProperties(maximumRoutes, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(OptionBLayer3PrefixLimitProperties)} does not support writing '{options.Format}' format."); + } + } + + OptionBLayer3PrefixLimitProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOptionBLayer3PrefixLimitProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OptionBLayer3PrefixLimitProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3PrefixLimitProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3PrefixLimitProperties.cs new file mode 100644 index 000000000000..a86d65f1cc00 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBLayer3PrefixLimitProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// OptionB Layer3 prefix limit properties. + public partial class OptionBLayer3PrefixLimitProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public OptionBLayer3PrefixLimitProperties() + { + } + + /// Initializes a new instance of . + /// Maximum number of routes allowed. + /// Keeps track of any properties unknown to the library. + internal OptionBLayer3PrefixLimitProperties(int? maximumRoutes, IDictionary serializedAdditionalRawData) + { + MaximumRoutes = maximumRoutes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Maximum number of routes allowed. + public int? MaximumRoutes { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PeeringOption.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PeeringOption.cs index 54770bd1fbeb..a06e4f4d203c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PeeringOption.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PeeringOption.cs @@ -25,9 +25,9 @@ public PeeringOption(string value) private const string OptionAValue = "OptionA"; private const string OptionBValue = "OptionB"; - /// OptionA. + /// PeeringOption-OptionA. public static PeeringOption OptionA { get; } = new PeeringOption(OptionAValue); - /// OptionB. + /// PeeringOption-OptionB. public static PeeringOption OptionB { get; } = new PeeringOption(OptionBValue); /// Determines if two values are the same. public static bool operator ==(PeeringOption left, PeeringOption right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerPatchableProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PoliceRateConfigurationProperties.Serialization.cs similarity index 59% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerPatchableProperties.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PoliceRateConfigurationProperties.Serialization.cs index e905fbda60c0..177dccb44132 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerPatchableProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PoliceRateConfigurationProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - public partial class TerminalServerPatchableProperties : IUtf8JsonSerializable, IJsonModel + public partial class PoliceRateConfigurationProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TerminalServerPatchableProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(PoliceRateConfigurationProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Username)) + if (Optional.IsDefined(BitRate)) { - writer.WritePropertyName("username"u8); - writer.WriteStringValue(Username); + writer.WritePropertyName("bitRate"u8); + writer.WriteObjectValue(BitRate, options); } - if (Optional.IsDefined(Password)) + if (Optional.IsDefined(BurstSize)) { - writer.WritePropertyName("password"u8); - writer.WriteStringValue(Password); - } - if (Optional.IsDefined(SerialNumber)) - { - writer.WritePropertyName("serialNumber"u8); - writer.WriteStringValue(SerialNumber); + writer.WritePropertyName("burstSize"u8); + writer.WriteObjectValue(BurstSize, options); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - TerminalServerPatchableProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + PoliceRateConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TerminalServerPatchableProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(PoliceRateConfigurationProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTerminalServerPatchableProperties(document.RootElement, options); + return DeserializePoliceRateConfigurationProperties(document.RootElement, options); } - internal static TerminalServerPatchableProperties DeserializeTerminalServerPatchableProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static PoliceRateConfigurationProperties DeserializePoliceRateConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,26 +81,28 @@ internal static TerminalServerPatchableProperties DeserializeTerminalServerPatch { return null; } - string username = default; - string password = default; - string serialNumber = default; + BitRate bitRate = default; + BurstSize burstSize = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("username"u8)) - { - username = property.Value.GetString(); - continue; - } - if (property.NameEquals("password"u8)) + if (property.NameEquals("bitRate"u8)) { - password = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bitRate = BitRate.DeserializeBitRate(property.Value, options); continue; } - if (property.NameEquals("serialNumber"u8)) + if (property.NameEquals("burstSize"u8)) { - serialNumber = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + burstSize = BurstSize.DeserializeBurstSize(property.Value, options); continue; } if (options.Format != "W") @@ -114,38 +111,38 @@ internal static TerminalServerPatchableProperties DeserializeTerminalServerPatch } } serializedAdditionalRawData = rawDataDictionary; - return new TerminalServerPatchableProperties(username, password, serialNumber, serializedAdditionalRawData); + return new PoliceRateConfigurationProperties(bitRate, burstSize, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(TerminalServerPatchableProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(PoliceRateConfigurationProperties)} does not support writing '{options.Format}' format."); } } - TerminalServerPatchableProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + PoliceRateConfigurationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeTerminalServerPatchableProperties(document.RootElement, options); + return DeserializePoliceRateConfigurationProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(TerminalServerPatchableProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(PoliceRateConfigurationProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PoliceRateConfigurationProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PoliceRateConfigurationProperties.cs new file mode 100644 index 000000000000..451c9b6009c7 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PoliceRateConfigurationProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Police rate configuration properties. + public partial class PoliceRateConfigurationProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public PoliceRateConfigurationProperties() + { + } + + /// Initializes a new instance of . + /// Rate limit in bits per second. + /// Burst size in packets. + /// Keeps track of any properties unknown to the library. + internal PoliceRateConfigurationProperties(BitRate bitRate, BurstSize burstSize, IDictionary serializedAdditionalRawData) + { + BitRate = bitRate; + BurstSize = burstSize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Rate limit in bits per second. + public BitRate BitRate { get; set; } + /// Burst size in packets. + public BurstSize BurstSize { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PollingIntervalInSecond.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PollingIntervalInSecond.cs index f50ee22dca38..ae24275e239e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PollingIntervalInSecond.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PollingIntervalInSecond.cs @@ -14,36 +14,36 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models /// Polling interval in seconds. public readonly partial struct PollingIntervalInSecond : IEquatable { - private readonly int _value; + private readonly float _value; /// Initializes a new instance of . - public PollingIntervalInSecond(int value) + public PollingIntervalInSecond(float value) { _value = value; } - private const int ThirtyValue = 30; - private const int SixtyValue = 60; - private const int NinetyValue = 90; - private const int OneHundredTwentyValue = 120; + private const float ThirtyValue = 30F; + private const float SixtyValue = 60F; + private const float NinetyValue = 90F; + private const float OneTwentyValue = 120F; - /// 30. + /// 30 PollingIntervalInSeconds. public static PollingIntervalInSecond Thirty { get; } = new PollingIntervalInSecond(ThirtyValue); - /// 60. + /// 60 PollingIntervalInSeconds. public static PollingIntervalInSecond Sixty { get; } = new PollingIntervalInSecond(SixtyValue); - /// 90. + /// 90 PollingIntervalInSeconds. public static PollingIntervalInSecond Ninety { get; } = new PollingIntervalInSecond(NinetyValue); - /// 120. - public static PollingIntervalInSecond OneHundredTwenty { get; } = new PollingIntervalInSecond(OneHundredTwentyValue); + /// 120 PollingIntervalInSeconds. + public static PollingIntervalInSecond OneTwenty { get; } = new PollingIntervalInSecond(OneTwentyValue); - internal int ToSerialInt32() => _value; + internal float ToSerialSingle() => _value; /// Determines if two values are the same. public static bool operator ==(PollingIntervalInSecond left, PollingIntervalInSecond right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(PollingIntervalInSecond left, PollingIntervalInSecond right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator PollingIntervalInSecond(int value) => new PollingIntervalInSecond(value); + /// Converts a to a . + public static implicit operator PollingIntervalInSecond(float value) => new PollingIntervalInSecond(value); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PortConditionPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PortConditionPatch.Serialization.cs new file mode 100644 index 000000000000..a18520d0c269 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PortConditionPatch.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class PortConditionPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PortConditionPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(PortType)) + { + writer.WritePropertyName("portType"u8); + writer.WriteStringValue(PortType.Value.ToString()); + } + if (Optional.IsDefined(Layer4Protocol)) + { + writer.WritePropertyName("layer4Protocol"u8); + writer.WriteStringValue(Layer4Protocol.Value.ToString()); + } + if (Optional.IsCollectionDefined(Ports)) + { + writer.WritePropertyName("ports"u8); + writer.WriteStartArray(); + foreach (var item in Ports) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(PortGroupNames)) + { + writer.WritePropertyName("portGroupNames"u8); + writer.WriteStartArray(); + foreach (var item in PortGroupNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PortConditionPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PortConditionPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePortConditionPatch(document.RootElement, options); + } + + internal static PortConditionPatch DeserializePortConditionPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NetworkFabricPortType? portType = default; + Layer4Protocol? layer4Protocol = default; + IList ports = default; + IList portGroupNames = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("portType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + portType = new NetworkFabricPortType(property.Value.GetString()); + continue; + } + if (property.NameEquals("layer4Protocol"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + layer4Protocol = new Layer4Protocol(property.Value.GetString()); + continue; + } + if (property.NameEquals("ports"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ports = array; + continue; + } + if (property.NameEquals("portGroupNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + portGroupNames = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PortConditionPatch(portType, layer4Protocol, ports ?? new ChangeTrackingList(), portGroupNames ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(PortConditionPatch)} does not support writing '{options.Format}' format."); + } + } + + PortConditionPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePortConditionPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PortConditionPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PortConditionPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PortConditionPatch.cs new file mode 100644 index 000000000000..08791e1de511 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PortConditionPatch.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Port condition that needs to be matched. + public partial class PortConditionPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public PortConditionPatch() + { + Ports = new ChangeTrackingList(); + PortGroupNames = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Port type that needs to be matched. + /// Layer4 protocol type that needs to be matched. + /// List of the Ports that need to be matched. + /// List of the port Group Names that need to be matched. + /// Keeps track of any properties unknown to the library. + internal PortConditionPatch(NetworkFabricPortType? portType, Layer4Protocol? layer4Protocol, IList ports, IList portGroupNames, IDictionary serializedAdditionalRawData) + { + PortType = portType; + Layer4Protocol = layer4Protocol; + Ports = ports; + PortGroupNames = portGroupNames; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Port type that needs to be matched. + public NetworkFabricPortType? PortType { get; set; } + /// Layer4 protocol type that needs to be matched. + public Layer4Protocol? Layer4Protocol { get; set; } + /// List of the Ports that need to be matched. + public IList Ports { get; } + /// List of the port Group Names that need to be matched. + public IList PortGroupNames { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListsResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PortGroupPatchProperties.Serialization.cs similarity index 61% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListsResult.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PortGroupPatchProperties.Serialization.cs index b87d8d31f60c..1678212d4322 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/AccessControlListsResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PortGroupPatchProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - internal partial class AccessControlListsResult : IUtf8JsonSerializable, IJsonModel + public partial class PortGroupPatchProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,27 +28,27 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AccessControlListsResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(PortGroupPatchProperties)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + if (Optional.IsDefined(Name)) { - writer.WritePropertyName("value"u8); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsCollectionDefined(Ports)) + { + writer.WritePropertyName("ports"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (var item in Ports) { - writer.WriteObjectValue(item, options); + writer.WriteStringValue(item); } writer.WriteEndArray(); } - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -66,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AccessControlListsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + PortGroupPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AccessControlListsResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(PortGroupPatchProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAccessControlListsResult(document.RootElement, options); + return DeserializePortGroupPatchProperties(document.RootElement, options); } - internal static AccessControlListsResult DeserializeAccessControlListsResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static PortGroupPatchProperties DeserializePortGroupPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,29 +86,29 @@ internal static AccessControlListsResult DeserializeAccessControlListsResult(Jso { return null; } - IReadOnlyList value = default; - string nextLink = default; + string name = default; + IList ports = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("ports"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(NetworkFabricAccessControlListData.DeserializeNetworkFabricAccessControlListData(item, options)); + array.Add(item.GetString()); } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); + ports = array; continue; } if (options.Format != "W") @@ -117,38 +117,38 @@ internal static AccessControlListsResult DeserializeAccessControlListsResult(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new AccessControlListsResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new PortGroupPatchProperties(name, ports ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(AccessControlListsResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(PortGroupPatchProperties)} does not support writing '{options.Format}' format."); } } - AccessControlListsResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + PortGroupPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAccessControlListsResult(document.RootElement, options); + return DeserializePortGroupPatchProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AccessControlListsResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(PortGroupPatchProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PortGroupPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PortGroupPatchProperties.cs new file mode 100644 index 000000000000..0fdbd8d6f1be --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PortGroupPatchProperties.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Port Group Properties. + public partial class PortGroupPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public PortGroupPatchProperties() + { + Ports = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The name of the port group. + /// List of the ports that need to be matched. + /// Keeps track of any properties unknown to the library. + internal PortGroupPatchProperties(string name, IList ports, IDictionary serializedAdditionalRawData) + { + Name = name; + Ports = ports; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the port group. + public string Name { get; set; } + /// List of the ports that need to be matched. + public IList Ports { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PrefixLimitPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PrefixLimitPatchProperties.Serialization.cs new file mode 100644 index 000000000000..6188a4be4a8b --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PrefixLimitPatchProperties.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class PrefixLimitPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrefixLimitPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MaximumRoutes)) + { + writer.WritePropertyName("maximumRoutes"u8); + writer.WriteNumberValue(MaximumRoutes.Value); + } + if (Optional.IsDefined(Threshold)) + { + writer.WritePropertyName("threshold"u8); + writer.WriteNumberValue(Threshold.Value); + } + if (Optional.IsDefined(IdleTimeExpiry)) + { + writer.WritePropertyName("idleTimeExpiry"u8); + writer.WriteNumberValue(IdleTimeExpiry.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PrefixLimitPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrefixLimitPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrefixLimitPatchProperties(document.RootElement, options); + } + + internal static PrefixLimitPatchProperties DeserializePrefixLimitPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maximumRoutes = default; + int? threshold = default; + int? idleTimeExpiry = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maximumRoutes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maximumRoutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("threshold"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + threshold = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("idleTimeExpiry"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + idleTimeExpiry = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PrefixLimitPatchProperties(maximumRoutes, threshold, idleTimeExpiry, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(PrefixLimitPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + PrefixLimitPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePrefixLimitPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrefixLimitPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PrefixLimitPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PrefixLimitPatchProperties.cs new file mode 100644 index 000000000000..a8813081eb16 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PrefixLimitPatchProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Prefix Limit Patch properties. + public partial class PrefixLimitPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public PrefixLimitPatchProperties() + { + } + + /// Initializes a new instance of . + /// Maximum routes allowed. + /// Limit at which route prefixes a warning is generate. + /// Idle time expiry in seconds. + /// Keeps track of any properties unknown to the library. + internal PrefixLimitPatchProperties(int? maximumRoutes, int? threshold, int? idleTimeExpiry, IDictionary serializedAdditionalRawData) + { + MaximumRoutes = maximumRoutes; + Threshold = threshold; + IdleTimeExpiry = idleTimeExpiry; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Maximum routes allowed. + public int? MaximumRoutes { get; set; } + /// Limit at which route prefixes a warning is generate. + public int? Threshold { get; set; } + /// Idle time expiry in seconds. + public int? IdleTimeExpiry { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PrefixLimitProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PrefixLimitProperties.Serialization.cs new file mode 100644 index 000000000000..427d61e55b58 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PrefixLimitProperties.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class PrefixLimitProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrefixLimitProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MaximumRoutes)) + { + writer.WritePropertyName("maximumRoutes"u8); + writer.WriteNumberValue(MaximumRoutes.Value); + } + if (Optional.IsDefined(Threshold)) + { + writer.WritePropertyName("threshold"u8); + writer.WriteNumberValue(Threshold.Value); + } + if (Optional.IsDefined(IdleTimeExpiry)) + { + writer.WritePropertyName("idleTimeExpiry"u8); + writer.WriteNumberValue(IdleTimeExpiry.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PrefixLimitProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrefixLimitProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrefixLimitProperties(document.RootElement, options); + } + + internal static PrefixLimitProperties DeserializePrefixLimitProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maximumRoutes = default; + int? threshold = default; + int? idleTimeExpiry = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maximumRoutes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maximumRoutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("threshold"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + threshold = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("idleTimeExpiry"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + idleTimeExpiry = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PrefixLimitProperties(maximumRoutes, threshold, idleTimeExpiry, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(PrefixLimitProperties)} does not support writing '{options.Format}' format."); + } + } + + PrefixLimitProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePrefixLimitProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrefixLimitProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PrefixLimitProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PrefixLimitProperties.cs new file mode 100644 index 000000000000..089ad1e4b331 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/PrefixLimitProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Prefix Limit properties. + public partial class PrefixLimitProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public PrefixLimitProperties() + { + } + + /// Initializes a new instance of . + /// Maximum routes allowed. + /// Limit at which route prefixes a warning is generate. + /// Idle Time Expiry in seconds, default is 60. + /// Keeps track of any properties unknown to the library. + internal PrefixLimitProperties(int? maximumRoutes, int? threshold, int? idleTimeExpiry, IDictionary serializedAdditionalRawData) + { + MaximumRoutes = maximumRoutes; + Threshold = threshold; + IdleTimeExpiry = idleTimeExpiry; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Maximum routes allowed. + public int? MaximumRoutes { get; set; } + /// Limit at which route prefixes a warning is generate. + public int? Threshold { get; set; } + /// Idle Time Expiry in seconds, default is 60. + public int? IdleTimeExpiry { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RedistributeConnectedSubnet.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RedistributeConnectedSubnet.cs index 31f4c18ade21..1a9b18ebf974 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RedistributeConnectedSubnet.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RedistributeConnectedSubnet.cs @@ -25,9 +25,9 @@ public RedistributeConnectedSubnet(string value) private const string TrueValue = "True"; private const string FalseValue = "False"; - /// True. + /// RedistributeConnectedSubnets-True. public static RedistributeConnectedSubnet True { get; } = new RedistributeConnectedSubnet(TrueValue); - /// False. + /// RedistributeConnectedSubnets-False. public static RedistributeConnectedSubnet False { get; } = new RedistributeConnectedSubnet(FalseValue); /// Determines if two values are the same. public static bool operator ==(RedistributeConnectedSubnet left, RedistributeConnectedSubnet right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RedistributeStaticRoute.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RedistributeStaticRoute.cs index f5bc6a7ac495..5141a5ae7934 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RedistributeStaticRoute.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RedistributeStaticRoute.cs @@ -25,9 +25,9 @@ public RedistributeStaticRoute(string value) private const string TrueValue = "True"; private const string FalseValue = "False"; - /// True. + /// RedistributeStaticRoutes-True. public static RedistributeStaticRoute True { get; } = new RedistributeStaticRoute(TrueValue); - /// False. + /// RedistributeStaticRoutes-False. public static RedistributeStaticRoute False { get; } = new RedistributeStaticRoute(FalseValue); /// Determines if two values are the same. public static bool operator ==(RedistributeStaticRoute left, RedistributeStaticRoute right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyActionType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyActionType.cs index 1df650b6b919..a2f0328c7db2 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyActionType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyActionType.cs @@ -26,11 +26,11 @@ public RoutePolicyActionType(string value) private const string DenyValue = "Deny"; private const string ContinueValue = "Continue"; - /// Permit. + /// RoutePolicyActionType-Permit. public static RoutePolicyActionType Permit { get; } = new RoutePolicyActionType(PermitValue); - /// Deny. + /// RoutePolicyActionType-Deny. public static RoutePolicyActionType Deny { get; } = new RoutePolicyActionType(DenyValue); - /// Continue. + /// RoutePolicyActionType-Continue. public static RoutePolicyActionType Continue { get; } = new RoutePolicyActionType(ContinueValue); /// Determines if two values are the same. public static bool operator ==(RoutePolicyActionType left, RoutePolicyActionType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyConditionType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyConditionType.cs index f723e1ab2864..e99a9037b7b6 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyConditionType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyConditionType.cs @@ -25,9 +25,9 @@ public RoutePolicyConditionType(string value) private const string OrValue = "Or"; private const string AndValue = "And"; - /// Or. + /// RoutePolicyConditionType-Or. public static RoutePolicyConditionType Or { get; } = new RoutePolicyConditionType(OrValue); - /// And. + /// RoutePolicyConditionType-And. public static RoutePolicyConditionType And { get; } = new RoutePolicyConditionType(AndValue); /// Determines if two values are the same. public static bool operator ==(RoutePolicyConditionType left, RoutePolicyConditionType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyListResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyListResult.Serialization.cs new file mode 100644 index 000000000000..9a54e2bb8c52 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class RoutePolicyListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RoutePolicyListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RoutePolicyListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RoutePolicyListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRoutePolicyListResult(document.RootElement, options); + } + + internal static RoutePolicyListResult DeserializeRoutePolicyListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkFabricRoutePolicyData.DeserializeNetworkFabricRoutePolicyData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RoutePolicyListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(RoutePolicyListResult)} does not support writing '{options.Format}' format."); + } + } + + RoutePolicyListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRoutePolicyListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RoutePolicyListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyListResult.cs new file mode 100644 index 000000000000..630da3b5a729 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The response of a RoutePolicy list operation. + internal partial class RoutePolicyListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The RoutePolicy items on this page. + /// is null. + internal RoutePolicyListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The RoutePolicy items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal RoutePolicyListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RoutePolicyListResult() + { + } + + /// The RoutePolicy items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyPatchableProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyPatchableProperties.Serialization.cs new file mode 100644 index 000000000000..b66596c1926c --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyPatchableProperties.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class RoutePolicyPatchableProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RoutePolicyPatchableProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DefaultAction)) + { + writer.WritePropertyName("defaultAction"u8); + writer.WriteStringValue(DefaultAction.Value.ToString()); + } + if (Optional.IsCollectionDefined(Statements)) + { + writer.WritePropertyName("statements"u8); + writer.WriteStartArray(); + foreach (var item in Statements) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RoutePolicyPatchableProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RoutePolicyPatchableProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRoutePolicyPatchableProperties(document.RootElement, options); + } + + internal static RoutePolicyPatchableProperties DeserializeRoutePolicyPatchableProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CommunityActionType? defaultAction = default; + IList statements = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("defaultAction"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultAction = new CommunityActionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("statements"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RoutePolicyStatementPatchProperties.DeserializeRoutePolicyStatementPatchProperties(item, options)); + } + statements = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RoutePolicyPatchableProperties(defaultAction, statements ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(RoutePolicyPatchableProperties)} does not support writing '{options.Format}' format."); + } + } + + RoutePolicyPatchableProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRoutePolicyPatchableProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RoutePolicyPatchableProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyPatchableProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyPatchableProperties.cs new file mode 100644 index 000000000000..ed41939c4040 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyPatchableProperties.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Route Policy patchable properties. + public partial class RoutePolicyPatchableProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RoutePolicyPatchableProperties() + { + Statements = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + /// Route Policy statements. + /// Keeps track of any properties unknown to the library. + internal RoutePolicyPatchableProperties(CommunityActionType? defaultAction, IList statements, IDictionary serializedAdditionalRawData) + { + DefaultAction = defaultAction; + Statements = statements; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + public CommunityActionType? DefaultAction { get; set; } + /// Route Policy statements. + public IList Statements { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyProperties.Serialization.cs new file mode 100644 index 000000000000..5d33efd6e2eb --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyProperties.Serialization.cs @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class RoutePolicyProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RoutePolicyProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } + if (Optional.IsDefined(DefaultAction)) + { + writer.WritePropertyName("defaultAction"u8); + writer.WriteStringValue(DefaultAction.Value.ToString()); + } + writer.WritePropertyName("statements"u8); + writer.WriteStartArray(); + foreach (var item in Statements) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("networkFabricId"u8); + writer.WriteStringValue(NetworkFabricId); + if (Optional.IsDefined(AddressFamilyType)) + { + writer.WritePropertyName("addressFamilyType"u8); + writer.WriteStringValue(AddressFamilyType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } + if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) + { + writer.WritePropertyName("configurationState"u8); + writer.WriteStringValue(ConfigurationState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) + { + writer.WritePropertyName("administrativeState"u8); + writer.WriteStringValue(AdministrativeState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RoutePolicyProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RoutePolicyProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRoutePolicyProperties(document.RootElement, options); + } + + internal static RoutePolicyProperties DeserializeRoutePolicyProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string annotation = default; + CommunityActionType? defaultAction = default; + IList statements = default; + ResourceIdentifier networkFabricId = default; + AddressFamilyType? addressFamilyType = default; + LastOperationProperties lastOperation = default; + NetworkFabricConfigurationState? configurationState = default; + NetworkFabricProvisioningState? provisioningState = default; + NetworkFabricAdministrativeState? administrativeState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } + if (property.NameEquals("defaultAction"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultAction = new CommunityActionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("statements"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RoutePolicyStatementProperties.DeserializeRoutePolicyStatementProperties(item, options)); + } + statements = array; + continue; + } + if (property.NameEquals("networkFabricId"u8)) + { + networkFabricId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("addressFamilyType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + addressFamilyType = new AddressFamilyType(property.Value.GetString()); + continue; + } + if (property.NameEquals("lastOperation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property.Value, options); + continue; + } + if (property.NameEquals("configurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configurationState = new NetworkFabricConfigurationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NetworkFabricProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("administrativeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeState = new NetworkFabricAdministrativeState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RoutePolicyProperties( + annotation, + defaultAction, + statements, + networkFabricId, + addressFamilyType, + lastOperation, + configurationState, + provisioningState, + administrativeState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(RoutePolicyProperties)} does not support writing '{options.Format}' format."); + } + } + + RoutePolicyProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRoutePolicyProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RoutePolicyProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyProperties.cs new file mode 100644 index 000000000000..3225682c0760 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyProperties.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// RoutePolicyProperties defines the resource properties. + public partial class RoutePolicyProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Route Policy statements. + /// Arm Resource ID of Network Fabric. + /// or is null. + public RoutePolicyProperties(IEnumerable statements, ResourceIdentifier networkFabricId) + { + Argument.AssertNotNull(statements, nameof(statements)); + Argument.AssertNotNull(networkFabricId, nameof(networkFabricId)); + + Statements = statements.ToList(); + NetworkFabricId = networkFabricId; + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + /// Route Policy statements. + /// Arm Resource ID of Network Fabric. + /// AddressFamilyType. This parameter decides whether the given ipv4 or ipv6 route policy. + /// Details of the last operation performed on the resource. + /// Configuration state of the resource. + /// Provisioning state of the resource. + /// Administrative state of the resource. + /// Keeps track of any properties unknown to the library. + internal RoutePolicyProperties(string annotation, CommunityActionType? defaultAction, IList statements, ResourceIdentifier networkFabricId, AddressFamilyType? addressFamilyType, LastOperationProperties lastOperation, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + DefaultAction = defaultAction; + Statements = statements; + NetworkFabricId = networkFabricId; + AddressFamilyType = addressFamilyType; + LastOperation = lastOperation; + ConfigurationState = configurationState; + ProvisioningState = provisioningState; + AdministrativeState = administrativeState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RoutePolicyProperties() + { + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + public CommunityActionType? DefaultAction { get; set; } + /// Route Policy statements. + public IList Statements { get; } + /// Arm Resource ID of Network Fabric. + public ResourceIdentifier NetworkFabricId { get; set; } + /// AddressFamilyType. This parameter decides whether the given ipv4 or ipv6 route policy. + public AddressFamilyType? AddressFamilyType { get; set; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + + /// Configuration state of the resource. + public NetworkFabricConfigurationState? ConfigurationState { get; } + /// Provisioning state of the resource. + public NetworkFabricProvisioningState? ProvisioningState { get; } + /// Administrative state of the resource. + public NetworkFabricAdministrativeState? AdministrativeState { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/Layer3IPPrefixProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyStatementPatchProperties.Serialization.cs similarity index 50% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/Layer3IPPrefixProperties.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyStatementPatchProperties.Serialization.cs index b5e05b8e7b4c..4758e3cdf997 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/Layer3IPPrefixProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyStatementPatchProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - public partial class Layer3IPPrefixProperties : IUtf8JsonSerializable, IJsonModel + public partial class RoutePolicyStatementPatchProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,32 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(Layer3IPPrefixProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(RoutePolicyStatementPatchProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(PrimaryIPv4Prefix)) + if (Optional.IsDefined(Annotation)) { - writer.WritePropertyName("primaryIpv4Prefix"u8); - writer.WriteStringValue(PrimaryIPv4Prefix); - } - if (Optional.IsDefined(PrimaryIPv6Prefix)) - { - writer.WritePropertyName("primaryIpv6Prefix"u8); - writer.WriteStringValue(PrimaryIPv6Prefix); - } - if (Optional.IsDefined(SecondaryIPv4Prefix)) - { - writer.WritePropertyName("secondaryIpv4Prefix"u8); - writer.WriteStringValue(SecondaryIPv4Prefix); - } - if (Optional.IsDefined(SecondaryIPv6Prefix)) - { - writer.WritePropertyName("secondaryIpv6Prefix"u8); - writer.WriteStringValue(SecondaryIPv6Prefix); + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); } + writer.WritePropertyName("sequenceNumber"u8); + writer.WriteNumberValue(SequenceNumber); + writer.WritePropertyName("condition"u8); + writer.WriteObjectValue(Condition, options); + writer.WritePropertyName("action"u8); + writer.WriteObjectValue(Action, options); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -71,19 +62,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - Layer3IPPrefixProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RoutePolicyStatementPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(Layer3IPPrefixProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(RoutePolicyStatementPatchProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLayer3IPPrefixProperties(document.RootElement, options); + return DeserializeRoutePolicyStatementPatchProperties(document.RootElement, options); } - internal static Layer3IPPrefixProperties DeserializeLayer3IPPrefixProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static RoutePolicyStatementPatchProperties DeserializeRoutePolicyStatementPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -91,32 +82,32 @@ internal static Layer3IPPrefixProperties DeserializeLayer3IPPrefixProperties(Jso { return null; } - string primaryIPv4Prefix = default; - string primaryIPv6Prefix = default; - string secondaryIPv4Prefix = default; - string secondaryIPv6Prefix = default; + string annotation = default; + long sequenceNumber = default; + StatementConditionPatchProperties condition = default; + StatementActionPatchProperties action = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("primaryIpv4Prefix"u8)) + if (property.NameEquals("annotation"u8)) { - primaryIPv4Prefix = property.Value.GetString(); + annotation = property.Value.GetString(); continue; } - if (property.NameEquals("primaryIpv6Prefix"u8)) + if (property.NameEquals("sequenceNumber"u8)) { - primaryIPv6Prefix = property.Value.GetString(); + sequenceNumber = property.Value.GetInt64(); continue; } - if (property.NameEquals("secondaryIpv4Prefix"u8)) + if (property.NameEquals("condition"u8)) { - secondaryIPv4Prefix = property.Value.GetString(); + condition = StatementConditionPatchProperties.DeserializeStatementConditionPatchProperties(property.Value, options); continue; } - if (property.NameEquals("secondaryIpv6Prefix"u8)) + if (property.NameEquals("action"u8)) { - secondaryIPv6Prefix = property.Value.GetString(); + action = StatementActionPatchProperties.DeserializeStatementActionPatchProperties(property.Value, options); continue; } if (options.Format != "W") @@ -125,38 +116,38 @@ internal static Layer3IPPrefixProperties DeserializeLayer3IPPrefixProperties(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new Layer3IPPrefixProperties(primaryIPv4Prefix, primaryIPv6Prefix, secondaryIPv4Prefix, secondaryIPv6Prefix, serializedAdditionalRawData); + return new RoutePolicyStatementPatchProperties(annotation, sequenceNumber, condition, action, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(Layer3IPPrefixProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RoutePolicyStatementPatchProperties)} does not support writing '{options.Format}' format."); } } - Layer3IPPrefixProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RoutePolicyStatementPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeLayer3IPPrefixProperties(document.RootElement, options); + return DeserializeRoutePolicyStatementPatchProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(Layer3IPPrefixProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RoutePolicyStatementPatchProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyStatementPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyStatementPatchProperties.cs new file mode 100644 index 000000000000..636072b532bd --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyStatementPatchProperties.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Route Policy Statement properties. + public partial class RoutePolicyStatementPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Sequence to insert to/delete from existing route. + /// Route policy condition properties. + /// Route policy action properties. + /// or is null. + public RoutePolicyStatementPatchProperties(long sequenceNumber, StatementConditionPatchProperties condition, StatementActionPatchProperties action) + { + Argument.AssertNotNull(condition, nameof(condition)); + Argument.AssertNotNull(action, nameof(action)); + + SequenceNumber = sequenceNumber; + Condition = condition; + Action = action; + } + + /// Initializes a new instance of . + /// Switch configuration description. + /// Sequence to insert to/delete from existing route. + /// Route policy condition properties. + /// Route policy action properties. + /// Keeps track of any properties unknown to the library. + internal RoutePolicyStatementPatchProperties(string annotation, long sequenceNumber, StatementConditionPatchProperties condition, StatementActionPatchProperties action, IDictionary serializedAdditionalRawData) + { + Annotation = annotation; + SequenceNumber = sequenceNumber; + Condition = condition; + Action = action; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RoutePolicyStatementPatchProperties() + { + } + + /// Switch configuration description. + public string Annotation { get; set; } + /// Sequence to insert to/delete from existing route. + public long SequenceNumber { get; } + /// Route policy condition properties. + public StatementConditionPatchProperties Condition { get; } + /// Route policy action properties. + public StatementActionPatchProperties Action { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyStatementProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyStatementProperties.Serialization.cs index cf34f69a61de..e36462b4e91e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyStatementProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyStatementProperties.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,13 +34,32 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(RoutePolicyStatementProperties)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Annotation)) + { + writer.WritePropertyName("annotation"u8); + writer.WriteStringValue(Annotation); + } writer.WritePropertyName("sequenceNumber"u8); writer.WriteNumberValue(SequenceNumber); writer.WritePropertyName("condition"u8); writer.WriteObjectValue(Condition, options); writer.WritePropertyName("action"u8); writer.WriteObjectValue(Action, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } RoutePolicyStatementProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -63,14 +82,19 @@ internal static RoutePolicyStatementProperties DeserializeRoutePolicyStatementPr { return null; } + string annotation = default; long sequenceNumber = default; StatementConditionProperties condition = default; StatementActionProperties action = default; - string annotation = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("annotation"u8)) + { + annotation = property.Value.GetString(); + continue; + } if (property.NameEquals("sequenceNumber"u8)) { sequenceNumber = property.Value.GetInt64(); @@ -86,18 +110,13 @@ internal static RoutePolicyStatementProperties DeserializeRoutePolicyStatementPr action = StatementActionProperties.DeserializeStatementActionProperties(property.Value, options); continue; } - if (property.NameEquals("annotation"u8)) - { - annotation = property.Value.GetString(); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new RoutePolicyStatementProperties(annotation, serializedAdditionalRawData, sequenceNumber, condition, action); + return new RoutePolicyStatementProperties(annotation, sequenceNumber, condition, action, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyStatementProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyStatementProperties.cs index 2fd83d9d3069..f02f99a45140 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyStatementProperties.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePolicyStatementProperties.cs @@ -11,8 +11,40 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// Route Policy Statement properties. - public partial class RoutePolicyStatementProperties : AnnotationResourceProperties + public partial class RoutePolicyStatementProperties { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . /// Sequence to insert to/delete from existing route. /// Route policy condition properties. @@ -30,15 +62,17 @@ public RoutePolicyStatementProperties(long sequenceNumber, StatementConditionPro /// Initializes a new instance of . /// Switch configuration description. - /// Keeps track of any properties unknown to the library. /// Sequence to insert to/delete from existing route. /// Route policy condition properties. /// Route policy action properties. - internal RoutePolicyStatementProperties(string annotation, IDictionary serializedAdditionalRawData, long sequenceNumber, StatementConditionProperties condition, StatementActionProperties action) : base(annotation, serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal RoutePolicyStatementProperties(string annotation, long sequenceNumber, StatementConditionProperties condition, StatementActionProperties action, IDictionary serializedAdditionalRawData) { + Annotation = annotation; SequenceNumber = sequenceNumber; Condition = condition; Action = action; + _serializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. @@ -46,6 +80,8 @@ internal RoutePolicyStatementProperties() { } + /// Switch configuration description. + public string Annotation { get; set; } /// Sequence to insert to/delete from existing route. public long SequenceNumber { get; set; } /// Route policy condition properties. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePrefixLimitPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePrefixLimitPatchProperties.Serialization.cs new file mode 100644 index 000000000000..9c88f8d20e01 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePrefixLimitPatchProperties.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class RoutePrefixLimitPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RoutePrefixLimitPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(HardLimit)) + { + writer.WritePropertyName("hardLimit"u8); + writer.WriteNumberValue(HardLimit.Value); + } + if (Optional.IsDefined(Threshold)) + { + writer.WritePropertyName("threshold"u8); + writer.WriteNumberValue(Threshold.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RoutePrefixLimitPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RoutePrefixLimitPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRoutePrefixLimitPatchProperties(document.RootElement, options); + } + + internal static RoutePrefixLimitPatchProperties DeserializeRoutePrefixLimitPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? hardLimit = default; + int? threshold = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hardLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hardLimit = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("threshold"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + threshold = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RoutePrefixLimitPatchProperties(hardLimit, threshold, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(RoutePrefixLimitPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + RoutePrefixLimitPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRoutePrefixLimitPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RoutePrefixLimitPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePoliciesListResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePrefixLimitPatchProperties.cs similarity index 67% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePoliciesListResult.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePrefixLimitPatchProperties.cs index 3593bda06e96..43e1e7e5b7fd 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePoliciesListResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePrefixLimitPatchProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// List of RoutePolicies. - internal partial class RoutePoliciesListResult + /// VRP Limit patch configuration. + public partial class RoutePrefixLimitPatchProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,25 @@ internal partial class RoutePoliciesListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal RoutePoliciesListResult() + /// Initializes a new instance of . + public RoutePrefixLimitPatchProperties() { - Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of RoutePolicy resources. - /// Url to follow for getting next page of resources. + /// Initializes a new instance of . + /// Hard limit for the routes. + /// Threshold for the routes. /// Keeps track of any properties unknown to the library. - internal RoutePoliciesListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal RoutePrefixLimitPatchProperties(int? hardLimit, int? threshold, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + HardLimit = hardLimit; + Threshold = threshold; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of RoutePolicy resources. - public IReadOnlyList Value { get; } - /// Url to follow for getting next page of resources. - public string NextLink { get; } + /// Hard limit for the routes. + public int? HardLimit { get; set; } + /// Threshold for the routes. + public int? Threshold { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePrefixLimitProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePrefixLimitProperties.Serialization.cs new file mode 100644 index 000000000000..82a5342e82f6 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePrefixLimitProperties.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class RoutePrefixLimitProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RoutePrefixLimitProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(HardLimit)) + { + writer.WritePropertyName("hardLimit"u8); + writer.WriteNumberValue(HardLimit.Value); + } + if (Optional.IsDefined(Threshold)) + { + writer.WritePropertyName("threshold"u8); + writer.WriteNumberValue(Threshold.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RoutePrefixLimitProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RoutePrefixLimitProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRoutePrefixLimitProperties(document.RootElement, options); + } + + internal static RoutePrefixLimitProperties DeserializeRoutePrefixLimitProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? hardLimit = default; + int? threshold = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hardLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hardLimit = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("threshold"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + threshold = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RoutePrefixLimitProperties(hardLimit, threshold, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(RoutePrefixLimitProperties)} does not support writing '{options.Format}' format."); + } + } + + RoutePrefixLimitProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRoutePrefixLimitProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RoutePrefixLimitProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePrefixLimitProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePrefixLimitProperties.cs new file mode 100644 index 000000000000..a77851f9be7b --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RoutePrefixLimitProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Layer3 Route prefix limit configuration. + public partial class RoutePrefixLimitProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RoutePrefixLimitProperties() + { + } + + /// Initializes a new instance of . + /// Hard limit for the routes. + /// Threshold for the routes. + /// Keeps track of any properties unknown to the library. + internal RoutePrefixLimitProperties(int? hardLimit, int? threshold, IDictionary serializedAdditionalRawData) + { + HardLimit = hardLimit; + Threshold = threshold; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Hard limit for the routes. + public int? HardLimit { get; set; } + /// Threshold for the routes. + public int? Threshold { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RouteTargetPatchInformation.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RouteTargetPatchInformation.Serialization.cs new file mode 100644 index 000000000000..194d357cd1d0 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RouteTargetPatchInformation.Serialization.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class RouteTargetPatchInformation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RouteTargetPatchInformation)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(ImportIPv4RouteTargets)) + { + writer.WritePropertyName("importIpv4RouteTargets"u8); + writer.WriteStartArray(); + foreach (var item in ImportIPv4RouteTargets) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ImportIPv6RouteTargets)) + { + writer.WritePropertyName("importIpv6RouteTargets"u8); + writer.WriteStartArray(); + foreach (var item in ImportIPv6RouteTargets) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ExportIPv4RouteTargets)) + { + writer.WritePropertyName("exportIpv4RouteTargets"u8); + writer.WriteStartArray(); + foreach (var item in ExportIPv4RouteTargets) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ExportIPv6RouteTargets)) + { + writer.WritePropertyName("exportIpv6RouteTargets"u8); + writer.WriteStartArray(); + foreach (var item in ExportIPv6RouteTargets) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RouteTargetPatchInformation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RouteTargetPatchInformation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRouteTargetPatchInformation(document.RootElement, options); + } + + internal static RouteTargetPatchInformation DeserializeRouteTargetPatchInformation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList importIPv4RouteTargets = default; + IList importIPv6RouteTargets = default; + IList exportIPv4RouteTargets = default; + IList exportIPv6RouteTargets = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("importIpv4RouteTargets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + importIPv4RouteTargets = array; + continue; + } + if (property.NameEquals("importIpv6RouteTargets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + importIPv6RouteTargets = array; + continue; + } + if (property.NameEquals("exportIpv4RouteTargets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + exportIPv4RouteTargets = array; + continue; + } + if (property.NameEquals("exportIpv6RouteTargets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + exportIPv6RouteTargets = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RouteTargetPatchInformation(importIPv4RouteTargets ?? new ChangeTrackingList(), importIPv6RouteTargets ?? new ChangeTrackingList(), exportIPv4RouteTargets ?? new ChangeTrackingList(), exportIPv6RouteTargets ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(RouteTargetPatchInformation)} does not support writing '{options.Format}' format."); + } + } + + RouteTargetPatchInformation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRouteTargetPatchInformation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RouteTargetPatchInformation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RouteTargetPatchInformation.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RouteTargetPatchInformation.cs new file mode 100644 index 000000000000..535b542810b4 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RouteTargetPatchInformation.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Route Target Configuration. + public partial class RouteTargetPatchInformation + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RouteTargetPatchInformation() + { + ImportIPv4RouteTargets = new ChangeTrackingList(); + ImportIPv6RouteTargets = new ChangeTrackingList(); + ExportIPv4RouteTargets = new ChangeTrackingList(); + ExportIPv6RouteTargets = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Route Targets to be applied for incoming routes into CE. + /// Route Targets to be applied for incoming routes from CE. + /// Route Targets to be applied for outgoing routes into CE. + /// Route Targets to be applied for outgoing routes from CE. + /// Keeps track of any properties unknown to the library. + internal RouteTargetPatchInformation(IList importIPv4RouteTargets, IList importIPv6RouteTargets, IList exportIPv4RouteTargets, IList exportIPv6RouteTargets, IDictionary serializedAdditionalRawData) + { + ImportIPv4RouteTargets = importIPv4RouteTargets; + ImportIPv6RouteTargets = importIPv6RouteTargets; + ExportIPv4RouteTargets = exportIPv4RouteTargets; + ExportIPv6RouteTargets = exportIPv6RouteTargets; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Route Targets to be applied for incoming routes into CE. + public IList ImportIPv4RouteTargets { get; } + /// Route Targets to be applied for incoming routes from CE. + public IList ImportIPv6RouteTargets { get; } + /// Route Targets to be applied for outgoing routes into CE. + public IList ExportIPv4RouteTargets { get; } + /// Route Targets to be applied for outgoing routes from CE. + public IList ExportIPv6RouteTargets { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RouteType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RouteType.cs new file mode 100644 index 000000000000..4cbead57a41e --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RouteType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Route type to be used. + public readonly partial struct RouteType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RouteType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StaticValue = "Static"; + private const string OptionAValue = "OptionA"; + + /// RouteType-Static. + public static RouteType Static { get; } = new RouteType(StaticValue); + /// RouteType-OptionA. + public static RouteType OptionA { get; } = new RouteType(OptionAValue); + /// Determines if two values are the same. + public static bool operator ==(RouteType left, RouteType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RouteType left, RouteType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator RouteType(string value) => new RouteType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RouteType other && Equals(other); + /// + public bool Equals(RouteType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RuleCondition.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RuleCondition.cs new file mode 100644 index 000000000000..c1a0a9cadf3a --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/RuleCondition.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Specify Rule condition. + public readonly partial struct RuleCondition : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RuleCondition(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AndValue = "And"; + private const string OrValue = "Or"; + + /// And Rule-Condition. + public static RuleCondition And { get; } = new RuleCondition(AndValue); + /// Or Rule-Condition. + public static RuleCondition Or { get; } = new RuleCondition(OrValue); + /// Determines if two values are the same. + public static bool operator ==(RuleCondition left, RuleCondition right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RuleCondition left, RuleCondition right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator RuleCondition(string value) => new RuleCondition(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RuleCondition other && Equals(other); + /// + public bool Equals(RuleCondition other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/SourceDestinationType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/SourceDestinationType.cs index a08d1f118419..8c689aa64936 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/SourceDestinationType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/SourceDestinationType.cs @@ -24,11 +24,14 @@ public SourceDestinationType(string value) private const string SourceIPValue = "SourceIP"; private const string DestinationIPValue = "DestinationIP"; + private const string BidirectionalValue = "Bidirectional"; - /// SourceIP. + /// SourceDestinationType SourceIP. public static SourceDestinationType SourceIP { get; } = new SourceDestinationType(SourceIPValue); - /// DestinationIP. + /// SourceDestinationType DestinationIP. public static SourceDestinationType DestinationIP { get; } = new SourceDestinationType(DestinationIPValue); + /// SourceDestinationType Bidirectional. + public static SourceDestinationType Bidirectional { get; } = new SourceDestinationType(BidirectionalValue); /// Determines if two values are the same. public static bool operator ==(SourceDestinationType left, SourceDestinationType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StateUpdateCommonPostActionResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StateUpdateCommonPostActionResult.Serialization.cs index 6c9b4ae19260..b7677b3e42e1 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StateUpdateCommonPostActionResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StateUpdateCommonPostActionResult.Serialization.cs @@ -27,7 +27,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -35,12 +35,31 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(StateUpdateCommonPostActionResult)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + ((IJsonModel)Error).Write(writer, options); + } if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) { writer.WritePropertyName("configurationState"u8); writer.WriteStringValue(ConfigurationState.Value.ToString()); } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } StateUpdateCommonPostActionResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -63,28 +82,28 @@ internal static StateUpdateCommonPostActionResult DeserializeStateUpdateCommonPo { return null; } - NetworkFabricConfigurationState? configurationState = default; ResponseError error = default; + NetworkFabricConfigurationState? configurationState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("configurationState"u8)) + if (property.NameEquals("error"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - configurationState = new NetworkFabricConfigurationState(property.Value.GetString()); + error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerManagedNetworkFabricContext.Default); continue; } - if (property.NameEquals("error"u8)) + if (property.NameEquals("configurationState"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerManagedNetworkFabricContext.Default); + configurationState = new NetworkFabricConfigurationState(property.Value.GetString()); continue; } if (options.Format != "W") @@ -93,7 +112,7 @@ internal static StateUpdateCommonPostActionResult DeserializeStateUpdateCommonPo } } serializedAdditionalRawData = rawDataDictionary; - return new StateUpdateCommonPostActionResult(error, serializedAdditionalRawData, configurationState); + return new StateUpdateCommonPostActionResult(error, configurationState, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StateUpdateCommonPostActionResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StateUpdateCommonPostActionResult.cs index 3706c9ce4b94..7f85fd96560c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StateUpdateCommonPostActionResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StateUpdateCommonPostActionResult.cs @@ -11,8 +11,40 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// Common response for the state updates. - public partial class StateUpdateCommonPostActionResult : NetworkFabricErrorResult + public partial class StateUpdateCommonPostActionResult { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . internal StateUpdateCommonPostActionResult() { @@ -20,13 +52,17 @@ internal StateUpdateCommonPostActionResult() /// Initializes a new instance of . /// The error object. - /// Keeps track of any properties unknown to the library. /// Gets the configuration state. - internal StateUpdateCommonPostActionResult(ResponseError error, IDictionary serializedAdditionalRawData, NetworkFabricConfigurationState? configurationState) : base(error, serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StateUpdateCommonPostActionResult(ResponseError error, NetworkFabricConfigurationState? configurationState, IDictionary serializedAdditionalRawData) { + Error = error; ConfigurationState = configurationState; + _serializedAdditionalRawData = serializedAdditionalRawData; } + /// The error object. + public ResponseError Error { get; } /// Gets the configuration state. public NetworkFabricConfigurationState? ConfigurationState { get; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementActionPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementActionPatchProperties.Serialization.cs new file mode 100644 index 000000000000..6674630d280e --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementActionPatchProperties.Serialization.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class StatementActionPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StatementActionPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(LocalPreference)) + { + writer.WritePropertyName("localPreference"u8); + writer.WriteNumberValue(LocalPreference.Value); + } + writer.WritePropertyName("actionType"u8); + writer.WriteStringValue(ActionType.ToString()); + if (Optional.IsDefined(IPCommunityProperties)) + { + writer.WritePropertyName("ipCommunityProperties"u8); + writer.WriteObjectValue(IPCommunityProperties, options); + } + if (Optional.IsDefined(IPExtendedCommunityProperties)) + { + writer.WritePropertyName("ipExtendedCommunityProperties"u8); + writer.WriteObjectValue(IPExtendedCommunityProperties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StatementActionPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StatementActionPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStatementActionPatchProperties(document.RootElement, options); + } + + internal static StatementActionPatchProperties DeserializeStatementActionPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? localPreference = default; + RoutePolicyActionType actionType = default; + ActionIPCommunityPatchProperties ipCommunityProperties = default; + ActionIPExtendedCommunityPatchProperties ipExtendedCommunityProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("localPreference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localPreference = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("actionType"u8)) + { + actionType = new RoutePolicyActionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("ipCommunityProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ipCommunityProperties = ActionIPCommunityPatchProperties.DeserializeActionIPCommunityPatchProperties(property.Value, options); + continue; + } + if (property.NameEquals("ipExtendedCommunityProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ipExtendedCommunityProperties = ActionIPExtendedCommunityPatchProperties.DeserializeActionIPExtendedCommunityPatchProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StatementActionPatchProperties(localPreference, actionType, ipCommunityProperties, ipExtendedCommunityProperties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(StatementActionPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + StatementActionPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStatementActionPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StatementActionPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementActionPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementActionPatchProperties.cs new file mode 100644 index 000000000000..dc036def03c6 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementActionPatchProperties.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Route policy action properties. + public partial class StatementActionPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Action type. Example: Permit | Deny | Continue. + public StatementActionPatchProperties(RoutePolicyActionType actionType) + { + ActionType = actionType; + } + + /// Initializes a new instance of . + /// Local Preference of the route policy. + /// Action type. Example: Permit | Deny | Continue. + /// IP Community Properties. + /// IP Extended Community Properties. + /// Keeps track of any properties unknown to the library. + internal StatementActionPatchProperties(long? localPreference, RoutePolicyActionType actionType, ActionIPCommunityPatchProperties ipCommunityProperties, ActionIPExtendedCommunityPatchProperties ipExtendedCommunityProperties, IDictionary serializedAdditionalRawData) + { + LocalPreference = localPreference; + ActionType = actionType; + IPCommunityProperties = ipCommunityProperties; + IPExtendedCommunityProperties = ipExtendedCommunityProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal StatementActionPatchProperties() + { + } + + /// Local Preference of the route policy. + public long? LocalPreference { get; set; } + /// Action type. Example: Permit | Deny | Continue. + public RoutePolicyActionType ActionType { get; } + /// IP Community Properties. + public ActionIPCommunityPatchProperties IPCommunityProperties { get; set; } + /// IP Extended Community Properties. + public ActionIPExtendedCommunityPatchProperties IPExtendedCommunityProperties { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementConditionPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementConditionPatchProperties.Serialization.cs new file mode 100644 index 000000000000..65c0c1b3685a --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementConditionPatchProperties.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class StatementConditionPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StatementConditionPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(IPCommunityIds)) + { + writer.WritePropertyName("ipCommunityIds"u8); + writer.WriteStartArray(); + foreach (var item in IPCommunityIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(IPExtendedCommunityIds)) + { + writer.WritePropertyName("ipExtendedCommunityIds"u8); + writer.WriteStartArray(); + foreach (var item in IPExtendedCommunityIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(RoutePolicyConditionType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(RoutePolicyConditionType.Value.ToString()); + } + if (Optional.IsDefined(IPPrefixId)) + { + writer.WritePropertyName("ipPrefixId"u8); + writer.WriteStringValue(IPPrefixId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StatementConditionPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StatementConditionPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStatementConditionPatchProperties(document.RootElement, options); + } + + internal static StatementConditionPatchProperties DeserializeStatementConditionPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList ipCommunityIds = default; + IList ipExtendedCommunityIds = default; + RoutePolicyConditionType? type = default; + string ipPrefixId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipCommunityIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipCommunityIds = array; + continue; + } + if (property.NameEquals("ipExtendedCommunityIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipExtendedCommunityIds = array; + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new RoutePolicyConditionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("ipPrefixId"u8)) + { + ipPrefixId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StatementConditionPatchProperties(ipCommunityIds ?? new ChangeTrackingList(), ipExtendedCommunityIds ?? new ChangeTrackingList(), type, ipPrefixId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(StatementConditionPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + StatementConditionPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStatementConditionPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StatementConditionPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementConditionPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementConditionPatchProperties.cs new file mode 100644 index 000000000000..c93c217049c8 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementConditionPatchProperties.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Route policy statement condition properties. + public partial class StatementConditionPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public StatementConditionPatchProperties() + { + IPCommunityIds = new ChangeTrackingList(); + IPExtendedCommunityIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of IP Community resource IDs. + /// List of IP Extended Community resource IDs. + /// Type of the condition used. + /// Arm Resource Id of IpPrefix. + /// Keeps track of any properties unknown to the library. + internal StatementConditionPatchProperties(IList ipCommunityIds, IList ipExtendedCommunityIds, RoutePolicyConditionType? routePolicyConditionType, string ipPrefixId, IDictionary serializedAdditionalRawData) + { + IPCommunityIds = ipCommunityIds; + IPExtendedCommunityIds = ipExtendedCommunityIds; + RoutePolicyConditionType = routePolicyConditionType; + IPPrefixId = ipPrefixId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of IP Community resource IDs. + public IList IPCommunityIds { get; } + /// List of IP Extended Community resource IDs. + public IList IPExtendedCommunityIds { get; } + /// Type of the condition used. + public RoutePolicyConditionType? RoutePolicyConditionType { get; set; } + /// Arm Resource Id of IpPrefix. + public string IPPrefixId { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementConditionProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementConditionProperties.Serialization.cs index 9f53ab58b2e0..9ce240d651de 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementConditionProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementConditionProperties.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,7 +34,26 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(StatementConditionProperties)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(IPCommunityIds)) + { + writer.WritePropertyName("ipCommunityIds"u8); + writer.WriteStartArray(); + foreach (var item in IPCommunityIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(IPExtendedCommunityIds)) + { + writer.WritePropertyName("ipExtendedCommunityIds"u8); + writer.WriteStartArray(); + foreach (var item in IPExtendedCommunityIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(RoutePolicyConditionType)) { writer.WritePropertyName("type"u8); @@ -45,20 +64,20 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("ipPrefixId"u8); writer.WriteStringValue(IPPrefixId); } - if (Optional.IsCollectionDefined(IPExtendedCommunityIds)) + if (options.Format != "W" && _serializedAdditionalRawData != null) { - writer.WritePropertyName("ipExtendedCommunityIds"u8); - writer.WriteStartArray(); - foreach (var item in IPExtendedCommunityIds) + foreach (var item in _serializedAdditionalRawData) { - if (item == null) + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) { - writer.WriteNullValue(); - continue; + JsonSerializer.Serialize(writer, document.RootElement); } - writer.WriteStringValue(item); +#endif } - writer.WriteEndArray(); } } @@ -82,30 +101,26 @@ internal static StatementConditionProperties DeserializeStatementConditionProper { return null; } + IList ipCommunityIds = default; + IList ipExtendedCommunityIds = default; RoutePolicyConditionType? type = default; ResourceIdentifier ipPrefixId = default; - IList ipExtendedCommunityIds = default; - IList ipCommunityIds = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("type"u8)) + if (property.NameEquals("ipCommunityIds"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - type = new RoutePolicyConditionType(property.Value.GetString()); - continue; - } - if (property.NameEquals("ipPrefixId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) { - continue; + array.Add(item.GetString()); } - ipPrefixId = new ResourceIdentifier(property.Value.GetString()); + ipCommunityIds = array; continue; } if (property.NameEquals("ipExtendedCommunityIds"u8)) @@ -114,40 +129,30 @@ internal static StatementConditionProperties DeserializeStatementConditionProper { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } + array.Add(item.GetString()); } ipExtendedCommunityIds = array; continue; } - if (property.NameEquals("ipCommunityIds"u8)) + if (property.NameEquals("type"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + type = new RoutePolicyConditionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("ipPrefixId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } + continue; } - ipCommunityIds = array; + ipPrefixId = new ResourceIdentifier(property.Value.GetString()); continue; } if (options.Format != "W") @@ -156,7 +161,7 @@ internal static StatementConditionProperties DeserializeStatementConditionProper } } serializedAdditionalRawData = rawDataDictionary; - return new StatementConditionProperties(ipCommunityIds ?? new ChangeTrackingList(), serializedAdditionalRawData, type, ipPrefixId, ipExtendedCommunityIds ?? new ChangeTrackingList()); + return new StatementConditionProperties(ipCommunityIds ?? new ChangeTrackingList(), ipExtendedCommunityIds ?? new ChangeTrackingList(), type, ipPrefixId, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementConditionProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementConditionProperties.cs index 93d679f771f7..a13a97298b2d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementConditionProperties.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StatementConditionProperties.cs @@ -12,32 +12,69 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// Route policy statement condition properties. - public partial class StatementConditionProperties : IPCommunityIdList + public partial class StatementConditionProperties { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public StatementConditionProperties() { - IPExtendedCommunityIds = new ChangeTrackingList(); + IPCommunityIds = new ChangeTrackingList(); + IPExtendedCommunityIds = new ChangeTrackingList(); } /// Initializes a new instance of . /// List of IP Community resource IDs. - /// Keeps track of any properties unknown to the library. + /// List of IP Extended Community resource IDs. /// Type of the condition used. /// Arm Resource Id of IpPrefix. - /// List of IP Extended Community resource IDs. - internal StatementConditionProperties(IList ipCommunityIds, IDictionary serializedAdditionalRawData, RoutePolicyConditionType? routePolicyConditionType, ResourceIdentifier ipPrefixId, IList ipExtendedCommunityIds) : base(ipCommunityIds, serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StatementConditionProperties(IList ipCommunityIds, IList ipExtendedCommunityIds, RoutePolicyConditionType? routePolicyConditionType, ResourceIdentifier ipPrefixId, IDictionary serializedAdditionalRawData) { + IPCommunityIds = ipCommunityIds; + IPExtendedCommunityIds = ipExtendedCommunityIds; RoutePolicyConditionType = routePolicyConditionType; IPPrefixId = ipPrefixId; - IPExtendedCommunityIds = ipExtendedCommunityIds; + _serializedAdditionalRawData = serializedAdditionalRawData; } + /// List of IP Community resource IDs. + public IList IPCommunityIds { get; } + /// List of IP Extended Community resource IDs. + public IList IPExtendedCommunityIds { get; } /// Type of the condition used. public RoutePolicyConditionType? RoutePolicyConditionType { get; set; } /// Arm Resource Id of IpPrefix. public ResourceIdentifier IPPrefixId { get; set; } - /// List of IP Extended Community resource IDs. - public IList IPExtendedCommunityIds { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRouteConfiguration.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRouteConfiguration.Serialization.cs index c55ff3613f56..cbfd147e070a 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRouteConfiguration.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRouteConfiguration.Serialization.cs @@ -59,6 +59,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (Optional.IsDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStringValue(Extension.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -99,6 +104,7 @@ internal static StaticRouteConfiguration DeserializeStaticRouteConfiguration(Jso BfdConfiguration bfdConfiguration = default; IList ipv4Routes = default; IList ipv6Routes = default; + StaticRouteConfigurationExtension? extension = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -140,13 +146,22 @@ internal static StaticRouteConfiguration DeserializeStaticRouteConfiguration(Jso ipv6Routes = array; continue; } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + extension = new StaticRouteConfigurationExtension(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new StaticRouteConfiguration(bfdConfiguration, ipv4Routes ?? new ChangeTrackingList(), ipv6Routes ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new StaticRouteConfiguration(bfdConfiguration, ipv4Routes ?? new ChangeTrackingList(), ipv6Routes ?? new ChangeTrackingList(), extension, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRouteConfiguration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRouteConfiguration.cs index bdaddde0282a..a3db3e8e7df5 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRouteConfiguration.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRouteConfiguration.cs @@ -43,7 +43,7 @@ public partial class StaticRouteConfiguration /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . public StaticRouteConfiguration() @@ -56,12 +56,14 @@ public StaticRouteConfiguration() /// BFD configuration properties. /// List of IPv4 Routes. /// List of IPv6 Routes. + /// Extension. Example: NoExtension | NPB. /// Keeps track of any properties unknown to the library. - internal StaticRouteConfiguration(BfdConfiguration bfdConfiguration, IList ipv4Routes, IList ipv6Routes, IDictionary serializedAdditionalRawData) + internal StaticRouteConfiguration(BfdConfiguration bfdConfiguration, IList ipv4Routes, IList ipv6Routes, StaticRouteConfigurationExtension? extension, IDictionary serializedAdditionalRawData) { BfdConfiguration = bfdConfiguration; IPv4Routes = ipv4Routes; IPv6Routes = ipv6Routes; + Extension = extension; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -71,5 +73,7 @@ internal StaticRouteConfiguration(BfdConfiguration bfdConfiguration, IList IPv4Routes { get; } /// List of IPv6 Routes. public IList IPv6Routes { get; } + /// Extension. Example: NoExtension | NPB. + public StaticRouteConfigurationExtension? Extension { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRouteConfigurationExtension.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRouteConfigurationExtension.cs index 368cb2d89e51..48fff23ef3a7 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRouteConfigurationExtension.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRouteConfigurationExtension.cs @@ -25,9 +25,9 @@ public StaticRouteConfigurationExtension(string value) private const string NoExtensionValue = "NoExtension"; private const string NpbValue = "NPB"; - /// NoExtension. + /// Extension-NoExtension. public static StaticRouteConfigurationExtension NoExtension { get; } = new StaticRouteConfigurationExtension(NoExtensionValue); - /// NPB. + /// Extension-NPB. public static StaticRouteConfigurationExtension Npb { get; } = new StaticRouteConfigurationExtension(NpbValue); /// Determines if two values are the same. public static bool operator ==(StaticRouteConfigurationExtension left, StaticRouteConfigurationExtension right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePatchConfiguration.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePatchConfiguration.Serialization.cs new file mode 100644 index 000000000000..373a06958dd9 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePatchConfiguration.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class StaticRoutePatchConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StaticRoutePatchConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(BfdConfiguration)) + { + writer.WritePropertyName("bfdConfiguration"u8); + writer.WriteObjectValue(BfdConfiguration, options); + } + if (Optional.IsCollectionDefined(IPv4Routes)) + { + writer.WritePropertyName("ipv4Routes"u8); + writer.WriteStartArray(); + foreach (var item in IPv4Routes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(IPv6Routes)) + { + writer.WritePropertyName("ipv6Routes"u8); + writer.WriteStartArray(); + foreach (var item in IPv6Routes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StaticRoutePatchConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StaticRoutePatchConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStaticRoutePatchConfiguration(document.RootElement, options); + } + + internal static StaticRoutePatchConfiguration DeserializeStaticRoutePatchConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BfdPatchConfiguration bfdConfiguration = default; + IList ipv4Routes = default; + IList ipv6Routes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("bfdConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bfdConfiguration = BfdPatchConfiguration.DeserializeBfdPatchConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("ipv4Routes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StaticRoutePatchProperties.DeserializeStaticRoutePatchProperties(item, options)); + } + ipv4Routes = array; + continue; + } + if (property.NameEquals("ipv6Routes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StaticRoutePatchProperties.DeserializeStaticRoutePatchProperties(item, options)); + } + ipv6Routes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StaticRoutePatchConfiguration(bfdConfiguration, ipv4Routes ?? new ChangeTrackingList(), ipv6Routes ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(StaticRoutePatchConfiguration)} does not support writing '{options.Format}' format."); + } + } + + StaticRoutePatchConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStaticRoutePatchConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StaticRoutePatchConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePatchConfiguration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePatchConfiguration.cs new file mode 100644 index 000000000000..9f2510ce7e3c --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePatchConfiguration.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Static Route Configuration properties. + public partial class StaticRoutePatchConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public StaticRoutePatchConfiguration() + { + IPv4Routes = new ChangeTrackingList(); + IPv6Routes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// BFD configuration properties. + /// List of IPv4 Routes. + /// List of IPv6 Routes. + /// Keeps track of any properties unknown to the library. + internal StaticRoutePatchConfiguration(BfdPatchConfiguration bfdConfiguration, IList ipv4Routes, IList ipv6Routes, IDictionary serializedAdditionalRawData) + { + BfdConfiguration = bfdConfiguration; + IPv4Routes = ipv4Routes; + IPv6Routes = ipv6Routes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// BFD configuration properties. + public BfdPatchConfiguration BfdConfiguration { get; set; } + /// List of IPv4 Routes. + public IList IPv4Routes { get; } + /// List of IPv6 Routes. + public IList IPv6Routes { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePatchProperties.Serialization.cs new file mode 100644 index 000000000000..7c63b89b6c49 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePatchProperties.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class StaticRoutePatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StaticRoutePatchProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("prefix"u8); + writer.WriteStringValue(Prefix); + writer.WritePropertyName("nextHop"u8); + writer.WriteStartArray(); + foreach (var item in NextHop) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StaticRoutePatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StaticRoutePatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStaticRoutePatchProperties(document.RootElement, options); + } + + internal static StaticRoutePatchProperties DeserializeStaticRoutePatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string prefix = default; + IList nextHop = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("prefix"u8)) + { + prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("nextHop"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + nextHop = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StaticRoutePatchProperties(prefix, nextHop, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(StaticRoutePatchProperties)} does not support writing '{options.Format}' format."); + } + } + + StaticRoutePatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStaticRoutePatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StaticRoutePatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePatchProperties.cs new file mode 100644 index 000000000000..60fb778c59f3 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePatchProperties.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Route Properties. + public partial class StaticRoutePatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Prefix of the route. + /// List of next hop addresses. + /// or is null. + public StaticRoutePatchProperties(string prefix, IEnumerable nextHop) + { + Argument.AssertNotNull(prefix, nameof(prefix)); + Argument.AssertNotNull(nextHop, nameof(nextHop)); + + Prefix = prefix; + NextHop = nextHop.ToList(); + } + + /// Initializes a new instance of . + /// Prefix of the route. + /// List of next hop addresses. + /// Keeps track of any properties unknown to the library. + internal StaticRoutePatchProperties(string prefix, IList nextHop, IDictionary serializedAdditionalRawData) + { + Prefix = prefix; + NextHop = nextHop; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal StaticRoutePatchProperties() + { + } + + /// Prefix of the route. + public string Prefix { get; } + /// List of next hop addresses. + public IList NextHop { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePolicy.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePolicy.Serialization.cs new file mode 100644 index 000000000000..d114f0b0505d --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePolicy.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class StaticRoutePolicy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StaticRoutePolicy)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ExportRoutePolicy)) + { + writer.WritePropertyName("exportRoutePolicy"u8); + writer.WriteObjectValue(ExportRoutePolicy, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StaticRoutePolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StaticRoutePolicy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStaticRoutePolicy(document.RootElement, options); + } + + internal static StaticRoutePolicy DeserializeStaticRoutePolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + L3ExportRoutePolicy exportRoutePolicy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("exportRoutePolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exportRoutePolicy = L3ExportRoutePolicy.DeserializeL3ExportRoutePolicy(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StaticRoutePolicy(exportRoutePolicy, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(StaticRoutePolicy)} does not support writing '{options.Format}' format."); + } + } + + StaticRoutePolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStaticRoutePolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StaticRoutePolicy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePolicy.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePolicy.cs new file mode 100644 index 000000000000..dc0e36165ea1 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePolicy.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Static Route - route policy properties. + internal partial class StaticRoutePolicy + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public StaticRoutePolicy() + { + } + + /// Initializes a new instance of . + /// Array of ARM Resource ID of the RoutePolicies. + /// Keeps track of any properties unknown to the library. + internal StaticRoutePolicy(L3ExportRoutePolicy exportRoutePolicy, IDictionary serializedAdditionalRawData) + { + ExportRoutePolicy = exportRoutePolicy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Array of ARM Resource ID of the RoutePolicies. + public L3ExportRoutePolicy ExportRoutePolicy { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePolicyPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePolicyPatch.Serialization.cs new file mode 100644 index 000000000000..913220cca814 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePolicyPatch.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + internal partial class StaticRoutePolicyPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StaticRoutePolicyPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ExportRoutePolicy)) + { + writer.WritePropertyName("exportRoutePolicy"u8); + writer.WriteObjectValue(ExportRoutePolicy, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StaticRoutePolicyPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StaticRoutePolicyPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStaticRoutePolicyPatch(document.RootElement, options); + } + + internal static StaticRoutePolicyPatch DeserializeStaticRoutePolicyPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + L3ExportRoutePolicyPatch exportRoutePolicy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("exportRoutePolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exportRoutePolicy = L3ExportRoutePolicyPatch.DeserializeL3ExportRoutePolicyPatch(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StaticRoutePolicyPatch(exportRoutePolicy, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(StaticRoutePolicyPatch)} does not support writing '{options.Format}' format."); + } + } + + StaticRoutePolicyPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStaticRoutePolicyPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StaticRoutePolicyPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePolicyPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePolicyPatch.cs new file mode 100644 index 000000000000..ea6a76e3bc10 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StaticRoutePolicyPatch.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Static Route - route policy properties. + internal partial class StaticRoutePolicyPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public StaticRoutePolicyPatch() + { + } + + /// Initializes a new instance of . + /// Array of ARM Resource ID of the RoutePolicies. + /// Keeps track of any properties unknown to the library. + internal StaticRoutePolicyPatch(L3ExportRoutePolicyPatch exportRoutePolicy, IDictionary serializedAdditionalRawData) + { + ExportRoutePolicy = exportRoutePolicy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Array of ARM Resource ID of the RoutePolicies. + public L3ExportRoutePolicyPatch ExportRoutePolicy { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StationConfigurationState.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StationConfigurationState.cs new file mode 100644 index 000000000000..558a7ea322eb --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StationConfigurationState.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Station Configuration State. + public readonly partial struct StationConfigurationState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StationConfigurationState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// StationConfigurationState Enabled. + public static StationConfigurationState Enabled { get; } = new StationConfigurationState(EnabledValue); + /// StationConfigurationState Disabled. + public static StationConfigurationState Disabled { get; } = new StationConfigurationState(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(StationConfigurationState left, StationConfigurationState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StationConfigurationState left, StationConfigurationState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator StationConfigurationState(string value) => new StationConfigurationState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StationConfigurationState other && Equals(other); + /// + public bool Equals(StationConfigurationState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StationConnectionMode.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StationConnectionMode.cs new file mode 100644 index 000000000000..fe4c45acd231 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StationConnectionMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Station Connection Mode. + public readonly partial struct StationConnectionMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StationConnectionMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveValue = "Active"; + private const string PassiveValue = "Passive"; + + /// StationConnectionMode Active. + public static StationConnectionMode Active { get; } = new StationConnectionMode(ActiveValue); + /// StationConnectionMode Passive. + public static StationConnectionMode Passive { get; } = new StationConnectionMode(PassiveValue); + /// Determines if two values are the same. + public static bool operator ==(StationConnectionMode left, StationConnectionMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StationConnectionMode left, StationConnectionMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator StationConnectionMode(string value) => new StationConnectionMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StationConnectionMode other && Equals(other); + /// + public bool Equals(StationConnectionMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StationConnectionPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StationConnectionPatchProperties.Serialization.cs new file mode 100644 index 000000000000..66d7b4538e5c --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StationConnectionPatchProperties.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class StationConnectionPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StationConnectionPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(KeepaliveIdleTime)) + { + writer.WritePropertyName("keepaliveIdleTime"u8); + writer.WriteNumberValue(KeepaliveIdleTime.Value); + } + if (Optional.IsDefined(ProbeInterval)) + { + writer.WritePropertyName("probeInterval"u8); + writer.WriteNumberValue(ProbeInterval.Value); + } + if (Optional.IsDefined(ProbeCount)) + { + writer.WritePropertyName("probeCount"u8); + writer.WriteNumberValue(ProbeCount.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StationConnectionPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StationConnectionPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStationConnectionPatchProperties(document.RootElement, options); + } + + internal static StationConnectionPatchProperties DeserializeStationConnectionPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? keepaliveIdleTime = default; + int? probeInterval = default; + int? probeCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keepaliveIdleTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keepaliveIdleTime = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("probeInterval"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + probeInterval = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("probeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + probeCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StationConnectionPatchProperties(keepaliveIdleTime, probeInterval, probeCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(StationConnectionPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + StationConnectionPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStationConnectionPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StationConnectionPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StationConnectionPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StationConnectionPatchProperties.cs new file mode 100644 index 000000000000..4c170a88f704 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StationConnectionPatchProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Station Connection PATCH Properties. + public partial class StationConnectionPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public StationConnectionPatchProperties() + { + } + + /// Initializes a new instance of . + /// Connection keepalive idle time in seconds. + /// Probe interval in seconds, default value is 60. + /// Probe count, default value is 10. + /// Keeps track of any properties unknown to the library. + internal StationConnectionPatchProperties(int? keepaliveIdleTime, int? probeInterval, int? probeCount, IDictionary serializedAdditionalRawData) + { + KeepaliveIdleTime = keepaliveIdleTime; + ProbeInterval = probeInterval; + ProbeCount = probeCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Connection keepalive idle time in seconds. + public int? KeepaliveIdleTime { get; set; } + /// Probe interval in seconds, default value is 60. + public int? ProbeInterval { get; set; } + /// Probe count, default value is 10. + public int? ProbeCount { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StationConnectionProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StationConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..6b7da9ee6aa8 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StationConnectionProperties.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class StationConnectionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StationConnectionProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(KeepaliveIdleTime)) + { + writer.WritePropertyName("keepaliveIdleTime"u8); + writer.WriteNumberValue(KeepaliveIdleTime.Value); + } + if (Optional.IsDefined(ProbeInterval)) + { + writer.WritePropertyName("probeInterval"u8); + writer.WriteNumberValue(ProbeInterval.Value); + } + if (Optional.IsDefined(ProbeCount)) + { + writer.WritePropertyName("probeCount"u8); + writer.WriteNumberValue(ProbeCount.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StationConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StationConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStationConnectionProperties(document.RootElement, options); + } + + internal static StationConnectionProperties DeserializeStationConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? keepaliveIdleTime = default; + int? probeInterval = default; + int? probeCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keepaliveIdleTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keepaliveIdleTime = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("probeInterval"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + probeInterval = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("probeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + probeCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StationConnectionProperties(keepaliveIdleTime, probeInterval, probeCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(StationConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + StationConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStationConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StationConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StationConnectionProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StationConnectionProperties.cs new file mode 100644 index 000000000000..00eb77921d65 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StationConnectionProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Station Connection Properties. + public partial class StationConnectionProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public StationConnectionProperties() + { + } + + /// Initializes a new instance of . + /// Connection keepalive idle time in seconds. + /// Probe interval in seconds, default value is 60. + /// Probe count, default value is 10. + /// Keeps track of any properties unknown to the library. + internal StationConnectionProperties(int? keepaliveIdleTime, int? probeInterval, int? probeCount, IDictionary serializedAdditionalRawData) + { + KeepaliveIdleTime = keepaliveIdleTime; + ProbeInterval = probeInterval; + ProbeCount = probeCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Connection keepalive idle time in seconds. + public int? KeepaliveIdleTime { get; set; } + /// Probe interval in seconds, default value is 60. + public int? ProbeInterval { get; set; } + /// Probe count, default value is 10. + public int? ProbeCount { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StorageAccountConfiguration.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StorageAccountConfiguration.Serialization.cs new file mode 100644 index 000000000000..3158706c1547 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StorageAccountConfiguration.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class StorageAccountConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StorageAccountConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(StorageAccountId)) + { + writer.WritePropertyName("storageAccountId"u8); + writer.WriteStringValue(StorageAccountId); + } + if (Optional.IsDefined(StorageAccountIdentity)) + { + writer.WritePropertyName("storageAccountIdentity"u8); + writer.WriteObjectValue(StorageAccountIdentity, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StorageAccountConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StorageAccountConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageAccountConfiguration(document.RootElement, options); + } + + internal static StorageAccountConfiguration DeserializeStorageAccountConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier storageAccountId = default; + IdentitySelector storageAccountIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageAccountId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageAccountId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageAccountIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageAccountIdentity = IdentitySelector.DeserializeIdentitySelector(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StorageAccountConfiguration(storageAccountId, storageAccountIdentity, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(StorageAccountConfiguration)} does not support writing '{options.Format}' format."); + } + } + + StorageAccountConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStorageAccountConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StorageAccountConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StorageAccountConfiguration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StorageAccountConfiguration.cs new file mode 100644 index 000000000000..9c82c2c88111 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StorageAccountConfiguration.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Storage account configuration. + public partial class StorageAccountConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public StorageAccountConfiguration() + { + } + + /// Initializes a new instance of . + /// Network Fabric storage account resource identifier. + /// The selection of the managed identity to use with this storage account. The identity type must be either system assigned or user assigned. + /// Keeps track of any properties unknown to the library. + internal StorageAccountConfiguration(ResourceIdentifier storageAccountId, IdentitySelector storageAccountIdentity, IDictionary serializedAdditionalRawData) + { + StorageAccountId = storageAccountId; + StorageAccountIdentity = storageAccountIdentity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Network Fabric storage account resource identifier. + public ResourceIdentifier StorageAccountId { get; set; } + /// The selection of the managed identity to use with this storage account. The identity type must be either system assigned or user assigned. + public IdentitySelector StorageAccountIdentity { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StorageAccountPatchConfiguration.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StorageAccountPatchConfiguration.Serialization.cs new file mode 100644 index 000000000000..db1b29e739a5 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StorageAccountPatchConfiguration.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class StorageAccountPatchConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StorageAccountPatchConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(StorageAccountId)) + { + writer.WritePropertyName("storageAccountId"u8); + writer.WriteStringValue(StorageAccountId); + } + if (Optional.IsDefined(StorageAccountIdentity)) + { + writer.WritePropertyName("storageAccountIdentity"u8); + writer.WriteObjectValue(StorageAccountIdentity, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StorageAccountPatchConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StorageAccountPatchConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageAccountPatchConfiguration(document.RootElement, options); + } + + internal static StorageAccountPatchConfiguration DeserializeStorageAccountPatchConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier storageAccountId = default; + IdentitySelectorPatch storageAccountIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageAccountId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageAccountId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageAccountIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageAccountIdentity = IdentitySelectorPatch.DeserializeIdentitySelectorPatch(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StorageAccountPatchConfiguration(storageAccountId, storageAccountIdentity, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(StorageAccountPatchConfiguration)} does not support writing '{options.Format}' format."); + } + } + + StorageAccountPatchConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStorageAccountPatchConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StorageAccountPatchConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StorageAccountPatchConfiguration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StorageAccountPatchConfiguration.cs new file mode 100644 index 000000000000..d3f2a09aabd5 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/StorageAccountPatchConfiguration.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Storage account configuration. + public partial class StorageAccountPatchConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public StorageAccountPatchConfiguration() + { + } + + /// Initializes a new instance of . + /// Network Fabric storage account resource identifier. + /// The selection of the managed identity to use with this storage account. The identity type must be either system assigned or user assigned. + /// Keeps track of any properties unknown to the library. + internal StorageAccountPatchConfiguration(ResourceIdentifier storageAccountId, IdentitySelectorPatch storageAccountIdentity, IDictionary serializedAdditionalRawData) + { + StorageAccountId = storageAccountId; + StorageAccountIdentity = storageAccountIdentity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Network Fabric storage account resource identifier. + public ResourceIdentifier StorageAccountId { get; set; } + /// The selection of the managed identity to use with this storage account. The identity type must be either system assigned or user assigned. + public IdentitySelectorPatch StorageAccountIdentity { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TapRuleActionType.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TapRuleActionType.cs index c33b2b754282..f4b587f09f21 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TapRuleActionType.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TapRuleActionType.cs @@ -30,19 +30,19 @@ public TapRuleActionType(string value) private const string RedirectValue = "Redirect"; private const string MirrorValue = "Mirror"; - /// Drop. + /// TapRuleActionType-Drop. public static TapRuleActionType Drop { get; } = new TapRuleActionType(DropValue); - /// Count. + /// TapRuleActionType-Count. public static TapRuleActionType Count { get; } = new TapRuleActionType(CountValue); - /// Log. + /// TapRuleActionType-Log. public static TapRuleActionType Log { get; } = new TapRuleActionType(LogValue); - /// Replicate. + /// TapRuleActionType-Replicate. public static TapRuleActionType Replicate { get; } = new TapRuleActionType(ReplicateValue); - /// Goto. + /// TapRuleActionType-Goto. public static TapRuleActionType Goto { get; } = new TapRuleActionType(GotoValue); - /// Redirect. + /// TapRuleActionType-Redirect. public static TapRuleActionType Redirect { get; } = new TapRuleActionType(RedirectValue); - /// Mirror. + /// TapRuleActionType-Mirror. public static TapRuleActionType Mirror { get; } = new TapRuleActionType(MirrorValue); /// Determines if two values are the same. public static bool operator ==(TapRuleActionType left, TapRuleActionType right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerConfiguration.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerConfiguration.Serialization.cs index aa4f0651e582..d88bd211c193 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerConfiguration.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerConfiguration.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,32 +34,49 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(TerminalServerConfiguration)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (options.Format != "W" && Optional.IsDefined(NetworkDeviceId)) - { - writer.WritePropertyName("networkDeviceId"u8); - writer.WriteStringValue(NetworkDeviceId); - } - if (Optional.IsDefined(PrimaryIPv4Prefix)) + writer.WritePropertyName("username"u8); + writer.WriteStringValue(Username); + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + if (Optional.IsDefined(SerialNumber)) { - writer.WritePropertyName("primaryIpv4Prefix"u8); - writer.WriteStringValue(PrimaryIPv4Prefix); + writer.WritePropertyName("serialNumber"u8); + writer.WriteStringValue(SerialNumber); } + writer.WritePropertyName("primaryIpv4Prefix"u8); + writer.WriteStringValue(PrimaryIPv4Prefix); if (Optional.IsDefined(PrimaryIPv6Prefix)) { writer.WritePropertyName("primaryIpv6Prefix"u8); writer.WriteStringValue(PrimaryIPv6Prefix); } - if (Optional.IsDefined(SecondaryIPv4Prefix)) - { - writer.WritePropertyName("secondaryIpv4Prefix"u8); - writer.WriteStringValue(SecondaryIPv4Prefix); - } + writer.WritePropertyName("secondaryIpv4Prefix"u8); + writer.WriteStringValue(SecondaryIPv4Prefix); if (Optional.IsDefined(SecondaryIPv6Prefix)) { writer.WritePropertyName("secondaryIpv6Prefix"u8); writer.WriteStringValue(SecondaryIPv6Prefix); } + if (options.Format != "W" && Optional.IsDefined(NetworkDeviceId)) + { + writer.WritePropertyName("networkDeviceId"u8); + writer.WriteStringValue(NetworkDeviceId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } TerminalServerConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -82,25 +99,31 @@ internal static TerminalServerConfiguration DeserializeTerminalServerConfigurati { return null; } - ResourceIdentifier networkDeviceId = default; + string username = default; + string password = default; + string serialNumber = default; string primaryIPv4Prefix = default; string primaryIPv6Prefix = default; string secondaryIPv4Prefix = default; string secondaryIPv6Prefix = default; - string username = default; - string password = default; - string serialNumber = default; + ResourceIdentifier networkDeviceId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("networkDeviceId"u8)) + if (property.NameEquals("username"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkDeviceId = new ResourceIdentifier(property.Value.GetString()); + username = property.Value.GetString(); + continue; + } + if (property.NameEquals("password"u8)) + { + password = property.Value.GetString(); + continue; + } + if (property.NameEquals("serialNumber"u8)) + { + serialNumber = property.Value.GetString(); continue; } if (property.NameEquals("primaryIpv4Prefix"u8)) @@ -123,19 +146,13 @@ internal static TerminalServerConfiguration DeserializeTerminalServerConfigurati secondaryIPv6Prefix = property.Value.GetString(); continue; } - if (property.NameEquals("username"u8)) - { - username = property.Value.GetString(); - continue; - } - if (property.NameEquals("password"u8)) - { - password = property.Value.GetString(); - continue; - } - if (property.NameEquals("serialNumber"u8)) + if (property.NameEquals("networkDeviceId"u8)) { - serialNumber = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkDeviceId = new ResourceIdentifier(property.Value.GetString()); continue; } if (options.Format != "W") @@ -148,12 +165,12 @@ internal static TerminalServerConfiguration DeserializeTerminalServerConfigurati username, password, serialNumber, - serializedAdditionalRawData, - networkDeviceId, primaryIPv4Prefix, primaryIPv6Prefix, secondaryIPv4Prefix, - secondaryIPv6Prefix); + secondaryIPv6Prefix, + networkDeviceId, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerConfiguration.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerConfiguration.cs index 08106d7914a8..cec91e87754e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerConfiguration.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerConfiguration.cs @@ -12,34 +12,93 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// Network and credentials configuration currently applied to terminal server. - public partial class TerminalServerConfiguration : TerminalServerPatchableProperties + public partial class TerminalServerConfiguration { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . - public TerminalServerConfiguration() + /// Username for the terminal server connection. + /// Password for the terminal server connection. + /// IPv4 Address Prefix. + /// Secondary IPv4 Address Prefix. + /// , , or is null. + public TerminalServerConfiguration(string username, string password, string primaryIPv4Prefix, string secondaryIPv4Prefix) { + Argument.AssertNotNull(username, nameof(username)); + Argument.AssertNotNull(password, nameof(password)); + Argument.AssertNotNull(primaryIPv4Prefix, nameof(primaryIPv4Prefix)); + Argument.AssertNotNull(secondaryIPv4Prefix, nameof(secondaryIPv4Prefix)); + + Username = username; + Password = password; + PrimaryIPv4Prefix = primaryIPv4Prefix; + SecondaryIPv4Prefix = secondaryIPv4Prefix; } /// Initializes a new instance of . /// Username for the terminal server connection. /// Password for the terminal server connection. /// Serial Number of Terminal server. - /// Keeps track of any properties unknown to the library. - /// ARM Resource ID used for the NetworkDevice. /// IPv4 Address Prefix. /// IPv6 Address Prefix. /// Secondary IPv4 Address Prefix. /// Secondary IPv6 Address Prefix. - internal TerminalServerConfiguration(string username, string password, string serialNumber, IDictionary serializedAdditionalRawData, ResourceIdentifier networkDeviceId, string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix) : base(username, password, serialNumber, serializedAdditionalRawData) + /// ARM Resource ID used for the NetworkDevice. + /// Keeps track of any properties unknown to the library. + internal TerminalServerConfiguration(string username, string password, string serialNumber, string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix, ResourceIdentifier networkDeviceId, IDictionary serializedAdditionalRawData) { - NetworkDeviceId = networkDeviceId; + Username = username; + Password = password; + SerialNumber = serialNumber; PrimaryIPv4Prefix = primaryIPv4Prefix; PrimaryIPv6Prefix = primaryIPv6Prefix; SecondaryIPv4Prefix = secondaryIPv4Prefix; SecondaryIPv6Prefix = secondaryIPv6Prefix; + NetworkDeviceId = networkDeviceId; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// ARM Resource ID used for the NetworkDevice. - public ResourceIdentifier NetworkDeviceId { get; } + /// Initializes a new instance of for deserialization. + internal TerminalServerConfiguration() + { + } + + /// Username for the terminal server connection. + public string Username { get; set; } + /// Password for the terminal server connection. + public string Password { get; set; } + /// Serial Number of Terminal server. + public string SerialNumber { get; set; } /// IPv4 Address Prefix. public string PrimaryIPv4Prefix { get; set; } /// IPv6 Address Prefix. @@ -48,5 +107,7 @@ internal TerminalServerConfiguration(string username, string password, string se public string SecondaryIPv4Prefix { get; set; } /// Secondary IPv6 Address Prefix. public string SecondaryIPv6Prefix { get; set; } + /// ARM Resource ID used for the NetworkDevice. + public ResourceIdentifier NetworkDeviceId { get; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatchablePropertiesTerminalServerConfiguration.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerPatchConfiguration.Serialization.cs similarity index 60% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatchablePropertiesTerminalServerConfiguration.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerPatchConfiguration.Serialization.cs index 01d45676cc46..a47f98cb38c0 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/NetworkFabricPatchablePropertiesTerminalServerConfiguration.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerPatchConfiguration.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - public partial class NetworkFabricPatchablePropertiesTerminalServerConfiguration : IUtf8JsonSerializable, IJsonModel + public partial class TerminalServerPatchConfiguration : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -26,15 +26,29 @@ void IJsonModel.Wri /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkFabricPatchablePropertiesTerminalServerConfiguration)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TerminalServerPatchConfiguration)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Username)) + { + writer.WritePropertyName("username"u8); + writer.WriteStringValue(Username); + } + if (Optional.IsDefined(Password)) + { + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + } + if (Optional.IsDefined(SerialNumber)) + { + writer.WritePropertyName("serialNumber"u8); + writer.WriteStringValue(SerialNumber); + } if (Optional.IsDefined(PrimaryIPv4Prefix)) { writer.WritePropertyName("primaryIpv4Prefix"u8); @@ -55,21 +69,36 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("secondaryIpv6Prefix"u8); writer.WriteStringValue(SecondaryIPv6Prefix); } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } - NetworkFabricPatchablePropertiesTerminalServerConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TerminalServerPatchConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(NetworkFabricPatchablePropertiesTerminalServerConfiguration)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TerminalServerPatchConfiguration)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkFabricPatchablePropertiesTerminalServerConfiguration(document.RootElement, options); + return DeserializeTerminalServerPatchConfiguration(document.RootElement, options); } - internal static NetworkFabricPatchablePropertiesTerminalServerConfiguration DeserializeNetworkFabricPatchablePropertiesTerminalServerConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + internal static TerminalServerPatchConfiguration DeserializeTerminalServerPatchConfiguration(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -77,50 +106,50 @@ internal static NetworkFabricPatchablePropertiesTerminalServerConfiguration Dese { return null; } + string username = default; + string password = default; + string serialNumber = default; string primaryIPv4Prefix = default; string primaryIPv6Prefix = default; string secondaryIPv4Prefix = default; string secondaryIPv6Prefix = default; - string username = default; - string password = default; - string serialNumber = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("primaryIpv4Prefix"u8)) + if (property.NameEquals("username"u8)) { - primaryIPv4Prefix = property.Value.GetString(); + username = property.Value.GetString(); continue; } - if (property.NameEquals("primaryIpv6Prefix"u8)) + if (property.NameEquals("password"u8)) { - primaryIPv6Prefix = property.Value.GetString(); + password = property.Value.GetString(); continue; } - if (property.NameEquals("secondaryIpv4Prefix"u8)) + if (property.NameEquals("serialNumber"u8)) { - secondaryIPv4Prefix = property.Value.GetString(); + serialNumber = property.Value.GetString(); continue; } - if (property.NameEquals("secondaryIpv6Prefix"u8)) + if (property.NameEquals("primaryIpv4Prefix"u8)) { - secondaryIPv6Prefix = property.Value.GetString(); + primaryIPv4Prefix = property.Value.GetString(); continue; } - if (property.NameEquals("username"u8)) + if (property.NameEquals("primaryIpv6Prefix"u8)) { - username = property.Value.GetString(); + primaryIPv6Prefix = property.Value.GetString(); continue; } - if (property.NameEquals("password"u8)) + if (property.NameEquals("secondaryIpv4Prefix"u8)) { - password = property.Value.GetString(); + secondaryIPv4Prefix = property.Value.GetString(); continue; } - if (property.NameEquals("serialNumber"u8)) + if (property.NameEquals("secondaryIpv6Prefix"u8)) { - serialNumber = property.Value.GetString(); + secondaryIPv6Prefix = property.Value.GetString(); continue; } if (options.Format != "W") @@ -129,46 +158,46 @@ internal static NetworkFabricPatchablePropertiesTerminalServerConfiguration Dese } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkFabricPatchablePropertiesTerminalServerConfiguration( + return new TerminalServerPatchConfiguration( username, password, serialNumber, - serializedAdditionalRawData, primaryIPv4Prefix, primaryIPv6Prefix, secondaryIPv4Prefix, - secondaryIPv6Prefix); + secondaryIPv6Prefix, + serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(NetworkFabricPatchablePropertiesTerminalServerConfiguration)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TerminalServerPatchConfiguration)} does not support writing '{options.Format}' format."); } } - NetworkFabricPatchablePropertiesTerminalServerConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TerminalServerPatchConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkFabricPatchablePropertiesTerminalServerConfiguration(document.RootElement, options); + return DeserializeTerminalServerPatchConfiguration(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NetworkFabricPatchablePropertiesTerminalServerConfiguration)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TerminalServerPatchConfiguration)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/Layer3IPPrefixProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerPatchConfiguration.cs similarity index 64% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/Layer3IPPrefixProperties.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerPatchConfiguration.cs index ec20ddfb6dd2..e362ebc4e75c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/Layer3IPPrefixProperties.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerPatchConfiguration.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// Layer 3 primary and secondary IP Address prefixes. - public partial class Layer3IPPrefixProperties + /// Network and credentials configuration already applied to terminal server. + public partial class TerminalServerPatchConfiguration { /// /// Keeps track of any properties unknown to the library. @@ -43,21 +43,27 @@ public partial class Layer3IPPrefixProperties /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public Layer3IPPrefixProperties() + /// Initializes a new instance of . + public TerminalServerPatchConfiguration() { } - /// Initializes a new instance of . + /// Initializes a new instance of . + /// Username for the terminal server connection. + /// Password for the terminal server connection. + /// Serial Number of Terminal server. /// IPv4 Address Prefix. /// IPv6 Address Prefix. /// Secondary IPv4 Address Prefix. /// Secondary IPv6 Address Prefix. /// Keeps track of any properties unknown to the library. - internal Layer3IPPrefixProperties(string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix, IDictionary serializedAdditionalRawData) + internal TerminalServerPatchConfiguration(string username, string password, string serialNumber, string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix, IDictionary serializedAdditionalRawData) { + Username = username; + Password = password; + SerialNumber = serialNumber; PrimaryIPv4Prefix = primaryIPv4Prefix; PrimaryIPv6Prefix = primaryIPv6Prefix; SecondaryIPv4Prefix = secondaryIPv4Prefix; @@ -65,6 +71,12 @@ internal Layer3IPPrefixProperties(string primaryIPv4Prefix, string primaryIPv6Pr _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Username for the terminal server connection. + public string Username { get; set; } + /// Password for the terminal server connection. + public string Password { get; set; } + /// Serial Number of Terminal server. + public string SerialNumber { get; set; } /// IPv4 Address Prefix. public string PrimaryIPv4Prefix { get; set; } /// IPv6 Address Prefix. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerPatchableProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerPatchableProperties.cs deleted file mode 100644 index 0cc3f7f2eec5..000000000000 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/TerminalServerPatchableProperties.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ManagedNetworkFabric.Models -{ - /// Network and credential configuration currently applied on terminal server. - public partial class TerminalServerPatchableProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public TerminalServerPatchableProperties() - { - } - - /// Initializes a new instance of . - /// Username for the terminal server connection. - /// Password for the terminal server connection. - /// Serial Number of Terminal server. - /// Keeps track of any properties unknown to the library. - internal TerminalServerPatchableProperties(string username, string password, string serialNumber, IDictionary serializedAdditionalRawData) - { - Username = username; - Password = password; - SerialNumber = serialNumber; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Username for the terminal server connection. - public string Username { get; set; } - /// Password for the terminal server connection. - public string Password { get; set; } - /// Serial Number of Terminal server. - public string SerialNumber { get; set; } - } -} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UniqueRouteDistinguisherConfigurationState.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UniqueRouteDistinguisherConfigurationState.cs new file mode 100644 index 000000000000..5fac9698aa97 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UniqueRouteDistinguisherConfigurationState.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Unique Route Distinguisher Configuration State. + public readonly partial struct UniqueRouteDistinguisherConfigurationState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UniqueRouteDistinguisherConfigurationState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// UniqueRouteDistinguisherConfigurationState Enabled. + public static UniqueRouteDistinguisherConfigurationState Enabled { get; } = new UniqueRouteDistinguisherConfigurationState(EnabledValue); + /// UniqueRouteDistinguisherConfigurationState Disabled. + public static UniqueRouteDistinguisherConfigurationState Disabled { get; } = new UniqueRouteDistinguisherConfigurationState(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(UniqueRouteDistinguisherConfigurationState left, UniqueRouteDistinguisherConfigurationState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UniqueRouteDistinguisherConfigurationState left, UniqueRouteDistinguisherConfigurationState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator UniqueRouteDistinguisherConfigurationState(string value) => new UniqueRouteDistinguisherConfigurationState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UniqueRouteDistinguisherConfigurationState other && Equals(other); + /// + public bool Equals(UniqueRouteDistinguisherConfigurationState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UniqueRouteDistinguisherPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UniqueRouteDistinguisherPatchProperties.Serialization.cs new file mode 100644 index 000000000000..ab0e873f7730 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UniqueRouteDistinguisherPatchProperties.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class UniqueRouteDistinguisherPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UniqueRouteDistinguisherPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(UniqueRdConfigurationState)) + { + writer.WritePropertyName("uniqueRdConfigurationState"u8); + writer.WriteStringValue(UniqueRdConfigurationState.Value.ToString()); + } + if (Optional.IsDefined(NniDerivedUniqueRdConfigurationState)) + { + writer.WritePropertyName("nniDerivedUniqueRdConfigurationState"u8); + writer.WriteStringValue(NniDerivedUniqueRdConfigurationState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UniqueRouteDistinguisherPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UniqueRouteDistinguisherPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUniqueRouteDistinguisherPatchProperties(document.RootElement, options); + } + + internal static UniqueRouteDistinguisherPatchProperties DeserializeUniqueRouteDistinguisherPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + UniqueRouteDistinguisherConfigurationState? uniqueRdConfigurationState = default; + NNIDerivedUniqueRouteDistinguisherConfigurationState? nniDerivedUniqueRdConfigurationState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("uniqueRdConfigurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uniqueRdConfigurationState = new UniqueRouteDistinguisherConfigurationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("nniDerivedUniqueRdConfigurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nniDerivedUniqueRdConfigurationState = new NNIDerivedUniqueRouteDistinguisherConfigurationState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UniqueRouteDistinguisherPatchProperties(uniqueRdConfigurationState, nniDerivedUniqueRdConfigurationState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(UniqueRouteDistinguisherPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + UniqueRouteDistinguisherPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUniqueRouteDistinguisherPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UniqueRouteDistinguisherPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UniqueRouteDistinguisherPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UniqueRouteDistinguisherPatchProperties.cs new file mode 100644 index 000000000000..874841370945 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UniqueRouteDistinguisherPatchProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Unique Route Distinguisher configuration properties. + public partial class UniqueRouteDistinguisherPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public UniqueRouteDistinguisherPatchProperties() + { + } + + /// Initializes a new instance of . + /// Unique Route Distinguisher configuration state. Default is Enabled. + /// NNI derived unique Route Distinguisher state. Default is Disabled. + /// Keeps track of any properties unknown to the library. + internal UniqueRouteDistinguisherPatchProperties(UniqueRouteDistinguisherConfigurationState? uniqueRdConfigurationState, NNIDerivedUniqueRouteDistinguisherConfigurationState? nniDerivedUniqueRdConfigurationState, IDictionary serializedAdditionalRawData) + { + UniqueRdConfigurationState = uniqueRdConfigurationState; + NniDerivedUniqueRdConfigurationState = nniDerivedUniqueRdConfigurationState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Unique Route Distinguisher configuration state. Default is Enabled. + public UniqueRouteDistinguisherConfigurationState? UniqueRdConfigurationState { get; set; } + /// NNI derived unique Route Distinguisher state. Default is Disabled. + public NNIDerivedUniqueRouteDistinguisherConfigurationState? NniDerivedUniqueRdConfigurationState { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UniqueRouteDistinguisherProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UniqueRouteDistinguisherProperties.Serialization.cs new file mode 100644 index 000000000000..176b589b07ff --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UniqueRouteDistinguisherProperties.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class UniqueRouteDistinguisherProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UniqueRouteDistinguisherProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(UniqueRdConfigurationState)) + { + writer.WritePropertyName("uniqueRdConfigurationState"u8); + writer.WriteStringValue(UniqueRdConfigurationState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(UniqueRds)) + { + writer.WritePropertyName("uniqueRds"u8); + writer.WriteStartArray(); + foreach (var item in UniqueRds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NniDerivedUniqueRdConfigurationState)) + { + writer.WritePropertyName("nniDerivedUniqueRdConfigurationState"u8); + writer.WriteStringValue(NniDerivedUniqueRdConfigurationState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UniqueRouteDistinguisherProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UniqueRouteDistinguisherProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUniqueRouteDistinguisherProperties(document.RootElement, options); + } + + internal static UniqueRouteDistinguisherProperties DeserializeUniqueRouteDistinguisherProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + UniqueRouteDistinguisherConfigurationState? uniqueRdConfigurationState = default; + IReadOnlyList uniqueRds = default; + NNIDerivedUniqueRouteDistinguisherConfigurationState? nniDerivedUniqueRdConfigurationState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("uniqueRdConfigurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uniqueRdConfigurationState = new UniqueRouteDistinguisherConfigurationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("uniqueRds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + uniqueRds = array; + continue; + } + if (property.NameEquals("nniDerivedUniqueRdConfigurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nniDerivedUniqueRdConfigurationState = new NNIDerivedUniqueRouteDistinguisherConfigurationState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UniqueRouteDistinguisherProperties(uniqueRdConfigurationState, uniqueRds ?? new ChangeTrackingList(), nniDerivedUniqueRdConfigurationState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(UniqueRouteDistinguisherProperties)} does not support writing '{options.Format}' format."); + } + } + + UniqueRouteDistinguisherProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUniqueRouteDistinguisherProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UniqueRouteDistinguisherProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UniqueRouteDistinguisherProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UniqueRouteDistinguisherProperties.cs new file mode 100644 index 000000000000..cbb19d687780 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UniqueRouteDistinguisherProperties.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Unique Route Distinguisher properties. + public partial class UniqueRouteDistinguisherProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public UniqueRouteDistinguisherProperties() + { + UniqueRds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Unique Route Distinguisher configuration state. Default is Enabled. + /// List of Unique Route Distinguisher addresses. + /// NNI derived unique Route Distinguisher state. Default is Disabled. + /// Keeps track of any properties unknown to the library. + internal UniqueRouteDistinguisherProperties(UniqueRouteDistinguisherConfigurationState? uniqueRdConfigurationState, IReadOnlyList uniqueRds, NNIDerivedUniqueRouteDistinguisherConfigurationState? nniDerivedUniqueRdConfigurationState, IDictionary serializedAdditionalRawData) + { + UniqueRdConfigurationState = uniqueRdConfigurationState; + UniqueRds = uniqueRds; + NniDerivedUniqueRdConfigurationState = nniDerivedUniqueRdConfigurationState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Unique Route Distinguisher configuration state. Default is Enabled. + public UniqueRouteDistinguisherConfigurationState? UniqueRdConfigurationState { get; set; } + /// List of Unique Route Distinguisher addresses. + public IReadOnlyList UniqueRds { get; } + /// NNI derived unique Route Distinguisher state. Default is Disabled. + public NNIDerivedUniqueRouteDistinguisherConfigurationState? NniDerivedUniqueRdConfigurationState { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateAdministrativeStateContent.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateAdministrativeStateContent.Serialization.cs index 1dc0154eab50..04d168180c6d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateAdministrativeStateContent.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateAdministrativeStateContent.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,12 +34,36 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(UpdateAdministrativeStateContent)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(ResourceIds)) + { + writer.WritePropertyName("resourceIds"u8); + writer.WriteStartArray(); + foreach (var item in ResourceIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(State)) { writer.WritePropertyName("state"u8); writer.WriteStringValue(State.Value.ToString()); } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } UpdateAdministrativeStateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -62,40 +86,33 @@ internal static UpdateAdministrativeStateContent DeserializeUpdateAdministrative { return null; } + IList resourceIds = default; AdministrativeEnableState? state = default; - IList resourceIds = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("state"u8)) + if (property.NameEquals("resourceIds"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - state = new AdministrativeEnableState(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + resourceIds = array; continue; } - if (property.NameEquals("resourceIds"u8)) + if (property.NameEquals("state"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } - } - resourceIds = array; + state = new AdministrativeEnableState(property.Value.GetString()); continue; } if (options.Format != "W") @@ -104,7 +121,7 @@ internal static UpdateAdministrativeStateContent DeserializeUpdateAdministrative } } serializedAdditionalRawData = rawDataDictionary; - return new UpdateAdministrativeStateContent(resourceIds ?? new ChangeTrackingList(), serializedAdditionalRawData, state); + return new UpdateAdministrativeStateContent(resourceIds ?? new ChangeTrackingList(), state, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateAdministrativeStateContent.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateAdministrativeStateContent.cs index 06b526e8434c..60189d84e606 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateAdministrativeStateContent.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateAdministrativeStateContent.cs @@ -7,27 +7,63 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// Update administrative state on list of resources. - public partial class UpdateAdministrativeStateContent : UpdateAdministrativeStateOnResources + public partial class UpdateAdministrativeStateContent { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public UpdateAdministrativeStateContent() { + ResourceIds = new ChangeTrackingList(); } /// Initializes a new instance of . /// Network Fabrics or Network Rack resource Id. - /// Keeps track of any properties unknown to the library. /// Administrative state. - internal UpdateAdministrativeStateContent(IList resourceIds, IDictionary serializedAdditionalRawData, AdministrativeEnableState? state) : base(resourceIds, serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal UpdateAdministrativeStateContent(IList resourceIds, AdministrativeEnableState? state, IDictionary serializedAdditionalRawData) { + ResourceIds = resourceIds; State = state; + _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Network Fabrics or Network Rack resource Id. + public IList ResourceIds { get; } /// Administrative state. public AdministrativeEnableState? State { get; set; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateDeviceAdministrativeStateContent.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateDeviceAdministrativeStateContent.Serialization.cs index bd413a86e96c..a148f814e76e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateDeviceAdministrativeStateContent.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateDeviceAdministrativeStateContent.Serialization.cs @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter wri /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,12 +34,36 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(UpdateDeviceAdministrativeStateContent)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(ResourceIds)) + { + writer.WritePropertyName("resourceIds"u8); + writer.WriteStartArray(); + foreach (var item in ResourceIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(State)) { writer.WritePropertyName("state"u8); writer.WriteStringValue(State.Value.ToString()); } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } UpdateDeviceAdministrativeStateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -62,40 +86,33 @@ internal static UpdateDeviceAdministrativeStateContent DeserializeUpdateDeviceAd { return null; } + IList resourceIds = default; NetworkDeviceAdministrativeState? state = default; - IList resourceIds = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("state"u8)) + if (property.NameEquals("resourceIds"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - state = new NetworkDeviceAdministrativeState(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + resourceIds = array; continue; } - if (property.NameEquals("resourceIds"u8)) + if (property.NameEquals("state"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } - } - resourceIds = array; + state = new NetworkDeviceAdministrativeState(property.Value.GetString()); continue; } if (options.Format != "W") @@ -104,7 +121,7 @@ internal static UpdateDeviceAdministrativeStateContent DeserializeUpdateDeviceAd } } serializedAdditionalRawData = rawDataDictionary; - return new UpdateDeviceAdministrativeStateContent(resourceIds ?? new ChangeTrackingList(), serializedAdditionalRawData, state); + return new UpdateDeviceAdministrativeStateContent(resourceIds ?? new ChangeTrackingList(), state, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateDeviceAdministrativeStateContent.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateDeviceAdministrativeStateContent.cs index d6c9b429674b..df63bd851d09 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateDeviceAdministrativeStateContent.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateDeviceAdministrativeStateContent.cs @@ -7,27 +7,63 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// Update the administrative state on list of resources. - public partial class UpdateDeviceAdministrativeStateContent : UpdateAdministrativeStateOnResources + public partial class UpdateDeviceAdministrativeStateContent { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . public UpdateDeviceAdministrativeStateContent() { + ResourceIds = new ChangeTrackingList(); } /// Initializes a new instance of . /// Network Fabrics or Network Rack resource Id. - /// Keeps track of any properties unknown to the library. /// Administrative state. - internal UpdateDeviceAdministrativeStateContent(IList resourceIds, IDictionary serializedAdditionalRawData, NetworkDeviceAdministrativeState? state) : base(resourceIds, serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal UpdateDeviceAdministrativeStateContent(IList resourceIds, NetworkDeviceAdministrativeState? state, IDictionary serializedAdditionalRawData) { + ResourceIds = resourceIds; State = state; + _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Network Fabrics or Network Rack resource Id. + public IList ResourceIds { get; } /// Administrative state. public NetworkDeviceAdministrativeState? State { get; set; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpgradeNetworkFabricProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpgradeNetworkFabricProperties.Serialization.cs new file mode 100644 index 000000000000..754d3c8b48c2 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpgradeNetworkFabricProperties.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class UpgradeNetworkFabricProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpgradeNetworkFabricProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (Optional.IsDefined(Action)) + { + writer.WritePropertyName("action"u8); + writer.WriteStringValue(Action.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UpgradeNetworkFabricProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpgradeNetworkFabricProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUpgradeNetworkFabricProperties(document.RootElement, options); + } + + internal static UpgradeNetworkFabricProperties DeserializeUpgradeNetworkFabricProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string version = default; + NetworkFabricUpgradeAction? action = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("action"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + action = new NetworkFabricUpgradeAction(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UpgradeNetworkFabricProperties(version, action, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(UpgradeNetworkFabricProperties)} does not support writing '{options.Format}' format."); + } + } + + UpgradeNetworkFabricProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUpgradeNetworkFabricProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UpgradeNetworkFabricProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateAdministrativeStateOnResources.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpgradeNetworkFabricProperties.cs similarity index 66% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateAdministrativeStateOnResources.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpgradeNetworkFabricProperties.cs index b1f2b37a8468..4cc282a5e0fc 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpdateAdministrativeStateOnResources.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/UpgradeNetworkFabricProperties.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - /// Update administrative state on list of resources. - public partial class UpdateAdministrativeStateOnResources + /// Model used for Upgrade Network Fabric Properties. + public partial class UpgradeNetworkFabricProperties { /// /// Keeps track of any properties unknown to the library. @@ -44,24 +43,27 @@ public partial class UpdateAdministrativeStateOnResources /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public UpdateAdministrativeStateOnResources() + /// Initializes a new instance of . + public UpgradeNetworkFabricProperties() { - ResourceIds = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Network Fabrics or Network Rack resource Id. + /// Initializes a new instance of . + /// Specify the version. + /// Action to be performed while upgrading the fabric. /// Keeps track of any properties unknown to the library. - internal UpdateAdministrativeStateOnResources(IList resourceIds, IDictionary serializedAdditionalRawData) + internal UpgradeNetworkFabricProperties(string version, NetworkFabricUpgradeAction? action, IDictionary serializedAdditionalRawData) { - ResourceIds = resourceIds; + Version = version; + Action = action; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Network Fabrics or Network Rack resource Id. - public IList ResourceIds { get; } + /// Specify the version. + public string Version { get; set; } + /// Action to be performed while upgrading the fabric. + public NetworkFabricUpgradeAction? Action { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/V4OverV6BgpSessionState.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/V4OverV6BgpSessionState.cs new file mode 100644 index 000000000000..a7dff526143e --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/V4OverV6BgpSessionState.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// V4 over V6 bgp session. + public readonly partial struct V4OverV6BgpSessionState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public V4OverV6BgpSessionState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// V4OverV6BgpSessionState-Enabled. + public static V4OverV6BgpSessionState Enabled { get; } = new V4OverV6BgpSessionState(EnabledValue); + /// V4OverV6BgpSessionState-Disabled. + public static V4OverV6BgpSessionState Disabled { get; } = new V4OverV6BgpSessionState(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(V4OverV6BgpSessionState left, V4OverV6BgpSessionState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(V4OverV6BgpSessionState left, V4OverV6BgpSessionState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator V4OverV6BgpSessionState(string value) => new V4OverV6BgpSessionState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is V4OverV6BgpSessionState other && Equals(other); + /// + public bool Equals(V4OverV6BgpSessionState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/V6OverV4BgpSessionState.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/V6OverV4BgpSessionState.cs new file mode 100644 index 000000000000..45b1aae005dc --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/V6OverV4BgpSessionState.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// v6 over v4 bgp session. + public readonly partial struct V6OverV4BgpSessionState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public V6OverV4BgpSessionState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// V6OverV4BgpSessionState-Enabled. + public static V6OverV4BgpSessionState Enabled { get; } = new V6OverV4BgpSessionState(EnabledValue); + /// V6OverV4BgpSessionState-Disabled. + public static V6OverV4BgpSessionState Disabled { get; } = new V6OverV4BgpSessionState(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(V6OverV4BgpSessionState left, V6OverV4BgpSessionState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(V6OverV4BgpSessionState left, V6OverV4BgpSessionState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator V6OverV4BgpSessionState(string value) => new V6OverV4BgpSessionState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is V6OverV4BgpSessionState other && Equals(other); + /// + public bool Equals(V6OverV4BgpSessionState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ValidateConfigurationResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ValidateConfigurationResult.Serialization.cs index 69bf5fc12d47..f8f387a790fa 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ValidateConfigurationResult.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ValidateConfigurationResult.Serialization.cs @@ -27,7 +27,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -35,7 +35,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(ValidateConfigurationResult)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + ((IJsonModel)Error).Write(writer, options); + } if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) { writer.WritePropertyName("configurationState"u8); @@ -46,6 +50,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("url"u8); writer.WriteStringValue(Uri.AbsoluteUri); } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } ValidateConfigurationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -68,38 +87,38 @@ internal static ValidateConfigurationResult DeserializeValidateConfigurationResu { return null; } + ResponseError error = default; NetworkFabricConfigurationState? configurationState = default; Uri url = default; - ResponseError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("configurationState"u8)) + if (property.NameEquals("error"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - configurationState = new NetworkFabricConfigurationState(property.Value.GetString()); + error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerManagedNetworkFabricContext.Default); continue; } - if (property.NameEquals("url"u8)) + if (property.NameEquals("configurationState"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - url = new Uri(property.Value.GetString()); + configurationState = new NetworkFabricConfigurationState(property.Value.GetString()); continue; } - if (property.NameEquals("error"u8)) + if (property.NameEquals("url"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerManagedNetworkFabricContext.Default); + url = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -108,7 +127,7 @@ internal static ValidateConfigurationResult DeserializeValidateConfigurationResu } } serializedAdditionalRawData = rawDataDictionary; - return new ValidateConfigurationResult(error, serializedAdditionalRawData, configurationState, url); + return new ValidateConfigurationResult(error, configurationState, url, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ValidateConfigurationResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ValidateConfigurationResult.cs index 85221cf56d1e..0b75c4fd4b20 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ValidateConfigurationResult.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ValidateConfigurationResult.cs @@ -11,8 +11,40 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// The response of the action validate configuration. - public partial class ValidateConfigurationResult : NetworkFabricErrorResult + public partial class ValidateConfigurationResult { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . internal ValidateConfigurationResult() { @@ -20,15 +52,19 @@ internal ValidateConfigurationResult() /// Initializes a new instance of . /// The error object. - /// Keeps track of any properties unknown to the library. /// Gets the configuration state. /// URL for the details of the response. - internal ValidateConfigurationResult(ResponseError error, IDictionary serializedAdditionalRawData, NetworkFabricConfigurationState? configurationState, Uri uri) : base(error, serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ValidateConfigurationResult(ResponseError error, NetworkFabricConfigurationState? configurationState, Uri uri, IDictionary serializedAdditionalRawData) { + Error = error; ConfigurationState = configurationState; Uri = uri; + _serializedAdditionalRawData = serializedAdditionalRawData; } + /// The error object. + public ResponseError Error { get; } /// Gets the configuration state. public NetworkFabricConfigurationState? ConfigurationState { get; } /// URL for the details of the response. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ViewDeviceConfigurationResult.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ViewDeviceConfigurationResult.Serialization.cs new file mode 100644 index 000000000000..ac014348e131 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ViewDeviceConfigurationResult.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class ViewDeviceConfigurationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ViewDeviceConfigurationResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DeviceConfigurationUri)) + { + writer.WritePropertyName("deviceConfigurationUrl"u8); + writer.WriteStringValue(DeviceConfigurationUri.AbsoluteUri); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + ((IJsonModel)Error).Write(writer, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ViewDeviceConfigurationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ViewDeviceConfigurationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeViewDeviceConfigurationResult(document.RootElement, options); + } + + internal static ViewDeviceConfigurationResult DeserializeViewDeviceConfigurationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri deviceConfigurationUrl = default; + ResponseError error = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deviceConfigurationUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deviceConfigurationUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerManagedNetworkFabricContext.Default); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ViewDeviceConfigurationResult(deviceConfigurationUrl, error, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(ViewDeviceConfigurationResult)} does not support writing '{options.Format}' format."); + } + } + + ViewDeviceConfigurationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeViewDeviceConfigurationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ViewDeviceConfigurationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ViewDeviceConfigurationResult.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ViewDeviceConfigurationResult.cs new file mode 100644 index 000000000000..e4ac3070da1a --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/ViewDeviceConfigurationResult.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// View Device Configuration Response. + public partial class ViewDeviceConfigurationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ViewDeviceConfigurationResult() + { + } + + /// Initializes a new instance of . + /// Storage URL to the device configuration file. + /// The error object. + /// Keeps track of any properties unknown to the library. + internal ViewDeviceConfigurationResult(Uri deviceConfigurationUri, ResponseError error, IDictionary serializedAdditionalRawData) + { + DeviceConfigurationUri = deviceConfigurationUri; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Storage URL to the device configuration file. + public Uri DeviceConfigurationUri { get; } + /// The error object. + public ResponseError Error { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanGroupPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanGroupPatchProperties.Serialization.cs new file mode 100644 index 000000000000..229ce65eec8c --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanGroupPatchProperties.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class VlanGroupPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VlanGroupPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsCollectionDefined(Vlans)) + { + writer.WritePropertyName("vlans"u8); + writer.WriteStartArray(); + foreach (var item in Vlans) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VlanGroupPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VlanGroupPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVlanGroupPatchProperties(document.RootElement, options); + } + + internal static VlanGroupPatchProperties DeserializeVlanGroupPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IList vlans = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("vlans"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + vlans = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VlanGroupPatchProperties(name, vlans ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(VlanGroupPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + VlanGroupPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVlanGroupPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VlanGroupPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanGroupPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanGroupPatchProperties.cs new file mode 100644 index 000000000000..57999924d625 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanGroupPatchProperties.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Vlan group properties. + public partial class VlanGroupPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public VlanGroupPatchProperties() + { + Vlans = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Vlan group name. + /// List of vlans. + /// Keeps track of any properties unknown to the library. + internal VlanGroupPatchProperties(string name, IList vlans, IDictionary serializedAdditionalRawData) + { + Name = name; + Vlans = vlans; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Vlan group name. + public string Name { get; set; } + /// List of vlans. + public IList Vlans { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanMatchCondition.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanMatchCondition.cs index 7ee65277551c..a6715e118265 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanMatchCondition.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanMatchCondition.cs @@ -54,8 +54,8 @@ public VlanMatchCondition() } /// Initializes a new instance of . - /// List of vlans that need to be matched. - /// List of inner vlans that need to be matched. + /// List of vlans that need to be matched. Inputs can be single vlan or the range of vlans. + /// List of inner vlans that need to be matched.Inputs can be single vlan or the range of vlans. /// List of vlan group names that need to be matched. /// Keeps track of any properties unknown to the library. internal VlanMatchCondition(IList vlans, IList innerVlans, IList vlanGroupNames, IDictionary serializedAdditionalRawData) @@ -66,9 +66,9 @@ internal VlanMatchCondition(IList vlans, IList innerVlans, IList _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of vlans that need to be matched. + /// List of vlans that need to be matched. Inputs can be single vlan or the range of vlans. public IList Vlans { get; } - /// List of inner vlans that need to be matched. + /// List of inner vlans that need to be matched.Inputs can be single vlan or the range of vlans. public IList InnerVlans { get; } /// List of vlan group names that need to be matched. public IList VlanGroupNames { get; } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanMatchConditionPatch.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanMatchConditionPatch.Serialization.cs new file mode 100644 index 000000000000..3cc003b2c9eb --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanMatchConditionPatch.Serialization.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class VlanMatchConditionPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VlanMatchConditionPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Vlans)) + { + writer.WritePropertyName("vlans"u8); + writer.WriteStartArray(); + foreach (var item in Vlans) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(InnerVlans)) + { + writer.WritePropertyName("innerVlans"u8); + writer.WriteStartArray(); + foreach (var item in InnerVlans) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(VlanGroupNames)) + { + writer.WritePropertyName("vlanGroupNames"u8); + writer.WriteStartArray(); + foreach (var item in VlanGroupNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VlanMatchConditionPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VlanMatchConditionPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVlanMatchConditionPatch(document.RootElement, options); + } + + internal static VlanMatchConditionPatch DeserializeVlanMatchConditionPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList vlans = default; + IList innerVlans = default; + IList vlanGroupNames = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vlans"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + vlans = array; + continue; + } + if (property.NameEquals("innerVlans"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + innerVlans = array; + continue; + } + if (property.NameEquals("vlanGroupNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + vlanGroupNames = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VlanMatchConditionPatch(vlans ?? new ChangeTrackingList(), innerVlans ?? new ChangeTrackingList(), vlanGroupNames ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(VlanMatchConditionPatch)} does not support writing '{options.Format}' format."); + } + } + + VlanMatchConditionPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVlanMatchConditionPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VlanMatchConditionPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanMatchConditionPatch.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanMatchConditionPatch.cs new file mode 100644 index 000000000000..7ed3b7f853fa --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VlanMatchConditionPatch.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// The vlan match conditions that need to be matched. + public partial class VlanMatchConditionPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public VlanMatchConditionPatch() + { + Vlans = new ChangeTrackingList(); + InnerVlans = new ChangeTrackingList(); + VlanGroupNames = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of vlans that need to be matched. Inputs can be single vlan or the range of vlans. + /// List of inner vlans that need to be matched.Inputs can be single vlan or the range of vlans. + /// List of vlan group names that need to be matched. + /// Keeps track of any properties unknown to the library. + internal VlanMatchConditionPatch(IList vlans, IList innerVlans, IList vlanGroupNames, IDictionary serializedAdditionalRawData) + { + Vlans = vlans; + InnerVlans = innerVlans; + VlanGroupNames = vlanGroupNames; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of vlans that need to be matched. Inputs can be single vlan or the range of vlans. + public IList Vlans { get; } + /// List of inner vlans that need to be matched.Inputs can be single vlan or the range of vlans. + public IList InnerVlans { get; } + /// List of vlan group names that need to be matched. + public IList VlanGroupNames { get; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationOptionAProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationOptionAProperties.cs deleted file mode 100644 index 26da494ecf23..000000000000 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationOptionAProperties.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ManagedNetworkFabric.Models -{ - /// option A properties. - public partial class VpnConfigurationOptionAProperties : OptionAProperties - { - /// Initializes a new instance of . - public VpnConfigurationOptionAProperties() - { - } - - /// Initializes a new instance of . - /// MTU to use for option A peering. - /// Vlan Id.Example : 501. - /// Peer ASN number.Example : 28. - /// BFD Configuration properties. - /// Keeps track of any properties unknown to the library. - /// IPv4 Address Prefix. - /// IPv6 Address Prefix. - /// Secondary IPv4 Address Prefix. - /// Secondary IPv6 Address Prefix. - internal VpnConfigurationOptionAProperties(int? mtu, int? vlanId, long? peerAsn, BfdConfiguration bfdConfiguration, IDictionary serializedAdditionalRawData, string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix) : base(mtu, vlanId, peerAsn, bfdConfiguration, serializedAdditionalRawData) - { - PrimaryIPv4Prefix = primaryIPv4Prefix; - PrimaryIPv6Prefix = primaryIPv6Prefix; - SecondaryIPv4Prefix = secondaryIPv4Prefix; - SecondaryIPv6Prefix = secondaryIPv6Prefix; - } - - /// IPv4 Address Prefix. - public string PrimaryIPv4Prefix { get; set; } - /// IPv6 Address Prefix. - public string PrimaryIPv6Prefix { get; set; } - /// Secondary IPv4 Address Prefix. - public string SecondaryIPv4Prefix { get; set; } - /// Secondary IPv6 Address Prefix. - public string SecondaryIPv6Prefix { get; set; } - } -} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationPatchableOptionAProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationPatchableOptionAProperties.cs deleted file mode 100644 index c7e9dd6ffb73..000000000000 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationPatchableOptionAProperties.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ManagedNetworkFabric.Models -{ - /// option A properties. - public partial class VpnConfigurationPatchableOptionAProperties : OptionAProperties - { - /// Initializes a new instance of . - public VpnConfigurationPatchableOptionAProperties() - { - } - - /// Initializes a new instance of . - /// MTU to use for option A peering. - /// Vlan Id.Example : 501. - /// Peer ASN number.Example : 28. - /// BFD Configuration properties. - /// Keeps track of any properties unknown to the library. - /// IPv4 Address Prefix. - /// IPv6 Address Prefix. - /// Secondary IPv4 Address Prefix. - /// Secondary IPv6 Address Prefix. - internal VpnConfigurationPatchableOptionAProperties(int? mtu, int? vlanId, long? peerAsn, BfdConfiguration bfdConfiguration, IDictionary serializedAdditionalRawData, string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix) : base(mtu, vlanId, peerAsn, bfdConfiguration, serializedAdditionalRawData) - { - PrimaryIPv4Prefix = primaryIPv4Prefix; - PrimaryIPv6Prefix = primaryIPv6Prefix; - SecondaryIPv4Prefix = secondaryIPv4Prefix; - SecondaryIPv6Prefix = secondaryIPv6Prefix; - } - - /// IPv4 Address Prefix. - public string PrimaryIPv4Prefix { get; set; } - /// IPv6 Address Prefix. - public string PrimaryIPv6Prefix { get; set; } - /// Secondary IPv4 Address Prefix. - public string SecondaryIPv4Prefix { get; set; } - /// Secondary IPv6 Address Prefix. - public string SecondaryIPv6Prefix { get; set; } - } -} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationPatchableProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationPatchableProperties.Serialization.cs index 3b9e0760da85..49b1da8c757d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationPatchableProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationPatchableProperties.Serialization.cs @@ -93,8 +93,8 @@ internal static VpnConfigurationPatchableProperties DeserializeVpnConfigurationP } ResourceIdentifier networkToNetworkInterconnectId = default; PeeringOption? peeringOption = default; - OptionBProperties optionBProperties = default; - VpnConfigurationPatchableOptionAProperties optionAProperties = default; + VpnOptionBPatchProperties optionBProperties = default; + VpnOptionAPatchProperties optionAProperties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -123,7 +123,7 @@ internal static VpnConfigurationPatchableProperties DeserializeVpnConfigurationP { continue; } - optionBProperties = OptionBProperties.DeserializeOptionBProperties(property.Value, options); + optionBProperties = VpnOptionBPatchProperties.DeserializeVpnOptionBPatchProperties(property.Value, options); continue; } if (property.NameEquals("optionAProperties"u8)) @@ -132,7 +132,7 @@ internal static VpnConfigurationPatchableProperties DeserializeVpnConfigurationP { continue; } - optionAProperties = VpnConfigurationPatchableOptionAProperties.DeserializeVpnConfigurationPatchableOptionAProperties(property.Value, options); + optionAProperties = VpnOptionAPatchProperties.DeserializeVpnOptionAPatchProperties(property.Value, options); continue; } if (options.Format != "W") diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationPatchableProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationPatchableProperties.cs index 5da5470f360c..7138371f2d8c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationPatchableProperties.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationPatchableProperties.cs @@ -57,7 +57,7 @@ public VpnConfigurationPatchableProperties() /// option B properties. /// option A properties. /// Keeps track of any properties unknown to the library. - internal VpnConfigurationPatchableProperties(ResourceIdentifier networkToNetworkInterconnectId, PeeringOption? peeringOption, OptionBProperties optionBProperties, VpnConfigurationPatchableOptionAProperties optionAProperties, IDictionary serializedAdditionalRawData) + internal VpnConfigurationPatchableProperties(ResourceIdentifier networkToNetworkInterconnectId, PeeringOption? peeringOption, VpnOptionBPatchProperties optionBProperties, VpnOptionAPatchProperties optionAProperties, IDictionary serializedAdditionalRawData) { NetworkToNetworkInterconnectId = networkToNetworkInterconnectId; PeeringOption = peeringOption; @@ -71,8 +71,8 @@ internal VpnConfigurationPatchableProperties(ResourceIdentifier networkToNetwork /// Peering option list. public PeeringOption? PeeringOption { get; set; } /// option B properties. - public OptionBProperties OptionBProperties { get; set; } + public VpnOptionBPatchProperties OptionBProperties { get; set; } /// option A properties. - public VpnConfigurationPatchableOptionAProperties OptionAProperties { get; set; } + public VpnOptionAPatchProperties OptionAProperties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationProperties.Serialization.cs index 1311f91376b9..044b98796771 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationProperties.Serialization.cs @@ -96,8 +96,8 @@ internal static VpnConfigurationProperties DeserializeVpnConfigurationProperties ResourceIdentifier networkToNetworkInterconnectId = default; NetworkFabricAdministrativeState? administrativeState = default; PeeringOption peeringOption = default; - OptionBProperties optionBProperties = default; - VpnConfigurationOptionAProperties optionAProperties = default; + VpnOptionBProperties optionBProperties = default; + VpnOptionAProperties optionAProperties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,7 +131,7 @@ internal static VpnConfigurationProperties DeserializeVpnConfigurationProperties { continue; } - optionBProperties = OptionBProperties.DeserializeOptionBProperties(property.Value, options); + optionBProperties = VpnOptionBProperties.DeserializeVpnOptionBProperties(property.Value, options); continue; } if (property.NameEquals("optionAProperties"u8)) @@ -140,7 +140,7 @@ internal static VpnConfigurationProperties DeserializeVpnConfigurationProperties { continue; } - optionAProperties = VpnConfigurationOptionAProperties.DeserializeVpnConfigurationOptionAProperties(property.Value, options); + optionAProperties = VpnOptionAProperties.DeserializeVpnOptionAProperties(property.Value, options); continue; } if (options.Format != "W") diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationProperties.cs index af2fa83c9449..2968cece025f 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationProperties.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationProperties.cs @@ -60,7 +60,7 @@ public VpnConfigurationProperties(PeeringOption peeringOption) /// option B properties. /// option A properties. /// Keeps track of any properties unknown to the library. - internal VpnConfigurationProperties(ResourceIdentifier networkToNetworkInterconnectId, NetworkFabricAdministrativeState? administrativeState, PeeringOption peeringOption, OptionBProperties optionBProperties, VpnConfigurationOptionAProperties optionAProperties, IDictionary serializedAdditionalRawData) + internal VpnConfigurationProperties(ResourceIdentifier networkToNetworkInterconnectId, NetworkFabricAdministrativeState? administrativeState, PeeringOption peeringOption, VpnOptionBProperties optionBProperties, VpnOptionAProperties optionAProperties, IDictionary serializedAdditionalRawData) { NetworkToNetworkInterconnectId = networkToNetworkInterconnectId; AdministrativeState = administrativeState; @@ -82,8 +82,8 @@ internal VpnConfigurationProperties() /// Peering option list. public PeeringOption PeeringOption { get; set; } /// option B properties. - public OptionBProperties OptionBProperties { get; set; } + public VpnOptionBProperties OptionBProperties { get; set; } /// option A properties. - public VpnConfigurationOptionAProperties OptionAProperties { get; set; } + public VpnOptionAProperties OptionAProperties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationOptionAProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionAPatchProperties.Serialization.cs similarity index 63% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationOptionAProperties.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionAPatchProperties.Serialization.cs index d1b8a56406e4..e1f47154f5b3 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationOptionAProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionAPatchProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - public partial class VpnConfigurationOptionAProperties : IUtf8JsonSerializable, IJsonModel + public partial class VpnOptionAPatchProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -26,15 +26,34 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(VpnConfigurationOptionAProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(VpnOptionAPatchProperties)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Mtu)) + { + writer.WritePropertyName("mtu"u8); + writer.WriteNumberValue(Mtu.Value); + } + if (Optional.IsDefined(VlanId)) + { + writer.WritePropertyName("vlanId"u8); + writer.WriteNumberValue(VlanId.Value); + } + if (Optional.IsDefined(PeerAsn)) + { + writer.WritePropertyName("peerASN"u8); + writer.WriteNumberValue(PeerAsn.Value); + } + if (Optional.IsDefined(BfdConfiguration)) + { + writer.WritePropertyName("bfdConfiguration"u8); + writer.WriteObjectValue(BfdConfiguration, options); + } if (Optional.IsDefined(PrimaryIPv4Prefix)) { writer.WritePropertyName("primaryIpv4Prefix"u8); @@ -55,21 +74,36 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("secondaryIpv6Prefix"u8); writer.WriteStringValue(SecondaryIPv6Prefix); } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } - VpnConfigurationOptionAProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + VpnOptionAPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(VpnConfigurationOptionAProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(VpnOptionAPatchProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeVpnConfigurationOptionAProperties(document.RootElement, options); + return DeserializeVpnOptionAPatchProperties(document.RootElement, options); } - internal static VpnConfigurationOptionAProperties DeserializeVpnConfigurationOptionAProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static VpnOptionAPatchProperties DeserializeVpnOptionAPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -77,38 +111,18 @@ internal static VpnConfigurationOptionAProperties DeserializeVpnConfigurationOpt { return null; } + int? mtu = default; + int? vlanId = default; + long? peerAsn = default; + BfdPatchConfiguration bfdConfiguration = default; string primaryIPv4Prefix = default; string primaryIPv6Prefix = default; string secondaryIPv4Prefix = default; string secondaryIPv6Prefix = default; - int? mtu = default; - int? vlanId = default; - long? peerAsn = default; - BfdConfiguration bfdConfiguration = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("primaryIpv4Prefix"u8)) - { - primaryIPv4Prefix = property.Value.GetString(); - continue; - } - if (property.NameEquals("primaryIpv6Prefix"u8)) - { - primaryIPv6Prefix = property.Value.GetString(); - continue; - } - if (property.NameEquals("secondaryIpv4Prefix"u8)) - { - secondaryIPv4Prefix = property.Value.GetString(); - continue; - } - if (property.NameEquals("secondaryIpv6Prefix"u8)) - { - secondaryIPv6Prefix = property.Value.GetString(); - continue; - } if (property.NameEquals("mtu"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -142,7 +156,27 @@ internal static VpnConfigurationOptionAProperties DeserializeVpnConfigurationOpt { continue; } - bfdConfiguration = BfdConfiguration.DeserializeBfdConfiguration(property.Value, options); + bfdConfiguration = BfdPatchConfiguration.DeserializeBfdPatchConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("primaryIpv4Prefix"u8)) + { + primaryIPv4Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("primaryIpv6Prefix"u8)) + { + primaryIPv6Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("secondaryIpv4Prefix"u8)) + { + secondaryIPv4Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("secondaryIpv6Prefix"u8)) + { + secondaryIPv6Prefix = property.Value.GetString(); continue; } if (options.Format != "W") @@ -151,47 +185,47 @@ internal static VpnConfigurationOptionAProperties DeserializeVpnConfigurationOpt } } serializedAdditionalRawData = rawDataDictionary; - return new VpnConfigurationOptionAProperties( + return new VpnOptionAPatchProperties( mtu, vlanId, peerAsn, bfdConfiguration, - serializedAdditionalRawData, primaryIPv4Prefix, primaryIPv6Prefix, secondaryIPv4Prefix, - secondaryIPv6Prefix); + secondaryIPv6Prefix, + serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(VpnConfigurationOptionAProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(VpnOptionAPatchProperties)} does not support writing '{options.Format}' format."); } } - VpnConfigurationOptionAProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + VpnOptionAPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeVpnConfigurationOptionAProperties(document.RootElement, options); + return DeserializeVpnOptionAPatchProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(VpnConfigurationOptionAProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(VpnOptionAPatchProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionAProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionAPatchProperties.cs similarity index 60% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionAProperties.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionAPatchProperties.cs index c1071fe85ace..1eb2e961da37 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionAProperties.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionAPatchProperties.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// Peering optionA properties. - public partial class OptionAProperties + public partial class VpnOptionAPatchProperties { /// /// Keeps track of any properties unknown to the library. @@ -43,25 +43,33 @@ public partial class OptionAProperties /// /// /// - private protected IDictionary _serializedAdditionalRawData; + private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public OptionAProperties() + /// Initializes a new instance of . + public VpnOptionAPatchProperties() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// MTU to use for option A peering. /// Vlan Id.Example : 501. /// Peer ASN number.Example : 28. /// BFD Configuration properties. + /// IPv4 Address Prefix. + /// IPv6 Address Prefix. + /// Secondary IPv4 Address Prefix. + /// Secondary IPv6 Address Prefix. /// Keeps track of any properties unknown to the library. - internal OptionAProperties(int? mtu, int? vlanId, long? peerAsn, BfdConfiguration bfdConfiguration, IDictionary serializedAdditionalRawData) + internal VpnOptionAPatchProperties(int? mtu, int? vlanId, long? peerAsn, BfdPatchConfiguration bfdConfiguration, string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix, IDictionary serializedAdditionalRawData) { Mtu = mtu; VlanId = vlanId; PeerAsn = peerAsn; BfdConfiguration = bfdConfiguration; + PrimaryIPv4Prefix = primaryIPv4Prefix; + PrimaryIPv6Prefix = primaryIPv6Prefix; + SecondaryIPv4Prefix = secondaryIPv4Prefix; + SecondaryIPv6Prefix = secondaryIPv6Prefix; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -72,6 +80,14 @@ internal OptionAProperties(int? mtu, int? vlanId, long? peerAsn, BfdConfiguratio /// Peer ASN number.Example : 28. public long? PeerAsn { get; set; } /// BFD Configuration properties. - public BfdConfiguration BfdConfiguration { get; set; } + public BfdPatchConfiguration BfdConfiguration { get; set; } + /// IPv4 Address Prefix. + public string PrimaryIPv4Prefix { get; set; } + /// IPv6 Address Prefix. + public string PrimaryIPv6Prefix { get; set; } + /// Secondary IPv4 Address Prefix. + public string SecondaryIPv4Prefix { get; set; } + /// Secondary IPv6 Address Prefix. + public string SecondaryIPv6Prefix { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationPatchableOptionAProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionAProperties.Serialization.cs similarity index 65% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationPatchableOptionAProperties.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionAProperties.Serialization.cs index 0a4c4be2b7c0..9df20a5116c2 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnConfigurationPatchableOptionAProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionAProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - public partial class VpnConfigurationPatchableOptionAProperties : IUtf8JsonSerializable, IJsonModel + public partial class VpnOptionAProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -26,15 +26,28 @@ void IJsonModel.Write(Utf8JsonWriter /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(VpnConfigurationPatchableOptionAProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(VpnOptionAProperties)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Mtu)) + { + writer.WritePropertyName("mtu"u8); + writer.WriteNumberValue(Mtu.Value); + } + writer.WritePropertyName("vlanId"u8); + writer.WriteNumberValue(VlanId); + writer.WritePropertyName("peerASN"u8); + writer.WriteNumberValue(PeerAsn); + if (Optional.IsDefined(BfdConfiguration)) + { + writer.WritePropertyName("bfdConfiguration"u8); + writer.WriteObjectValue(BfdConfiguration, options); + } if (Optional.IsDefined(PrimaryIPv4Prefix)) { writer.WritePropertyName("primaryIpv4Prefix"u8); @@ -55,21 +68,36 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("secondaryIpv6Prefix"u8); writer.WriteStringValue(SecondaryIPv6Prefix); } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } - VpnConfigurationPatchableOptionAProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + VpnOptionAProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(VpnConfigurationPatchableOptionAProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(VpnOptionAProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeVpnConfigurationPatchableOptionAProperties(document.RootElement, options); + return DeserializeVpnOptionAProperties(document.RootElement, options); } - internal static VpnConfigurationPatchableOptionAProperties DeserializeVpnConfigurationPatchableOptionAProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static VpnOptionAProperties DeserializeVpnOptionAProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -77,38 +105,18 @@ internal static VpnConfigurationPatchableOptionAProperties DeserializeVpnConfigu { return null; } + int? mtu = default; + int vlanId = default; + long peerAsn = default; + BfdConfiguration bfdConfiguration = default; string primaryIPv4Prefix = default; string primaryIPv6Prefix = default; string secondaryIPv4Prefix = default; string secondaryIPv6Prefix = default; - int? mtu = default; - int? vlanId = default; - long? peerAsn = default; - BfdConfiguration bfdConfiguration = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("primaryIpv4Prefix"u8)) - { - primaryIPv4Prefix = property.Value.GetString(); - continue; - } - if (property.NameEquals("primaryIpv6Prefix"u8)) - { - primaryIPv6Prefix = property.Value.GetString(); - continue; - } - if (property.NameEquals("secondaryIpv4Prefix"u8)) - { - secondaryIPv4Prefix = property.Value.GetString(); - continue; - } - if (property.NameEquals("secondaryIpv6Prefix"u8)) - { - secondaryIPv6Prefix = property.Value.GetString(); - continue; - } if (property.NameEquals("mtu"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -120,19 +128,11 @@ internal static VpnConfigurationPatchableOptionAProperties DeserializeVpnConfigu } if (property.NameEquals("vlanId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } vlanId = property.Value.GetInt32(); continue; } if (property.NameEquals("peerASN"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } peerAsn = property.Value.GetInt64(); continue; } @@ -145,53 +145,73 @@ internal static VpnConfigurationPatchableOptionAProperties DeserializeVpnConfigu bfdConfiguration = BfdConfiguration.DeserializeBfdConfiguration(property.Value, options); continue; } + if (property.NameEquals("primaryIpv4Prefix"u8)) + { + primaryIPv4Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("primaryIpv6Prefix"u8)) + { + primaryIPv6Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("secondaryIpv4Prefix"u8)) + { + secondaryIPv4Prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("secondaryIpv6Prefix"u8)) + { + secondaryIPv6Prefix = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new VpnConfigurationPatchableOptionAProperties( + return new VpnOptionAProperties( mtu, vlanId, peerAsn, bfdConfiguration, - serializedAdditionalRawData, primaryIPv4Prefix, primaryIPv6Prefix, secondaryIPv4Prefix, - secondaryIPv6Prefix); + secondaryIPv6Prefix, + serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(VpnConfigurationPatchableOptionAProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(VpnOptionAProperties)} does not support writing '{options.Format}' format."); } } - VpnConfigurationPatchableOptionAProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + VpnOptionAProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeVpnConfigurationPatchableOptionAProperties(document.RootElement, options); + return DeserializeVpnOptionAProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(VpnConfigurationPatchableOptionAProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(VpnOptionAProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionAProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionAProperties.cs new file mode 100644 index 000000000000..1600314518b2 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionAProperties.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// option A properties. + public partial class VpnOptionAProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Vlan Id.Example : 501. + /// Peer ASN number.Example : 28. + public VpnOptionAProperties(int vlanId, long peerAsn) + { + VlanId = vlanId; + PeerAsn = peerAsn; + } + + /// Initializes a new instance of . + /// MTU to use for option A peering. + /// Vlan Id.Example : 501. + /// Peer ASN number.Example : 28. + /// BFD Configuration properties. + /// IPv4 Address Prefix. + /// IPv6 Address Prefix. + /// Secondary IPv4 Address Prefix. + /// Secondary IPv6 Address Prefix. + /// Keeps track of any properties unknown to the library. + internal VpnOptionAProperties(int? mtu, int vlanId, long peerAsn, BfdConfiguration bfdConfiguration, string primaryIPv4Prefix, string primaryIPv6Prefix, string secondaryIPv4Prefix, string secondaryIPv6Prefix, IDictionary serializedAdditionalRawData) + { + Mtu = mtu; + VlanId = vlanId; + PeerAsn = peerAsn; + BfdConfiguration = bfdConfiguration; + PrimaryIPv4Prefix = primaryIPv4Prefix; + PrimaryIPv6Prefix = primaryIPv6Prefix; + SecondaryIPv4Prefix = secondaryIPv4Prefix; + SecondaryIPv6Prefix = secondaryIPv6Prefix; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VpnOptionAProperties() + { + } + + /// MTU to use for option A peering. + public int? Mtu { get; set; } + /// Vlan Id.Example : 501. + public int VlanId { get; set; } + /// Peer ASN number.Example : 28. + public long PeerAsn { get; set; } + /// BFD Configuration properties. + public BfdConfiguration BfdConfiguration { get; set; } + /// IPv4 Address Prefix. + public string PrimaryIPv4Prefix { get; set; } + /// IPv6 Address Prefix. + public string PrimaryIPv6Prefix { get; set; } + /// Secondary IPv4 Address Prefix. + public string SecondaryIPv4Prefix { get; set; } + /// Secondary IPv6 Address Prefix. + public string SecondaryIPv6Prefix { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionBPatchProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionBPatchProperties.Serialization.cs new file mode 100644 index 000000000000..d85da82a7e8e --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionBPatchProperties.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + public partial class VpnOptionBPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VpnOptionBPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(ImportRouteTargets)) + { + writer.WritePropertyName("importRouteTargets"u8); + writer.WriteStartArray(); + foreach (var item in ImportRouteTargets) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ExportRouteTargets)) + { + writer.WritePropertyName("exportRouteTargets"u8); + writer.WriteStartArray(); + foreach (var item in ExportRouteTargets) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(RouteTargets)) + { + writer.WritePropertyName("routeTargets"u8); + writer.WriteObjectValue(RouteTargets, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VpnOptionBPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VpnOptionBPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVpnOptionBPatchProperties(document.RootElement, options); + } + + internal static VpnOptionBPatchProperties DeserializeVpnOptionBPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList importRouteTargets = default; + IList exportRouteTargets = default; + RouteTargetPatchInformation routeTargets = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("importRouteTargets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + importRouteTargets = array; + continue; + } + if (property.NameEquals("exportRouteTargets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + exportRouteTargets = array; + continue; + } + if (property.NameEquals("routeTargets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + routeTargets = RouteTargetPatchInformation.DeserializeRouteTargetPatchInformation(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VpnOptionBPatchProperties(importRouteTargets ?? new ChangeTrackingList(), exportRouteTargets ?? new ChangeTrackingList(), routeTargets, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(VpnOptionBPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + VpnOptionBPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVpnOptionBPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VpnOptionBPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionBPatchProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionBPatchProperties.cs new file mode 100644 index 000000000000..266038f288a9 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionBPatchProperties.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Models +{ + /// Option B configuration to be used for Management VPN. + public partial class VpnOptionBPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public VpnOptionBPatchProperties() + { + ImportRouteTargets = new ChangeTrackingList(); + ExportRouteTargets = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Route Targets to be applied for incoming routes into CE. This is for backward compatibility. + /// Route Targets to be applied for outgoing routes from CE. This is for backward compatibility. + /// Route Targets to be applied. + /// Keeps track of any properties unknown to the library. + internal VpnOptionBPatchProperties(IList importRouteTargets, IList exportRouteTargets, RouteTargetPatchInformation routeTargets, IDictionary serializedAdditionalRawData) + { + ImportRouteTargets = importRouteTargets; + ExportRouteTargets = exportRouteTargets; + RouteTargets = routeTargets; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Route Targets to be applied for incoming routes into CE. This is for backward compatibility. + public IList ImportRouteTargets { get; } + /// Route Targets to be applied for outgoing routes from CE. This is for backward compatibility. + public IList ExportRouteTargets { get; } + /// Route Targets to be applied. + public RouteTargetPatchInformation RouteTargets { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBProperties.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionBProperties.Serialization.cs similarity index 74% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBProperties.Serialization.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionBProperties.Serialization.cs index 6995641b173a..82d440399cc9 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBProperties.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionBProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { - public partial class OptionBProperties : IUtf8JsonSerializable, IJsonModel + public partial class VpnOptionBProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OptionBProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(VpnOptionBProperties)} does not support writing '{format}' format."); } if (Optional.IsCollectionDefined(ImportRouteTargets)) @@ -76,19 +76,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - OptionBProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + VpnOptionBProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OptionBProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(VpnOptionBProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeOptionBProperties(document.RootElement, options); + return DeserializeVpnOptionBProperties(document.RootElement, options); } - internal static OptionBProperties DeserializeOptionBProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static VpnOptionBProperties DeserializeVpnOptionBProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -146,38 +146,38 @@ internal static OptionBProperties DeserializeOptionBProperties(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new OptionBProperties(importRouteTargets ?? new ChangeTrackingList(), exportRouteTargets ?? new ChangeTrackingList(), routeTargets, serializedAdditionalRawData); + return new VpnOptionBProperties(importRouteTargets ?? new ChangeTrackingList(), exportRouteTargets ?? new ChangeTrackingList(), routeTargets, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); default: - throw new FormatException($"The model {nameof(OptionBProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(VpnOptionBProperties)} does not support writing '{options.Format}' format."); } } - OptionBProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + VpnOptionBProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeOptionBProperties(document.RootElement, options); + return DeserializeVpnOptionBProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(OptionBProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(VpnOptionBProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBProperties.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionBProperties.cs similarity index 86% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBProperties.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionBProperties.cs index 53b7e90ba651..49db31783d2d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/OptionBProperties.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/VpnOptionBProperties.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// Option B configuration to be used for Management VPN. - public partial class OptionBProperties + public partial class VpnOptionBProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,19 +45,19 @@ public partial class OptionBProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public OptionBProperties() + /// Initializes a new instance of . + public VpnOptionBProperties() { ImportRouteTargets = new ChangeTrackingList(); ExportRouteTargets = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Route Targets to be applied for incoming routes into CE. This is for backward compatibility. /// Route Targets to be applied for outgoing routes from CE. This is for backward compatibility. /// Route Targets to be applied. /// Keeps track of any properties unknown to the library. - internal OptionBProperties(IList importRouteTargets, IList exportRouteTargets, RouteTargetInformation routeTargets, IDictionary serializedAdditionalRawData) + internal VpnOptionBProperties(IList importRouteTargets, IList exportRouteTargets, RouteTargetInformation routeTargets, IDictionary serializedAdditionalRawData) { ImportRouteTargets = importRouteTargets; ExportRouteTargets = exportRouteTargets; diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/WellKnownCommunity.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/WellKnownCommunity.cs index bd6b92788d0a..76e710cc5120 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/WellKnownCommunity.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Models/WellKnownCommunity.cs @@ -12,11 +12,10 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models { /// /// `Internet` - Advertise routes to internet community. - /// `LocalAS` - Advertise routes to only localAS peers. - /// `NoAdvertise` - Don't advertise routes to any peer. + /// `LocalAS` - Advertise routes to only localAS peers. + /// `NoAdvertise` - Don't advertise routes to any peer. /// `NoExport` - Don't export to next AS. /// `GShut` - Graceful Shutdown (GSHUT) withdraw routes before terminating BGP connection. - /// /// public readonly partial struct WellKnownCommunity : IEquatable { @@ -35,15 +34,15 @@ public WellKnownCommunity(string value) private const string NoExportValue = "NoExport"; private const string GShutValue = "GShut"; - /// Internet. + /// WellKnownCommunities-Internet. public static WellKnownCommunity Internet { get; } = new WellKnownCommunity(InternetValue); - /// LocalAS. + /// WellKnownCommunities-LocalAS. public static WellKnownCommunity LocalAS { get; } = new WellKnownCommunity(LocalASValue); - /// NoAdvertise. + /// WellKnownCommunities-NoAdvertise. public static WellKnownCommunity NoAdvertise { get; } = new WellKnownCommunity(NoAdvertiseValue); - /// NoExport. + /// WellKnownCommunities-NoExport. public static WellKnownCommunity NoExport { get; } = new WellKnownCommunity(NoExportValue); - /// GShut. + /// WellKnownCommunities-GShut. public static WellKnownCommunity GShut { get; } = new WellKnownCommunity(GShutValue); /// Determines if two values are the same. public static bool operator ==(WellKnownCommunity left, WellKnownCommunity right) => left.Equals(right); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceCollection.cs index 0e9d7061958c..22c69cfeed8f 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsy /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wait /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string netwo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string networkDeviceName, Can /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToke /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancella /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string networkDeviceName, /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string networkDeviceName, CancellationToken /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsAs /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceData.Serialization.cs index 17f1bf61b27a..3117544368e3 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceData.Serialization.cs @@ -51,11 +51,8 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("hostName"u8); writer.WriteStringValue(HostName); } - if (Optional.IsDefined(SerialNumber)) - { - writer.WritePropertyName("serialNumber"u8); - writer.WriteStringValue(SerialNumber); - } + writer.WritePropertyName("serialNumber"u8); + writer.WriteStringValue(SerialNumber); if (options.Format != "W" && Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -86,6 +83,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("managementIpv6Address"u8); writer.WriteStringValue(ManagementIPv6Address); } + if (options.Format != "W" && Optional.IsDefined(RwDeviceConfig)) + { + writer.WritePropertyName("rwDeviceConfig"u8); + writer.WriteStringValue(RwDeviceConfig); + } + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) { writer.WritePropertyName("configurationState"u8); @@ -139,6 +146,8 @@ internal static NetworkDeviceData DeserializeNetworkDeviceData(JsonElement eleme ResourceIdentifier networkRackId = default; IPAddress managementIPv4Address = default; string managementIPv6Address = default; + string rwDeviceConfig = default; + LastOperationProperties lastOperation = default; NetworkFabricConfigurationState? configurationState = default; NetworkFabricProvisioningState? provisioningState = default; NetworkFabricAdministrativeState? administrativeState = default; @@ -255,6 +264,20 @@ internal static NetworkDeviceData DeserializeNetworkDeviceData(JsonElement eleme managementIPv6Address = property0.Value.GetString(); continue; } + if (property0.NameEquals("rwDeviceConfig"u8)) + { + rwDeviceConfig = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("lastOperation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property0.Value, options); + continue; + } if (property0.NameEquals("configurationState"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -307,6 +330,8 @@ internal static NetworkDeviceData DeserializeNetworkDeviceData(JsonElement eleme networkRackId, managementIPv4Address, managementIPv6Address, + rwDeviceConfig, + lastOperation, configurationState, provisioningState, administrativeState, diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceData.cs index 2fe5efb34de4..86aec88c3da7 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceData.cs @@ -54,8 +54,13 @@ public partial class NetworkDeviceData : TrackedResourceData /// Initializes a new instance of . /// The location. - public NetworkDeviceData(AzureLocation location) : base(location) + /// Serial number of the device. Format of serial Number - Make;Model;HardwareRevisionId;SerialNumber. + /// is null. + public NetworkDeviceData(AzureLocation location, string serialNumber) : base(location) { + Argument.AssertNotNull(serialNumber, nameof(serialNumber)); + + SerialNumber = serialNumber; } /// Initializes a new instance of . @@ -74,11 +79,13 @@ public NetworkDeviceData(AzureLocation location) : base(location) /// Reference to network rack resource id. /// Management IPv4 Address. /// Management IPv6 Address. + /// User configured read-write configuration applied on the network devices. + /// Details of the last operation performed on the resource. /// Configuration state of the resource. /// Provisioning state of the resource. /// Administrative state of the resource. /// Keeps track of any properties unknown to the library. - internal NetworkDeviceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, string hostName, string serialNumber, string version, string networkDeviceSku, NetworkDeviceRole? networkDeviceRole, ResourceIdentifier networkRackId, IPAddress managementIPv4Address, string managementIPv6Address, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NetworkDeviceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, string hostName, string serialNumber, string version, string networkDeviceSku, NetworkDeviceRole? networkDeviceRole, ResourceIdentifier networkRackId, IPAddress managementIPv4Address, string managementIPv6Address, string rwDeviceConfig, LastOperationProperties lastOperation, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Annotation = annotation; HostName = hostName; @@ -89,6 +96,8 @@ internal NetworkDeviceData(ResourceIdentifier id, string name, ResourceType reso NetworkRackId = networkRackId; ManagementIPv4Address = managementIPv4Address; ManagementIPv6Address = managementIPv6Address; + RwDeviceConfig = rwDeviceConfig; + LastOperation = lastOperation; ConfigurationState = configurationState; ProvisioningState = provisioningState; AdministrativeState = administrativeState; @@ -118,6 +127,16 @@ internal NetworkDeviceData() public IPAddress ManagementIPv4Address { get; } /// Management IPv6 Address. public string ManagementIPv6Address { get; } + /// User configured read-write configuration applied on the network devices. + public string RwDeviceConfig { get; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + /// Configuration state of the resource. public NetworkFabricConfigurationState? ConfigurationState { get; } /// Provisioning state of the resource. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceInterfaceCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceInterfaceCollection.cs index f7a0cb74cf1b..7cb3c1b7ef45 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceInterfaceCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceInterfaceCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOr /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitU /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(str /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string networkInterf /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string networkInterfaceNam /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string networkInterfaceName, CancellationTo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetI /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceInterfaceData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceInterfaceData.Serialization.cs index e4f3c28ac61a..1a3dda785e9d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceInterfaceData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceInterfaceData.Serialization.cs @@ -71,6 +71,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("ipv6Address"u8); writer.WriteStringValue(IPv6Address); } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(AdditionalDescription)) + { + writer.WritePropertyName("additionalDescription"u8); + writer.WriteStringValue(AdditionalDescription); + } + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -114,6 +129,9 @@ internal static NetworkDeviceInterfaceData DeserializeNetworkDeviceInterfaceData NetworkDeviceInterfaceType? interfaceType = default; IPAddress ipv4Address = default; string ipv6Address = default; + string description = default; + string additionalDescription = default; + LastOperationProperties lastOperation = default; NetworkFabricProvisioningState? provisioningState = default; NetworkFabricAdministrativeState? administrativeState = default; IDictionary serializedAdditionalRawData = default; @@ -191,6 +209,25 @@ internal static NetworkDeviceInterfaceData DeserializeNetworkDeviceInterfaceData ipv6Address = property0.Value.GetString(); continue; } + if (property0.NameEquals("description"u8)) + { + description = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("additionalDescription"u8)) + { + additionalDescription = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("lastOperation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property0.Value, options); + continue; + } if (property0.NameEquals("provisioningState"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -229,6 +266,9 @@ internal static NetworkDeviceInterfaceData DeserializeNetworkDeviceInterfaceData interfaceType, ipv4Address, ipv6Address, + description, + additionalDescription, + lastOperation, provisioningState, administrativeState, serializedAdditionalRawData); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceInterfaceData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceInterfaceData.cs index f55037ecec26..94e52d615fd9 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceInterfaceData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceInterfaceData.cs @@ -68,10 +68,13 @@ public NetworkDeviceInterfaceData() /// The Interface Type. Example: Management/Data. /// IPv4Address of the interface. /// IPv6Address of the interface. + /// Description of the interface. + /// Additional description of the interface. + /// Details of the last operation performed on the resource. /// Provisioning state of the resource. /// Administrative state of the resource. /// Keeps track of any properties unknown to the library. - internal NetworkDeviceInterfaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string annotation, string physicalIdentifier, string connectedTo, NetworkDeviceInterfaceType? interfaceType, IPAddress ipv4Address, string ipv6Address, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal NetworkDeviceInterfaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string annotation, string physicalIdentifier, string connectedTo, NetworkDeviceInterfaceType? interfaceType, IPAddress ipv4Address, string ipv6Address, string description, string additionalDescription, LastOperationProperties lastOperation, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Annotation = annotation; PhysicalIdentifier = physicalIdentifier; @@ -79,6 +82,9 @@ internal NetworkDeviceInterfaceData(ResourceIdentifier id, string name, Resource InterfaceType = interfaceType; IPv4Address = ipv4Address; IPv6Address = ipv6Address; + Description = description; + AdditionalDescription = additionalDescription; + LastOperation = lastOperation; ProvisioningState = provisioningState; AdministrativeState = administrativeState; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -96,6 +102,18 @@ internal NetworkDeviceInterfaceData(ResourceIdentifier id, string name, Resource public IPAddress IPv4Address { get; } /// IPv6Address of the interface. public string IPv6Address { get; } + /// Description of the interface. + public string Description { get; set; } + /// Additional description of the interface. + public string AdditionalDescription { get; set; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + /// Provisioning state of the resource. public NetworkFabricProvisioningState? ProvisioningState { get; } /// Administrative state of the resource. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceInterfaceResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceInterfaceResource.cs index 3d18c7181cde..0b318c11d6e1 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceInterfaceResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceInterfaceResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Can /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken ca /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAs /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -358,7 +358,7 @@ public virtual ArmOperation Update(WaitUntil wai /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -404,7 +404,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceResource.cs index a0c4a61ed1d6..0fe3a910a645 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceResource.cs @@ -110,7 +110,7 @@ public virtual NetworkDeviceInterfaceCollection GetNetworkDeviceInterfaces() /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetNetworkDe /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -172,7 +172,7 @@ public virtual Response GetNetworkDeviceInterfac /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(Cancellation /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(CancellationToken cancellatio /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -336,7 +336,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -382,7 +382,7 @@ public virtual async Task> UpdateAsync(WaitU /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -428,7 +428,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, N /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -474,7 +474,7 @@ public virtual async Task> Reboo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -520,7 +520,7 @@ public virtual ArmOperation Reboot(WaitUntil /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -562,7 +562,7 @@ public virtual async Task> Refre /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -591,6 +591,190 @@ public virtual ArmOperation RefreshConfigurat } } + /// + /// Run the RO Command on the Network Device. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/runRoCommand + /// + /// + /// Operation Id + /// NetworkDevices_RunRoCommand + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request the command. + /// The cancellation token to use. + /// is null. + public virtual async Task> RunRoCommandAsync(WaitUntil waitUntil, DeviceRoCommand body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _networkDeviceClientDiagnostics.CreateScope("NetworkDeviceResource.RunRoCommand"); + scope.Start(); + try + { + var response = await _networkDeviceRestClient.RunRoCommandAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new CommonPostActionResponseForDeviceROCommandsOperationStatusResultOperationSource(), _networkDeviceClientDiagnostics, Pipeline, _networkDeviceRestClient.CreateRunRoCommandRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Run the RO Command on the Network Device. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/runRoCommand + /// + /// + /// Operation Id + /// NetworkDevices_RunRoCommand + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request the command. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation RunRoCommand(WaitUntil waitUntil, DeviceRoCommand body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _networkDeviceClientDiagnostics.CreateScope("NetworkDeviceResource.RunRoCommand"); + scope.Start(); + try + { + var response = _networkDeviceRestClient.RunRoCommand(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new CommonPostActionResponseForDeviceROCommandsOperationStatusResultOperationSource(), _networkDeviceClientDiagnostics, Pipeline, _networkDeviceRestClient.CreateRunRoCommandRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Run the RW Command on the Network Device. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/runRwCommand + /// + /// + /// Operation Id + /// NetworkDevices_RunRwCommand + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request the command. + /// The cancellation token to use. + /// is null. + public virtual async Task> RunRwCommandAsync(WaitUntil waitUntil, DeviceRwCommand body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _networkDeviceClientDiagnostics.CreateScope("NetworkDeviceResource.RunRwCommand"); + scope.Start(); + try + { + var response = await _networkDeviceRestClient.RunRwCommandAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new CommonPostActionResponseForDeviceRWCommandsOperationSource(), _networkDeviceClientDiagnostics, Pipeline, _networkDeviceRestClient.CreateRunRwCommandRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Run the RW Command on the Network Device. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/runRwCommand + /// + /// + /// Operation Id + /// NetworkDevices_RunRwCommand + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request the command. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation RunRwCommand(WaitUntil waitUntil, DeviceRwCommand body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _networkDeviceClientDiagnostics.CreateScope("NetworkDeviceResource.RunRwCommand"); + scope.Start(); + try + { + var response = _networkDeviceRestClient.RunRwCommand(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new CommonPostActionResponseForDeviceRWCommandsOperationSource(), _networkDeviceClientDiagnostics, Pipeline, _networkDeviceRestClient.CreateRunRwCommandRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Updates the Administrative state of the Network Device. /// @@ -604,7 +788,7 @@ public virtual ArmOperation RefreshConfigurat /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -650,7 +834,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -696,7 +880,7 @@ public virtual ArmOperation UpdateAdministrat /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -742,7 +926,7 @@ public virtual async Task> Upgra /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -788,7 +972,7 @@ public virtual ArmOperation Upgrade(WaitUntil /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -850,7 +1034,7 @@ public virtual async Task> AddTagAsync(string ke /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -912,7 +1096,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -969,7 +1153,7 @@ public virtual async Task> SetTagsAsync(IDiction /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1026,7 +1210,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1086,7 +1270,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceSkuCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceSkuCollection.cs index 55438b44e27e..7e9ccee10ffe 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceSkuCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceSkuCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -110,7 +110,7 @@ public virtual async Task> GetAsync(string ne /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -155,7 +155,7 @@ public virtual Response Get(string networkDeviceSkuNam /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -185,7 +185,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -215,7 +215,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -258,7 +258,7 @@ public virtual async Task> ExistsAsync(string networkDeviceSkuNam /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -301,7 +301,7 @@ public virtual Response Exists(string networkDeviceSkuName, CancellationTo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -346,7 +346,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceSkuResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceSkuResource.cs index 5acb0236c157..0ff9ba9ac93c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceSkuResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceSkuResource.cs @@ -100,7 +100,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -140,7 +140,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListCollection.cs index 079271d29f74..bca927fc58d7 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string acces /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string accessControlListNa /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string accessControlListName, CancellationT /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListData.Serialization.cs index d92c04595e0b..5ca5fe704018 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListData.Serialization.cs @@ -85,6 +85,26 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("lastSyncedTime"u8); writer.WriteStringValue(LastSyncedOn.Value, "O"); } + if (Optional.IsDefined(AclType)) + { + writer.WritePropertyName("aclType"u8); + writer.WriteStringValue(AclType.Value.ToString()); + } + if (Optional.IsDefined(DeviceRole)) + { + writer.WritePropertyName("deviceRole"u8); + writer.WriteStringValue(DeviceRole.Value.ToString()); + } + if (Optional.IsDefined(GlobalAccessControlListActions)) + { + writer.WritePropertyName("globalAccessControlListActions"u8); + writer.WriteObjectValue(GlobalAccessControlListActions, options); + } + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) { writer.WritePropertyName("configurationState"u8); @@ -136,6 +156,10 @@ internal static NetworkFabricAccessControlListData DeserializeNetworkFabricAcces IList matchConfigurations = default; IList dynamicMatchConfigurations = default; DateTimeOffset? lastSyncedTime = default; + AclType? aclType = default; + DeviceRole? deviceRole = default; + GlobalAccessControlListActionProperties globalAccessControlListActions = default; + LastOperationProperties lastOperation = default; NetworkFabricConfigurationState? configurationState = default; NetworkFabricProvisioningState? provisioningState = default; NetworkFabricAdministrativeState? administrativeState = default; @@ -264,6 +288,42 @@ internal static NetworkFabricAccessControlListData DeserializeNetworkFabricAcces lastSyncedTime = property0.Value.GetDateTimeOffset("O"); continue; } + if (property0.NameEquals("aclType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + aclType = new AclType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("deviceRole"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deviceRole = new DeviceRole(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("globalAccessControlListActions"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + globalAccessControlListActions = GlobalAccessControlListActionProperties.DeserializeGlobalAccessControlListActionProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("lastOperation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property0.Value, options); + continue; + } if (property0.NameEquals("configurationState"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -314,6 +374,10 @@ internal static NetworkFabricAccessControlListData DeserializeNetworkFabricAcces matchConfigurations ?? new ChangeTrackingList(), dynamicMatchConfigurations ?? new ChangeTrackingList(), lastSyncedTime, + aclType, + deviceRole, + globalAccessControlListActions, + lastOperation, configurationState, provisioningState, administrativeState, diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListData.cs index dcafdc1971af..c004506a0aae 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListData.cs @@ -73,11 +73,15 @@ public NetworkFabricAccessControlListData(AzureLocation location) : base(locatio /// List of match configurations. /// List of dynamic match configurations. /// The last synced timestamp. + /// Access Control List (ACL) Type. + /// Device Role. + /// Global Access Control List (ACL) actions. + /// Details of the last operation performed on the resource. /// Configuration state of the resource. /// Provisioning state of the resource. /// Administrative state of the resource. /// Keeps track of any properties unknown to the library. - internal NetworkFabricAccessControlListData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, NetworkFabricConfigurationType? configurationType, Uri aclsUri, CommunityActionType? defaultAction, IList matchConfigurations, IList dynamicMatchConfigurations, DateTimeOffset? lastSyncedOn, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NetworkFabricAccessControlListData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, NetworkFabricConfigurationType? configurationType, Uri aclsUri, CommunityActionType? defaultAction, IList matchConfigurations, IList dynamicMatchConfigurations, DateTimeOffset? lastSyncedOn, AclType? aclType, DeviceRole? deviceRole, GlobalAccessControlListActionProperties globalAccessControlListActions, LastOperationProperties lastOperation, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Annotation = annotation; ConfigurationType = configurationType; @@ -86,6 +90,10 @@ internal NetworkFabricAccessControlListData(ResourceIdentifier id, string name, MatchConfigurations = matchConfigurations; DynamicMatchConfigurations = dynamicMatchConfigurations; LastSyncedOn = lastSyncedOn; + AclType = aclType; + DeviceRole = deviceRole; + GlobalAccessControlListActions = globalAccessControlListActions; + LastOperation = lastOperation; ConfigurationState = configurationState; ProvisioningState = provisioningState; AdministrativeState = administrativeState; @@ -111,6 +119,32 @@ internal NetworkFabricAccessControlListData() public IList DynamicMatchConfigurations { get; } /// The last synced timestamp. public DateTimeOffset? LastSyncedOn { get; } + /// Access Control List (ACL) Type. + public AclType? AclType { get; set; } + /// Device Role. + public DeviceRole? DeviceRole { get; set; } + /// Global Access Control List (ACL) actions. + internal GlobalAccessControlListActionProperties GlobalAccessControlListActions { get; set; } + /// Configuration to enable or disable ACL action count. + public NetworkFabricBooleanValue? GlobalAccessControlListActionsEnableCount + { + get => GlobalAccessControlListActions is null ? default : GlobalAccessControlListActions.EnableCount; + set + { + if (GlobalAccessControlListActions is null) + GlobalAccessControlListActions = new GlobalAccessControlListActionProperties(); + GlobalAccessControlListActions.EnableCount = value; + } + } + + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + /// Configuration state of the resource. public NetworkFabricConfigurationState? ConfigurationState { get; } /// Provisioning state of the resource. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListResource.cs index 30b4f0f87ba3..51659b7915f2 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricAccessControlListResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -200,7 +200,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell try { var response = await _networkFabricAccessControlListAccessControlListsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(_networkFabricAccessControlListAccessControlListsClientDiagnostics, Pipeline, _networkFabricAccessControlListAccessControlListsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ManagedNetworkFabricArmOperation(_networkFabricAccessControlListAccessControlListsClientDiagnostics, Pipeline, _networkFabricAccessControlListAccessControlListsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -242,7 +242,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel try { var response = _networkFabricAccessControlListAccessControlListsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(_networkFabricAccessControlListAccessControlListsClientDiagnostics, Pipeline, _networkFabricAccessControlListAccessControlListsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ManagedNetworkFabricArmOperation(_networkFabricAccessControlListAccessControlListsClientDiagnostics, Pipeline, _networkFabricAccessControlListAccessControlListsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -351,15 +351,15 @@ public virtual ArmOperation Update(WaitU /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/updateAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/resync /// /// /// Operation Id - /// AccessControlLists_UpdateAdministrativeState + /// AccessControlLists_Resync /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -368,19 +368,15 @@ public virtual ArmOperation Update(WaitU /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Request payload. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual async Task> ResyncAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _networkFabricAccessControlListAccessControlListsClientDiagnostics.CreateScope("NetworkFabricAccessControlListResource.UpdateAdministrativeState"); + using var scope = _networkFabricAccessControlListAccessControlListsClientDiagnostics.CreateScope("NetworkFabricAccessControlListResource.Resync"); scope.Start(); try { - var response = await _networkFabricAccessControlListAccessControlListsRestClient.UpdateAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricAccessControlListAccessControlListsClientDiagnostics, Pipeline, _networkFabricAccessControlListAccessControlListsRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricAccessControlListAccessControlListsRestClient.ResyncAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricAccessControlListAccessControlListsClientDiagnostics, Pipeline, _networkFabricAccessControlListAccessControlListsRestClient.CreateResyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -397,15 +393,15 @@ public virtual async Task> Updat /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/updateAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/resync /// /// /// Operation Id - /// AccessControlLists_UpdateAdministrativeState + /// AccessControlLists_Resync /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -414,19 +410,15 @@ public virtual async Task> Updat /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Request payload. /// The cancellation token to use. - /// is null. - public virtual ArmOperation UpdateAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation Resync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _networkFabricAccessControlListAccessControlListsClientDiagnostics.CreateScope("NetworkFabricAccessControlListResource.UpdateAdministrativeState"); + using var scope = _networkFabricAccessControlListAccessControlListsClientDiagnostics.CreateScope("NetworkFabricAccessControlListResource.Resync"); scope.Start(); try { - var response = _networkFabricAccessControlListAccessControlListsRestClient.UpdateAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricAccessControlListAccessControlListsClientDiagnostics, Pipeline, _networkFabricAccessControlListAccessControlListsRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricAccessControlListAccessControlListsRestClient.Resync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricAccessControlListAccessControlListsClientDiagnostics, Pipeline, _networkFabricAccessControlListAccessControlListsRestClient.CreateResyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -443,15 +435,15 @@ public virtual ArmOperation UpdateAdministrat /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/resync + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/updateAdministrativeState /// /// /// Operation Id - /// AccessControlLists_Resync + /// AccessControlLists_UpdateAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -460,15 +452,19 @@ public virtual ArmOperation UpdateAdministrat /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. /// The cancellation token to use. - public virtual async Task> ResyncAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { - using var scope = _networkFabricAccessControlListAccessControlListsClientDiagnostics.CreateScope("NetworkFabricAccessControlListResource.Resync"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkFabricAccessControlListAccessControlListsClientDiagnostics.CreateScope("NetworkFabricAccessControlListResource.UpdateAdministrativeState"); scope.Start(); try { - var response = await _networkFabricAccessControlListAccessControlListsRestClient.ResyncAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricAccessControlListAccessControlListsClientDiagnostics, Pipeline, _networkFabricAccessControlListAccessControlListsRestClient.CreateResyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricAccessControlListAccessControlListsRestClient.UpdateAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricAccessControlListAccessControlListsClientDiagnostics, Pipeline, _networkFabricAccessControlListAccessControlListsRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -485,15 +481,15 @@ public virtual async Task> Resyn /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/resync + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/updateAdministrativeState /// /// /// Operation Id - /// AccessControlLists_Resync + /// AccessControlLists_UpdateAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -502,15 +498,19 @@ public virtual async Task> Resyn /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. /// The cancellation token to use. - public virtual ArmOperation Resync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation UpdateAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { - using var scope = _networkFabricAccessControlListAccessControlListsClientDiagnostics.CreateScope("NetworkFabricAccessControlListResource.Resync"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkFabricAccessControlListAccessControlListsClientDiagnostics.CreateScope("NetworkFabricAccessControlListResource.UpdateAdministrativeState"); scope.Start(); try { - var response = _networkFabricAccessControlListAccessControlListsRestClient.Resync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricAccessControlListAccessControlListsClientDiagnostics, Pipeline, _networkFabricAccessControlListAccessControlListsRestClient.CreateResyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricAccessControlListAccessControlListsRestClient.UpdateAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricAccessControlListAccessControlListsClientDiagnostics, Pipeline, _networkFabricAccessControlListAccessControlListsRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -535,7 +535,7 @@ public virtual ArmOperation Resync(WaitUntil /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -577,7 +577,7 @@ public virtual async Task> ValidateCon /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -619,7 +619,7 @@ public virtual ArmOperation ValidateConfiguration(W /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -681,7 +681,7 @@ public virtual async Task> AddT /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -743,7 +743,7 @@ public virtual Response AddTag(string ke /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -800,7 +800,7 @@ public virtual async Task> SetT /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -857,7 +857,7 @@ public virtual Response SetTags(IDiction /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -917,7 +917,7 @@ public virtual async Task> Remo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricCollection.cs index 74cff16622fc..ff71845198a6 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsy /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wait /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string netwo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string networkFabricName, Can /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToke /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancella /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string networkFabricName, /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string networkFabricName, CancellationToken /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsAs /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricControllerCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricControllerCollection.cs index 56f79ace0fa2..5f3fc22218da 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricControllerCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricControllerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateO /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wait /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string networkFabri /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToke /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string networkFabricContro /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string networkFabricControllerName, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricControllerData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricControllerData.Serialization.cs index e58c390aa279..c1c699e7984e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricControllerData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricControllerData.Serialization.cs @@ -95,11 +95,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } - if (options.Format != "W" && Optional.IsDefined(IsWorkloadManagementNetwork)) - { - writer.WritePropertyName("workloadManagementNetwork"u8); - writer.WriteBooleanValue(IsWorkloadManagementNetwork.Value); - } if (Optional.IsDefined(IsWorkloadManagementNetworkEnabled)) { writer.WritePropertyName("isWorkloadManagementNetworkEnabled"u8); @@ -135,6 +130,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("nfcSku"u8); writer.WriteStringValue(NfcSku.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -176,12 +176,12 @@ internal static NetworkFabricControllerData DeserializeNetworkFabricControllerDa NetworkFabricControllerServices workloadServices = default; ManagedResourceGroupConfiguration managedResourceGroupConfiguration = default; IReadOnlyList networkFabricIds = default; - bool? workloadManagementNetwork = default; IsWorkloadManagementNetworkEnabled? isWorkloadManagementNetworkEnabled = default; IReadOnlyList tenantInternetGatewayIds = default; string ipv4AddressSpace = default; string ipv6AddressSpace = default; NetworkFabricControllerSKU? nfcSku = default; + LastOperationProperties lastOperation = default; NetworkFabricProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -320,15 +320,6 @@ internal static NetworkFabricControllerData DeserializeNetworkFabricControllerDa networkFabricIds = array; continue; } - if (property0.NameEquals("workloadManagementNetwork"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - workloadManagementNetwork = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("isWorkloadManagementNetworkEnabled"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -378,6 +369,15 @@ internal static NetworkFabricControllerData DeserializeNetworkFabricControllerDa nfcSku = new NetworkFabricControllerSKU(property0.Value.GetString()); continue; } + if (property0.NameEquals("lastOperation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property0.Value, options); + continue; + } if (property0.NameEquals("provisioningState"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -410,12 +410,12 @@ internal static NetworkFabricControllerData DeserializeNetworkFabricControllerDa workloadServices, managedResourceGroupConfiguration, networkFabricIds ?? new ChangeTrackingList(), - workloadManagementNetwork, isWorkloadManagementNetworkEnabled, tenantInternetGatewayIds ?? new ChangeTrackingList(), ipv4AddressSpace, ipv6AddressSpace, nfcSku, + lastOperation, provisioningState, serializedAdditionalRawData); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricControllerData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricControllerData.cs index 0f8051117bef..e5b782f99cc1 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricControllerData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricControllerData.cs @@ -75,15 +75,15 @@ public NetworkFabricControllerData(AzureLocation location) : base(location) /// WorkloadServices IP ranges. /// Managed Resource Group configuration properties. /// The NF-ID will be an input parameter used by the NF to link and get associated with the parent NFC Service. - /// A workload management network is required for all the tenant (workload) traffic. This traffic is only dedicated for Tenant workloads which are required to access internet or any other MSFT/Public endpoints. This is used for the backward compatibility. /// A workload management network is required for all the tenant (workload) traffic. This traffic is only dedicated for Tenant workloads which are required to access internet or any other MSFT/Public endpoints. /// List of tenant InternetGateway resource IDs. /// IPv4 Network Fabric Controller Address Space. /// IPv6 Network Fabric Controller Address Space. /// Network Fabric Controller SKU. + /// Details of the last operation performed on the resource. /// Provides you the latest status of the NFC service, whether it is Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on the status of NFC provisioning. /// Keeps track of any properties unknown to the library. - internal NetworkFabricControllerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, IList infrastructureExpressRouteConnections, IList workloadExpressRouteConnections, NetworkFabricControllerServices infrastructureServices, NetworkFabricControllerServices workloadServices, ManagedResourceGroupConfiguration managedResourceGroupConfiguration, IReadOnlyList networkFabricIds, bool? isWorkloadManagementNetwork, IsWorkloadManagementNetworkEnabled? isWorkloadManagementNetworkEnabled, IReadOnlyList tenantInternetGatewayIds, string ipv4AddressSpace, string ipv6AddressSpace, NetworkFabricControllerSKU? nfcSku, NetworkFabricProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NetworkFabricControllerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, IList infrastructureExpressRouteConnections, IList workloadExpressRouteConnections, NetworkFabricControllerServices infrastructureServices, NetworkFabricControllerServices workloadServices, ManagedResourceGroupConfiguration managedResourceGroupConfiguration, IReadOnlyList networkFabricIds, IsWorkloadManagementNetworkEnabled? isWorkloadManagementNetworkEnabled, IReadOnlyList tenantInternetGatewayIds, string ipv4AddressSpace, string ipv6AddressSpace, NetworkFabricControllerSKU? nfcSku, LastOperationProperties lastOperation, NetworkFabricProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Annotation = annotation; InfrastructureExpressRouteConnections = infrastructureExpressRouteConnections; @@ -92,12 +92,12 @@ internal NetworkFabricControllerData(ResourceIdentifier id, string name, Resourc WorkloadServices = workloadServices; ManagedResourceGroupConfiguration = managedResourceGroupConfiguration; NetworkFabricIds = networkFabricIds; - IsWorkloadManagementNetwork = isWorkloadManagementNetwork; IsWorkloadManagementNetworkEnabled = isWorkloadManagementNetworkEnabled; TenantInternetGatewayIds = tenantInternetGatewayIds; IPv4AddressSpace = ipv4AddressSpace; IPv6AddressSpace = ipv6AddressSpace; NfcSku = nfcSku; + LastOperation = lastOperation; ProvisioningState = provisioningState; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -121,8 +121,6 @@ internal NetworkFabricControllerData() public ManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get; set; } /// The NF-ID will be an input parameter used by the NF to link and get associated with the parent NFC Service. public IReadOnlyList NetworkFabricIds { get; } - /// A workload management network is required for all the tenant (workload) traffic. This traffic is only dedicated for Tenant workloads which are required to access internet or any other MSFT/Public endpoints. This is used for the backward compatibility. - public bool? IsWorkloadManagementNetwork { get; } /// A workload management network is required for all the tenant (workload) traffic. This traffic is only dedicated for Tenant workloads which are required to access internet or any other MSFT/Public endpoints. public IsWorkloadManagementNetworkEnabled? IsWorkloadManagementNetworkEnabled { get; set; } /// List of tenant InternetGateway resource IDs. @@ -133,6 +131,14 @@ internal NetworkFabricControllerData() public string IPv6AddressSpace { get; set; } /// Network Fabric Controller SKU. public NetworkFabricControllerSKU? NfcSku { get; set; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + /// Provides you the latest status of the NFC service, whether it is Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on the status of NFC provisioning. public NetworkFabricProvisioningState? ProvisioningState { get; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricControllerResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricControllerResource.cs index 029511bfc11c..bd3dd3d082f6 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricControllerResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricControllerResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Ca /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken c /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateA /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUntil wa /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -421,7 +421,7 @@ public virtual async Task> AddTagAsync /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -483,7 +483,7 @@ public virtual Response AddTag(string key, stri /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -540,7 +540,7 @@ public virtual async Task> SetTagsAsyn /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -597,7 +597,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task> RemoveTagAs /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricData.Serialization.cs index 0165bc4f124e..29a03cde580e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricData.Serialization.cs @@ -38,6 +38,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + ((IJsonModel)Identity).Write(writer, ModelSerializationExtensions.WireV3Options); + } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Annotation)) @@ -47,7 +52,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WritePropertyName("networkFabricSku"u8); writer.WriteStringValue(NetworkFabricSku); - if (options.Format != "W" && Optional.IsDefined(FabricVersion)) + if (Optional.IsDefined(FabricVersion)) { writer.WritePropertyName("fabricVersion"u8); writer.WriteStringValue(FabricVersion); @@ -62,6 +67,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + if (Optional.IsDefined(StorageAccountConfiguration)) + { + writer.WritePropertyName("storageAccountConfiguration"u8); + writer.WriteObjectValue(StorageAccountConfiguration, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(FabricLocks)) + { + writer.WritePropertyName("fabricLocks"u8); + writer.WriteStartArray(); + foreach (var item in FabricLocks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } writer.WritePropertyName("networkFabricControllerId"u8); writer.WriteStringValue(NetworkFabricControllerId); if (Optional.IsDefined(RackCount)) @@ -114,6 +134,76 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + if (Optional.IsDefined(HardwareAlertThreshold)) + { + writer.WritePropertyName("hardwareAlertThreshold"u8); + writer.WriteNumberValue(HardwareAlertThreshold.Value); + } + if (Optional.IsCollectionDefined(ControlPlaneAcls)) + { + writer.WritePropertyName("controlPlaneAcls"u8); + writer.WriteStartArray(); + foreach (var item in ControlPlaneAcls) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(FeatureFlags)) + { + writer.WritePropertyName("featureFlags"u8); + writer.WriteStartArray(); + foreach (var item in FeatureFlags) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(TrustedIPPrefixes)) + { + writer.WritePropertyName("trustedIpPrefixes"u8); + writer.WriteStartArray(); + foreach (var item in TrustedIPPrefixes) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(UniqueRdConfiguration)) + { + writer.WritePropertyName("uniqueRdConfiguration"u8); + writer.WriteObjectValue(UniqueRdConfiguration, options); + } + if (Optional.IsDefined(StorageArrayCount)) + { + writer.WritePropertyName("storageArrayCount"u8); + writer.WriteNumberValue(StorageArrayCount.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ActiveCommitBatches)) + { + writer.WritePropertyName("activeCommitBatches"u8); + writer.WriteStartArray(); + foreach (var item in ActiveCommitBatches) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) { writer.WritePropertyName("configurationState"u8); @@ -152,6 +242,7 @@ internal static NetworkFabricData DeserializeNetworkFabricData(JsonElement eleme { return null; } + ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -162,6 +253,8 @@ internal static NetworkFabricData DeserializeNetworkFabricData(JsonElement eleme string networkFabricSku = default; string fabricVersion = default; IReadOnlyList routerIds = default; + StorageAccountConfiguration storageAccountConfiguration = default; + IReadOnlyList fabricLocks = default; ResourceIdentifier networkFabricControllerId = default; int? rackCount = default; int serverCountPerRack = default; @@ -173,6 +266,14 @@ internal static NetworkFabricData DeserializeNetworkFabricData(JsonElement eleme IReadOnlyList racks = default; IReadOnlyList l2IsolationDomains = default; IReadOnlyList l3IsolationDomains = default; + int? hardwareAlertThreshold = default; + IList controlPlaneAcls = default; + IReadOnlyList featureFlags = default; + IList trustedIPPrefixes = default; + UniqueRouteDistinguisherProperties uniqueRdConfiguration = default; + int? storageArrayCount = default; + IReadOnlyList activeCommitBatches = default; + LastOperationProperties lastOperation = default; NetworkFabricConfigurationState? configurationState = default; NetworkFabricProvisioningState? provisioningState = default; NetworkFabricAdministrativeState? administrativeState = default; @@ -180,6 +281,15 @@ internal static NetworkFabricData DeserializeNetworkFabricData(JsonElement eleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireV3Options, AzureResourceManagerManagedNetworkFabricContext.Default); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -261,6 +371,29 @@ internal static NetworkFabricData DeserializeNetworkFabricData(JsonElement eleme routerIds = array; continue; } + if (property0.NameEquals("storageAccountConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageAccountConfiguration = StorageAccountConfiguration.DeserializeStorageAccountConfiguration(property0.Value, options); + continue; + } + if (property0.NameEquals("fabricLocks"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(FabricLockProperties.DeserializeFabricLockProperties(item, options)); + } + fabricLocks = array; + continue; + } if (property0.NameEquals("networkFabricControllerId"u8)) { networkFabricControllerId = new ResourceIdentifier(property0.Value.GetString()); @@ -347,6 +480,112 @@ internal static NetworkFabricData DeserializeNetworkFabricData(JsonElement eleme l3IsolationDomains = array; continue; } + if (property0.NameEquals("hardwareAlertThreshold"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hardwareAlertThreshold = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("controlPlaneAcls"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + controlPlaneAcls = array; + continue; + } + if (property0.NameEquals("featureFlags"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(FeatureFlagProperties.DeserializeFeatureFlagProperties(item, options)); + } + featureFlags = array; + continue; + } + if (property0.NameEquals("trustedIpPrefixes"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + trustedIPPrefixes = array; + continue; + } + if (property0.NameEquals("uniqueRdConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uniqueRdConfiguration = UniqueRouteDistinguisherProperties.DeserializeUniqueRouteDistinguisherProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("storageArrayCount"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageArrayCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("activeCommitBatches"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + activeCommitBatches = array; + continue; + } + if (property0.NameEquals("lastOperation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property0.Value, options); + continue; + } if (property0.NameEquals("configurationState"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -390,10 +629,13 @@ internal static NetworkFabricData DeserializeNetworkFabricData(JsonElement eleme systemData, tags ?? new ChangeTrackingDictionary(), location, + identity, annotation, networkFabricSku, fabricVersion, routerIds ?? new ChangeTrackingList(), + storageAccountConfiguration, + fabricLocks ?? new ChangeTrackingList(), networkFabricControllerId, rackCount, serverCountPerRack, @@ -405,6 +647,14 @@ internal static NetworkFabricData DeserializeNetworkFabricData(JsonElement eleme racks ?? new ChangeTrackingList(), l2IsolationDomains ?? new ChangeTrackingList(), l3IsolationDomains ?? new ChangeTrackingList(), + hardwareAlertThreshold, + controlPlaneAcls ?? new ChangeTrackingList(), + featureFlags ?? new ChangeTrackingList(), + trustedIPPrefixes ?? new ChangeTrackingList(), + uniqueRdConfiguration, + storageArrayCount, + activeCommitBatches ?? new ChangeTrackingList(), + lastOperation, configurationState, provisioningState, administrativeState, diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricData.cs index 5edafdb92214..2bb4604c2f7b 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricData.cs @@ -71,6 +71,7 @@ public NetworkFabricData(AzureLocation location, string networkFabricSku, Resour NetworkFabricSku = networkFabricSku; RouterIds = new ChangeTrackingList(); + FabricLocks = new ChangeTrackingList(); NetworkFabricControllerId = networkFabricControllerId; ServerCountPerRack = serverCountPerRack; IPv4Prefix = ipv4Prefix; @@ -80,6 +81,10 @@ public NetworkFabricData(AzureLocation location, string networkFabricSku, Resour Racks = new ChangeTrackingList(); L2IsolationDomains = new ChangeTrackingList(); L3IsolationDomains = new ChangeTrackingList(); + ControlPlaneAcls = new ChangeTrackingList(); + FeatureFlags = new ChangeTrackingList(); + TrustedIPPrefixes = new ChangeTrackingList(); + ActiveCommitBatches = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -89,10 +94,13 @@ public NetworkFabricData(AzureLocation location, string networkFabricSku, Resour /// The systemData. /// The tags. /// The location. + /// The managed service identities assigned to this resource. /// Switch configuration description. /// Supported Network Fabric SKU.Example: Compute / Aggregate racks. Once the user chooses a particular SKU, only supported racks can be added to the Network Fabric. The SKU determines whether it is a single / multi rack Network Fabric. /// The version of Network Fabric. /// Array of router IDs. + /// Bring your own storage account configurations for Network Fabric. + /// Network Fabric Lock details. /// Azure resource ID for the NetworkFabricController the NetworkFabric belongs. /// Number of compute racks associated to Network Fabric. /// Number of servers.Possible values are from 1-16. @@ -104,16 +112,27 @@ public NetworkFabricData(AzureLocation location, string networkFabricSku, Resour /// List of NetworkRack resource IDs under the Network Fabric. The number of racks allowed depends on the Network Fabric SKU. /// List of L2 Isolation Domain resource IDs under the Network Fabric. /// List of L3 Isolation Domain resource IDs under the Network Fabric. + /// Hardware alert threshold percentage. Possible values are from 20 to 100. + /// Control Plane Access Control List ARM resource IDs. + /// Feature flag status information. + /// Trusted IP Prefixes ARM resource IDs. + /// Unique Route Distinguisher configuration. + /// Number of Storage arrays associated with the Network Fabric. + /// Active commit batch identifiers. + /// Details of the last operation performed on the resource. /// Configuration state of the resource. /// Provides you the latest status of the NFC service, whether it is Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on the status of NFC provisioning. /// Administrative state of the resource. /// Keeps track of any properties unknown to the library. - internal NetworkFabricData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, string networkFabricSku, string fabricVersion, IReadOnlyList routerIds, ResourceIdentifier networkFabricControllerId, int? rackCount, int serverCountPerRack, string ipv4Prefix, string ipv6Prefix, long fabricAsn, TerminalServerConfiguration terminalServerConfiguration, ManagementNetworkConfigurationProperties managementNetworkConfiguration, IReadOnlyList racks, IReadOnlyList l2IsolationDomains, IReadOnlyList l3IsolationDomains, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NetworkFabricData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string annotation, string networkFabricSku, string fabricVersion, IReadOnlyList routerIds, StorageAccountConfiguration storageAccountConfiguration, IReadOnlyList fabricLocks, ResourceIdentifier networkFabricControllerId, int? rackCount, int serverCountPerRack, string ipv4Prefix, string ipv6Prefix, long fabricAsn, TerminalServerConfiguration terminalServerConfiguration, ManagementNetworkConfigurationProperties managementNetworkConfiguration, IReadOnlyList racks, IReadOnlyList l2IsolationDomains, IReadOnlyList l3IsolationDomains, int? hardwareAlertThreshold, IList controlPlaneAcls, IReadOnlyList featureFlags, IList trustedIPPrefixes, UniqueRouteDistinguisherProperties uniqueRdConfiguration, int? storageArrayCount, IReadOnlyList activeCommitBatches, LastOperationProperties lastOperation, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { + Identity = identity; Annotation = annotation; NetworkFabricSku = networkFabricSku; FabricVersion = fabricVersion; RouterIds = routerIds; + StorageAccountConfiguration = storageAccountConfiguration; + FabricLocks = fabricLocks; NetworkFabricControllerId = networkFabricControllerId; RackCount = rackCount; ServerCountPerRack = serverCountPerRack; @@ -125,6 +144,14 @@ internal NetworkFabricData(ResourceIdentifier id, string name, ResourceType reso Racks = racks; L2IsolationDomains = l2IsolationDomains; L3IsolationDomains = l3IsolationDomains; + HardwareAlertThreshold = hardwareAlertThreshold; + ControlPlaneAcls = controlPlaneAcls; + FeatureFlags = featureFlags; + TrustedIPPrefixes = trustedIPPrefixes; + UniqueRdConfiguration = uniqueRdConfiguration; + StorageArrayCount = storageArrayCount; + ActiveCommitBatches = activeCommitBatches; + LastOperation = lastOperation; ConfigurationState = configurationState; ProvisioningState = provisioningState; AdministrativeState = administrativeState; @@ -136,14 +163,20 @@ internal NetworkFabricData() { } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } /// Switch configuration description. public string Annotation { get; set; } /// Supported Network Fabric SKU.Example: Compute / Aggregate racks. Once the user chooses a particular SKU, only supported racks can be added to the Network Fabric. The SKU determines whether it is a single / multi rack Network Fabric. public string NetworkFabricSku { get; set; } /// The version of Network Fabric. - public string FabricVersion { get; } + public string FabricVersion { get; set; } /// Array of router IDs. public IReadOnlyList RouterIds { get; } + /// Bring your own storage account configurations for Network Fabric. + public StorageAccountConfiguration StorageAccountConfiguration { get; set; } + /// Network Fabric Lock details. + public IReadOnlyList FabricLocks { get; } /// Azure resource ID for the NetworkFabricController the NetworkFabric belongs. public ResourceIdentifier NetworkFabricControllerId { get; set; } /// Number of compute racks associated to Network Fabric. @@ -166,6 +199,28 @@ internal NetworkFabricData() public IReadOnlyList L2IsolationDomains { get; } /// List of L3 Isolation Domain resource IDs under the Network Fabric. public IReadOnlyList L3IsolationDomains { get; } + /// Hardware alert threshold percentage. Possible values are from 20 to 100. + public int? HardwareAlertThreshold { get; set; } + /// Control Plane Access Control List ARM resource IDs. + public IList ControlPlaneAcls { get; } + /// Feature flag status information. + public IReadOnlyList FeatureFlags { get; } + /// Trusted IP Prefixes ARM resource IDs. + public IList TrustedIPPrefixes { get; } + /// Unique Route Distinguisher configuration. + public UniqueRouteDistinguisherProperties UniqueRdConfiguration { get; set; } + /// Number of Storage arrays associated with the Network Fabric. + public int? StorageArrayCount { get; set; } + /// Active commit batch identifiers. + public IReadOnlyList ActiveCommitBatches { get; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + /// Configuration state of the resource. public NetworkFabricConfigurationState? ConfigurationState { get; } /// Provides you the latest status of the NFC service, whether it is Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on the status of NFC provisioning. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricExternalNetworkCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricExternalNetworkCollection.cs index 6fc0e0da8ab2..f8ddcc660129 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricExternalNetworkCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricExternalNetworkCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string externa /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string externalNetworkName /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string externalNetworkName, CancellationTok /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricExternalNetworkData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricExternalNetworkData.Serialization.cs index 8e4187fa6d48..601caed6d208 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricExternalNetworkData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricExternalNetworkData.Serialization.cs @@ -45,15 +45,10 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("annotation"u8); writer.WriteStringValue(Annotation); } - if (Optional.IsDefined(ImportRoutePolicyId)) + if (Optional.IsDefined(NetworkToNetworkInterconnectId)) { - writer.WritePropertyName("importRoutePolicyId"u8); - writer.WriteStringValue(ImportRoutePolicyId); - } - if (Optional.IsDefined(ExportRoutePolicyId)) - { - writer.WritePropertyName("exportRoutePolicyId"u8); - writer.WriteStringValue(ExportRoutePolicyId); + writer.WritePropertyName("networkToNetworkInterconnectId"u8); + writer.WriteStringValue(NetworkToNetworkInterconnectId); } if (Optional.IsDefined(ImportRoutePolicy)) { @@ -65,11 +60,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("exportRoutePolicy"u8); writer.WriteObjectValue(ExportRoutePolicy, options); } - if (options.Format != "W" && Optional.IsDefined(NetworkToNetworkInterconnectId)) - { - writer.WritePropertyName("networkToNetworkInterconnectId"u8); - writer.WriteStringValue(NetworkToNetworkInterconnectId); - } writer.WritePropertyName("peeringOption"u8); writer.WriteStringValue(PeeringOption.ToString()); if (Optional.IsDefined(OptionBProperties)) @@ -82,6 +72,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("optionAProperties"u8); writer.WriteObjectValue(OptionAProperties, options); } + if (Optional.IsDefined(StaticRouteConfiguration)) + { + writer.WritePropertyName("staticRouteConfiguration"u8); + writer.WriteObjectValue(StaticRouteConfiguration, options); + } + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) { writer.WritePropertyName("configurationState"u8); @@ -125,14 +125,14 @@ internal static NetworkFabricExternalNetworkData DeserializeNetworkFabricExterna ResourceType type = default; SystemData systemData = default; string annotation = default; - ResourceIdentifier importRoutePolicyId = default; - ResourceIdentifier exportRoutePolicyId = default; + ResourceIdentifier networkToNetworkInterconnectId = default; ImportRoutePolicy importRoutePolicy = default; ExportRoutePolicy exportRoutePolicy = default; - ResourceIdentifier networkToNetworkInterconnectId = default; PeeringOption peeringOption = default; L3OptionBProperties optionBProperties = default; ExternalNetworkOptionAProperties optionAProperties = default; + ExternalNetworkStaticRouteConfiguration staticRouteConfiguration = default; + LastOperationProperties lastOperation = default; NetworkFabricConfigurationState? configurationState = default; NetworkFabricProvisioningState? provisioningState = default; NetworkFabricAdministrativeState? administrativeState = default; @@ -178,22 +178,13 @@ internal static NetworkFabricExternalNetworkData DeserializeNetworkFabricExterna annotation = property0.Value.GetString(); continue; } - if (property0.NameEquals("importRoutePolicyId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - importRoutePolicyId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("exportRoutePolicyId"u8)) + if (property0.NameEquals("networkToNetworkInterconnectId"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - exportRoutePolicyId = new ResourceIdentifier(property0.Value.GetString()); + networkToNetworkInterconnectId = new ResourceIdentifier(property0.Value.GetString()); continue; } if (property0.NameEquals("importRoutePolicy"u8)) @@ -214,36 +205,45 @@ internal static NetworkFabricExternalNetworkData DeserializeNetworkFabricExterna exportRoutePolicy = ExportRoutePolicy.DeserializeExportRoutePolicy(property0.Value, options); continue; } - if (property0.NameEquals("networkToNetworkInterconnectId"u8)) + if (property0.NameEquals("peeringOption"u8)) + { + peeringOption = new PeeringOption(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("optionBProperties"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - networkToNetworkInterconnectId = new ResourceIdentifier(property0.Value.GetString()); + optionBProperties = L3OptionBProperties.DeserializeL3OptionBProperties(property0.Value, options); continue; } - if (property0.NameEquals("peeringOption"u8)) + if (property0.NameEquals("optionAProperties"u8)) { - peeringOption = new PeeringOption(property0.Value.GetString()); + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + optionAProperties = ExternalNetworkOptionAProperties.DeserializeExternalNetworkOptionAProperties(property0.Value, options); continue; } - if (property0.NameEquals("optionBProperties"u8)) + if (property0.NameEquals("staticRouteConfiguration"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - optionBProperties = L3OptionBProperties.DeserializeL3OptionBProperties(property0.Value, options); + staticRouteConfiguration = ExternalNetworkStaticRouteConfiguration.DeserializeExternalNetworkStaticRouteConfiguration(property0.Value, options); continue; } - if (property0.NameEquals("optionAProperties"u8)) + if (property0.NameEquals("lastOperation"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - optionAProperties = ExternalNetworkOptionAProperties.DeserializeExternalNetworkOptionAProperties(property0.Value, options); + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property0.Value, options); continue; } if (property0.NameEquals("configurationState"u8)) @@ -288,14 +288,14 @@ internal static NetworkFabricExternalNetworkData DeserializeNetworkFabricExterna type, systemData, annotation, - importRoutePolicyId, - exportRoutePolicyId, + networkToNetworkInterconnectId, importRoutePolicy, exportRoutePolicy, - networkToNetworkInterconnectId, peeringOption, optionBProperties, optionAProperties, + staticRouteConfiguration, + lastOperation, configurationState, provisioningState, administrativeState, diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricExternalNetworkData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricExternalNetworkData.cs index c0cfed226828..bdcb79d2b8f3 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricExternalNetworkData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricExternalNetworkData.cs @@ -64,29 +64,29 @@ public NetworkFabricExternalNetworkData(PeeringOption peeringOption) /// The resourceType. /// The systemData. /// Switch configuration description. - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. + /// ARM Resource ID of the networkToNetworkInterconnectId of the ExternalNetwork resource. /// Import Route Policy either IPv4 or IPv6. /// Export Route Policy either IPv4 or IPv6. - /// Gets the networkToNetworkInterconnectId of the resource. /// Peering option list. /// option B properties object. /// option A properties object. + /// Static Route Configuration. + /// Details of the last operation performed on the resource. /// Configuration state of the resource. /// Provisioning state of the resource. /// Administrative state of the resource. /// Keeps track of any properties unknown to the library. - internal NetworkFabricExternalNetworkData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string annotation, ResourceIdentifier importRoutePolicyId, ResourceIdentifier exportRoutePolicyId, ImportRoutePolicy importRoutePolicy, ExportRoutePolicy exportRoutePolicy, ResourceIdentifier networkToNetworkInterconnectId, PeeringOption peeringOption, L3OptionBProperties optionBProperties, ExternalNetworkOptionAProperties optionAProperties, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal NetworkFabricExternalNetworkData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string annotation, ResourceIdentifier networkToNetworkInterconnectId, ImportRoutePolicy importRoutePolicy, ExportRoutePolicy exportRoutePolicy, PeeringOption peeringOption, L3OptionBProperties optionBProperties, ExternalNetworkOptionAProperties optionAProperties, ExternalNetworkStaticRouteConfiguration staticRouteConfiguration, LastOperationProperties lastOperation, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Annotation = annotation; - ImportRoutePolicyId = importRoutePolicyId; - ExportRoutePolicyId = exportRoutePolicyId; + NetworkToNetworkInterconnectId = networkToNetworkInterconnectId; ImportRoutePolicy = importRoutePolicy; ExportRoutePolicy = exportRoutePolicy; - NetworkToNetworkInterconnectId = networkToNetworkInterconnectId; PeeringOption = peeringOption; OptionBProperties = optionBProperties; OptionAProperties = optionAProperties; + StaticRouteConfiguration = staticRouteConfiguration; + LastOperation = lastOperation; ConfigurationState = configurationState; ProvisioningState = provisioningState; AdministrativeState = administrativeState; @@ -100,22 +100,28 @@ internal NetworkFabricExternalNetworkData() /// Switch configuration description. public string Annotation { get; set; } - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. - public ResourceIdentifier ImportRoutePolicyId { get; set; } - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. - public ResourceIdentifier ExportRoutePolicyId { get; set; } + /// ARM Resource ID of the networkToNetworkInterconnectId of the ExternalNetwork resource. + public ResourceIdentifier NetworkToNetworkInterconnectId { get; set; } /// Import Route Policy either IPv4 or IPv6. public ImportRoutePolicy ImportRoutePolicy { get; set; } /// Export Route Policy either IPv4 or IPv6. public ExportRoutePolicy ExportRoutePolicy { get; set; } - /// Gets the networkToNetworkInterconnectId of the resource. - public ResourceIdentifier NetworkToNetworkInterconnectId { get; } /// Peering option list. public PeeringOption PeeringOption { get; set; } /// option B properties object. public L3OptionBProperties OptionBProperties { get; set; } /// option A properties object. public ExternalNetworkOptionAProperties OptionAProperties { get; set; } + /// Static Route Configuration. + public ExternalNetworkStaticRouteConfiguration StaticRouteConfiguration { get; set; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + /// Configuration state of the resource. public NetworkFabricConfigurationState? ConfigurationState { get; } /// Provisioning state of the resource. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricExternalNetworkResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricExternalNetworkResource.cs index bd5798e7f468..af659e7dbb7e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricExternalNetworkResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricExternalNetworkResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> Up /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -358,7 +358,7 @@ public virtual ArmOperation Update(WaitUnt /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -404,7 +404,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -438,19 +438,19 @@ public virtual ArmOperation UpdateAdministrat } /// - /// Update Static Route BFD for external Network. + /// BFD administrative state for either static or bgp for internalNetwork. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateStaticRouteBfdAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateBfdAdministrativeState /// /// /// Operation Id - /// ExternalNetworks_UpdateStaticRouteBfdAdministrativeState + /// ExternalNetworks_UpdateBfdAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -462,16 +462,16 @@ public virtual ArmOperation UpdateAdministrat /// Request payload. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateStaticRouteBfdAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual async Task> UpdateBfdAdministrativeStateAsync(WaitUntil waitUntil, ExternalNetworkBfdAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _networkFabricExternalNetworkExternalNetworksClientDiagnostics.CreateScope("NetworkFabricExternalNetworkResource.UpdateStaticRouteBfdAdministrativeState"); + using var scope = _networkFabricExternalNetworkExternalNetworksClientDiagnostics.CreateScope("NetworkFabricExternalNetworkResource.UpdateBfdAdministrativeState"); scope.Start(); try { - var response = await _networkFabricExternalNetworkExternalNetworksRestClient.UpdateStaticRouteBfdAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricExternalNetworkExternalNetworksClientDiagnostics, Pipeline, _networkFabricExternalNetworkExternalNetworksRestClient.CreateUpdateStaticRouteBfdAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricExternalNetworkExternalNetworksRestClient.UpdateBfdAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new ExternalNetworkBfdAdministrativeStateResultOperationSource(), _networkFabricExternalNetworkExternalNetworksClientDiagnostics, Pipeline, _networkFabricExternalNetworkExternalNetworksRestClient.CreateUpdateBfdAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -484,19 +484,19 @@ public virtual async Task> Updat } /// - /// Update Static Route BFD for external Network. + /// BFD administrative state for either static or bgp for internalNetwork. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateStaticRouteBfdAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateBfdAdministrativeState /// /// /// Operation Id - /// ExternalNetworks_UpdateStaticRouteBfdAdministrativeState + /// ExternalNetworks_UpdateBfdAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -508,16 +508,16 @@ public virtual async Task> Updat /// Request payload. /// The cancellation token to use. /// is null. - public virtual ArmOperation UpdateStaticRouteBfdAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation UpdateBfdAdministrativeState(WaitUntil waitUntil, ExternalNetworkBfdAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _networkFabricExternalNetworkExternalNetworksClientDiagnostics.CreateScope("NetworkFabricExternalNetworkResource.UpdateStaticRouteBfdAdministrativeState"); + using var scope = _networkFabricExternalNetworkExternalNetworksClientDiagnostics.CreateScope("NetworkFabricExternalNetworkResource.UpdateBfdAdministrativeState"); scope.Start(); try { - var response = _networkFabricExternalNetworkExternalNetworksRestClient.UpdateStaticRouteBfdAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricExternalNetworkExternalNetworksClientDiagnostics, Pipeline, _networkFabricExternalNetworkExternalNetworksRestClient.CreateUpdateStaticRouteBfdAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricExternalNetworkExternalNetworksRestClient.UpdateBfdAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new ExternalNetworkBfdAdministrativeStateResultOperationSource(), _networkFabricExternalNetworkExternalNetworksClientDiagnostics, Pipeline, _networkFabricExternalNetworkExternalNetworksRestClient.CreateUpdateBfdAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPCommunityCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPCommunityCollection.cs index 449dc86b5889..dab0b3fea44d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPCommunityCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPCommunityCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string ipCommunity /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string ipCommunityName, Ca /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string ipCommunityName, CancellationToken c /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPCommunityData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPCommunityData.Serialization.cs index cd75f10b7523..1621901340a5 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPCommunityData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPCommunityData.Serialization.cs @@ -39,38 +39,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) - { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); - } - if (Optional.IsCollectionDefined(IPCommunityRules)) - { - writer.WritePropertyName("ipCommunityRules"u8); - writer.WriteStartArray(); - foreach (var item in IPCommunityRules) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) - { - writer.WritePropertyName("configurationState"u8); - writer.WriteStringValue(ConfigurationState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) - { - writer.WritePropertyName("administrativeState"u8); - writer.WriteStringValue(AdministrativeState.Value.ToString()); - } - writer.WriteEndObject(); + writer.WriteObjectValue(Properties, options); } NetworkFabricIPCommunityData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -93,21 +62,22 @@ internal static NetworkFabricIPCommunityData DeserializeNetworkFabricIPCommunity { return null; } + IPCommunityProperties properties = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - string annotation = default; - IList ipCommunityRules = default; - NetworkFabricConfigurationState? configurationState = default; - NetworkFabricProvisioningState? provisioningState = default; - NetworkFabricAdministrativeState? administrativeState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + properties = IPCommunityProperties.DeserializeIPCommunityProperties(property.Value, options); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -151,64 +121,6 @@ internal static NetworkFabricIPCommunityData DeserializeNetworkFabricIPCommunity systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerManagedNetworkFabricContext.Default); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("ipCommunityRules"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(IPCommunityRule.DeserializeIPCommunityRule(item, options)); - } - ipCommunityRules = array; - continue; - } - if (property0.NameEquals("configurationState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - configurationState = new NetworkFabricConfigurationState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkFabricProvisioningState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("administrativeState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - administrativeState = new NetworkFabricAdministrativeState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -222,11 +134,7 @@ internal static NetworkFabricIPCommunityData DeserializeNetworkFabricIPCommunity systemData, tags ?? new ChangeTrackingDictionary(), location, - annotation, - ipCommunityRules ?? new ChangeTrackingList(), - configurationState, - provisioningState, - administrativeState, + properties, serializedAdditionalRawData); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPCommunityData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPCommunityData.cs index e3427b3f887f..72095a89af4f 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPCommunityData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPCommunityData.cs @@ -53,9 +53,13 @@ public partial class NetworkFabricIPCommunityData : TrackedResourceData /// Initializes a new instance of . /// The location. - public NetworkFabricIPCommunityData(AzureLocation location) : base(location) + /// The IP Community Properties. + /// is null. + public NetworkFabricIPCommunityData(AzureLocation location, IPCommunityProperties properties) : base(location) { - IPCommunityRules = new ChangeTrackingList(); + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; } /// Initializes a new instance of . @@ -65,19 +69,11 @@ public NetworkFabricIPCommunityData(AzureLocation location) : base(location) /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// List of IP Community Rules. - /// Configuration state of the resource. - /// Provisioning state of the resource. - /// Administrative state of the resource. + /// The IP Community Properties. /// Keeps track of any properties unknown to the library. - internal NetworkFabricIPCommunityData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, IList ipCommunityRules, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NetworkFabricIPCommunityData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IPCommunityProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - Annotation = annotation; - IPCommunityRules = ipCommunityRules; - ConfigurationState = configurationState; - ProvisioningState = provisioningState; - AdministrativeState = administrativeState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -86,15 +82,7 @@ internal NetworkFabricIPCommunityData() { } - /// Switch configuration description. - public string Annotation { get; set; } - /// List of IP Community Rules. - public IList IPCommunityRules { get; } - /// Configuration state of the resource. - public NetworkFabricConfigurationState? ConfigurationState { get; } - /// Provisioning state of the resource. - public NetworkFabricProvisioningState? ProvisioningState { get; } - /// Administrative state of the resource. - public NetworkFabricAdministrativeState? AdministrativeState { get; } + /// The IP Community Properties. + public IPCommunityProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPCommunityResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPCommunityResource.cs index 4210845cc067..4d0f6cc7d789 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPCommunityResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPCommunityResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -421,7 +421,7 @@ public virtual async Task> AddTagAsyn /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -483,7 +483,7 @@ public virtual Response AddTag(string key, str /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -540,7 +540,7 @@ public virtual async Task> SetTagsAsy /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -597,7 +597,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task> RemoveTagA /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPExtendedCommunityCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPExtendedCommunityCollection.cs index 02ae27722b7d..5e4c4ca55209 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPExtendedCommunityCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPExtendedCommunityCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string ipE /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsy /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string ipExtendedCommunity /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string ipExtendedCommunityName, Cancellatio /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPExtendedCommunityData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPExtendedCommunityData.Serialization.cs index 362aebae7574..856d022d7980 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPExtendedCommunityData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPExtendedCommunityData.Serialization.cs @@ -39,35 +39,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) - { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); - } - writer.WritePropertyName("ipExtendedCommunityRules"u8); - writer.WriteStartArray(); - foreach (var item in IPExtendedCommunityRules) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) - { - writer.WritePropertyName("configurationState"u8); - writer.WriteStringValue(ConfigurationState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) - { - writer.WritePropertyName("administrativeState"u8); - writer.WriteStringValue(AdministrativeState.Value.ToString()); - } - writer.WriteEndObject(); + writer.WriteObjectValue(Properties, options); } NetworkFabricIPExtendedCommunityData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -90,21 +62,22 @@ internal static NetworkFabricIPExtendedCommunityData DeserializeNetworkFabricIPE { return null; } + IPExtendedCommunityProperties properties = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - string annotation = default; - IList ipExtendedCommunityRules = default; - NetworkFabricConfigurationState? configurationState = default; - NetworkFabricProvisioningState? provisioningState = default; - NetworkFabricAdministrativeState? administrativeState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + properties = IPExtendedCommunityProperties.DeserializeIPExtendedCommunityProperties(property.Value, options); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -148,60 +121,6 @@ internal static NetworkFabricIPExtendedCommunityData DeserializeNetworkFabricIPE systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerManagedNetworkFabricContext.Default); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("ipExtendedCommunityRules"u8)) - { - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(IPExtendedCommunityRule.DeserializeIPExtendedCommunityRule(item, options)); - } - ipExtendedCommunityRules = array; - continue; - } - if (property0.NameEquals("configurationState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - configurationState = new NetworkFabricConfigurationState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkFabricProvisioningState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("administrativeState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - administrativeState = new NetworkFabricAdministrativeState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -215,11 +134,7 @@ internal static NetworkFabricIPExtendedCommunityData DeserializeNetworkFabricIPE systemData, tags ?? new ChangeTrackingDictionary(), location, - annotation, - ipExtendedCommunityRules, - configurationState, - provisioningState, - administrativeState, + properties, serializedAdditionalRawData); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPExtendedCommunityData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPExtendedCommunityData.cs index d37d4c26f61a..ef910eeeebcb 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPExtendedCommunityData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPExtendedCommunityData.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using System.Linq; using Azure.Core; using Azure.ResourceManager.ManagedNetworkFabric.Models; using Azure.ResourceManager.Models; @@ -54,13 +53,13 @@ public partial class NetworkFabricIPExtendedCommunityData : TrackedResourceData /// Initializes a new instance of . /// The location. - /// List of IP Extended Community Rules. - /// is null. - public NetworkFabricIPExtendedCommunityData(AzureLocation location, IEnumerable ipExtendedCommunityRules) : base(location) + /// The IpExtendedCommunity properties. + /// is null. + public NetworkFabricIPExtendedCommunityData(AzureLocation location, IPExtendedCommunityProperties properties) : base(location) { - Argument.AssertNotNull(ipExtendedCommunityRules, nameof(ipExtendedCommunityRules)); + Argument.AssertNotNull(properties, nameof(properties)); - IPExtendedCommunityRules = ipExtendedCommunityRules.ToList(); + Properties = properties; } /// Initializes a new instance of . @@ -70,19 +69,11 @@ public NetworkFabricIPExtendedCommunityData(AzureLocation location, IEnumerable< /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// List of IP Extended Community Rules. - /// Configuration state of the resource. - /// Provisioning state of the resource. - /// Administrative state of the resource. + /// The IpExtendedCommunity properties. /// Keeps track of any properties unknown to the library. - internal NetworkFabricIPExtendedCommunityData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, IList ipExtendedCommunityRules, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NetworkFabricIPExtendedCommunityData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IPExtendedCommunityProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - Annotation = annotation; - IPExtendedCommunityRules = ipExtendedCommunityRules; - ConfigurationState = configurationState; - ProvisioningState = provisioningState; - AdministrativeState = administrativeState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -91,15 +82,7 @@ internal NetworkFabricIPExtendedCommunityData() { } - /// Switch configuration description. - public string Annotation { get; set; } - /// List of IP Extended Community Rules. - public IList IPExtendedCommunityRules { get; } - /// Configuration state of the resource. - public NetworkFabricConfigurationState? ConfigurationState { get; } - /// Provisioning state of the resource. - public NetworkFabricProvisioningState? ProvisioningState { get; } - /// Administrative state of the resource. - public NetworkFabricAdministrativeState? AdministrativeState { get; } + /// The IpExtendedCommunity properties. + public IPExtendedCommunityProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPExtendedCommunityResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPExtendedCommunityResource.cs index 520b5e53dca1..96aaf5136203 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPExtendedCommunityResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPExtendedCommunityResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(Wai /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -421,7 +421,7 @@ public virtual async Task> Ad /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -483,7 +483,7 @@ public virtual Response AddTag(string /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -540,7 +540,7 @@ public virtual async Task> Se /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -597,7 +597,7 @@ public virtual Response SetTags(IDicti /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task> Re /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPPrefixCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPPrefixCollection.cs index 96867ab1bdef..a49a82432a01 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPPrefixCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPPrefixCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrU /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(stri /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string ipPrefixName, /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cancella /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string ipPrefixName, Cance /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string ipPrefixName, CancellationToken canc /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIf /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPPrefixData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPPrefixData.Serialization.cs index 9331ebc188f7..7dcbf537cb96 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPPrefixData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPPrefixData.Serialization.cs @@ -39,38 +39,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) - { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); - } - if (Optional.IsCollectionDefined(IPPrefixRules)) - { - writer.WritePropertyName("ipPrefixRules"u8); - writer.WriteStartArray(); - foreach (var item in IPPrefixRules) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) - { - writer.WritePropertyName("configurationState"u8); - writer.WriteStringValue(ConfigurationState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) - { - writer.WritePropertyName("administrativeState"u8); - writer.WriteStringValue(AdministrativeState.Value.ToString()); - } - writer.WriteEndObject(); + writer.WriteObjectValue(Properties, options); } NetworkFabricIPPrefixData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -93,21 +62,22 @@ internal static NetworkFabricIPPrefixData DeserializeNetworkFabricIPPrefixData(J { return null; } + IPPrefixProperties properties = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - string annotation = default; - IList ipPrefixRules = default; - NetworkFabricConfigurationState? configurationState = default; - NetworkFabricProvisioningState? provisioningState = default; - NetworkFabricAdministrativeState? administrativeState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + properties = IPPrefixProperties.DeserializeIPPrefixProperties(property.Value, options); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -151,64 +121,6 @@ internal static NetworkFabricIPPrefixData DeserializeNetworkFabricIPPrefixData(J systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerManagedNetworkFabricContext.Default); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("ipPrefixRules"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(IPPrefixRule.DeserializeIPPrefixRule(item, options)); - } - ipPrefixRules = array; - continue; - } - if (property0.NameEquals("configurationState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - configurationState = new NetworkFabricConfigurationState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkFabricProvisioningState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("administrativeState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - administrativeState = new NetworkFabricAdministrativeState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -222,11 +134,7 @@ internal static NetworkFabricIPPrefixData DeserializeNetworkFabricIPPrefixData(J systemData, tags ?? new ChangeTrackingDictionary(), location, - annotation, - ipPrefixRules ?? new ChangeTrackingList(), - configurationState, - provisioningState, - administrativeState, + properties, serializedAdditionalRawData); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPPrefixData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPPrefixData.cs index 11afe50668f4..2e8f580a7193 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPPrefixData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPPrefixData.cs @@ -53,9 +53,13 @@ public partial class NetworkFabricIPPrefixData : TrackedResourceData /// Initializes a new instance of . /// The location. - public NetworkFabricIPPrefixData(AzureLocation location) : base(location) + /// The IP Prefix properties. + /// is null. + public NetworkFabricIPPrefixData(AzureLocation location, IPPrefixProperties properties) : base(location) { - IPPrefixRules = new ChangeTrackingList(); + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; } /// Initializes a new instance of . @@ -65,19 +69,11 @@ public NetworkFabricIPPrefixData(AzureLocation location) : base(location) /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// The list of IP Prefix Rules. - /// Configuration state of the resource. - /// Provisioning state of the resource. - /// Administrative state of the resource. + /// The IP Prefix properties. /// Keeps track of any properties unknown to the library. - internal NetworkFabricIPPrefixData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, IList ipPrefixRules, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NetworkFabricIPPrefixData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IPPrefixProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - Annotation = annotation; - IPPrefixRules = ipPrefixRules; - ConfigurationState = configurationState; - ProvisioningState = provisioningState; - AdministrativeState = administrativeState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -86,15 +82,7 @@ internal NetworkFabricIPPrefixData() { } - /// Switch configuration description. - public string Annotation { get; set; } - /// The list of IP Prefix Rules. - public IList IPPrefixRules { get; } - /// Configuration state of the resource. - public NetworkFabricConfigurationState? ConfigurationState { get; } - /// Provisioning state of the resource. - public NetworkFabricProvisioningState? ProvisioningState { get; } - /// Administrative state of the resource. - public NetworkFabricAdministrativeState? AdministrativeState { get; } + /// The IP Prefix properties. + public IPPrefixProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPPrefixResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPPrefixResource.cs index f59d67630afc..300e2367d053 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPPrefixResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricIPPrefixResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Canc /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken can /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsy /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUntil wait /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -421,7 +421,7 @@ public virtual async Task> AddTagAsync(s /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -483,7 +483,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -540,7 +540,7 @@ public virtual async Task> SetTagsAsync( /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -597,7 +597,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task> RemoveTagAsyn /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternalNetworkCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternalNetworkCollection.cs index aa11f6b9fcf6..c93afd8ee353 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternalNetworkCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternalNetworkCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string interna /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string internalNetworkName /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string internalNetworkName, CancellationTok /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternalNetworkData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternalNetworkData.Serialization.cs index 3e70eb17dc93..e417d97282a1 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternalNetworkData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternalNetworkData.Serialization.cs @@ -70,16 +70,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } - if (Optional.IsDefined(ImportRoutePolicyId)) - { - writer.WritePropertyName("importRoutePolicyId"u8); - writer.WriteStringValue(ImportRoutePolicyId); - } - if (Optional.IsDefined(ExportRoutePolicyId)) - { - writer.WritePropertyName("exportRoutePolicyId"u8); - writer.WriteStringValue(ExportRoutePolicyId); - } if (Optional.IsDefined(ImportRoutePolicy)) { writer.WritePropertyName("importRoutePolicy"u8); @@ -122,6 +112,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("staticRouteConfiguration"u8); writer.WriteObjectValue(StaticRouteConfiguration, options); } + if (Optional.IsDefined(NativeIPv4PrefixLimit)) + { + writer.WritePropertyName("nativeIpv4PrefixLimit"u8); + writer.WriteObjectValue(NativeIPv4PrefixLimit, options); + } + if (Optional.IsDefined(NativeIPv6PrefixLimit)) + { + writer.WritePropertyName("nativeIpv6PrefixLimit"u8); + writer.WriteObjectValue(NativeIPv6PrefixLimit, options); + } + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) { writer.WritePropertyName("configurationState"u8); @@ -168,8 +173,6 @@ internal static NetworkFabricInternalNetworkData DeserializeNetworkFabricInterna int? mtu = default; IList connectedIPv4Subnets = default; IList connectedIPv6Subnets = default; - ResourceIdentifier importRoutePolicyId = default; - ResourceIdentifier exportRoutePolicyId = default; ImportRoutePolicy importRoutePolicy = default; ExportRoutePolicy exportRoutePolicy = default; ResourceIdentifier ingressAclId = default; @@ -177,8 +180,11 @@ internal static NetworkFabricInternalNetworkData DeserializeNetworkFabricInterna IsMonitoringEnabled? isMonitoringEnabled = default; StaticRouteConfigurationExtension? extension = default; int vlanId = default; - InternalNetworkBgpConfiguration bgpConfiguration = default; - InternalNetworkStaticRouteConfiguration staticRouteConfiguration = default; + BgpConfiguration bgpConfiguration = default; + StaticRouteConfiguration staticRouteConfiguration = default; + NativeIPv4PrefixLimitProperties nativeIPv4PrefixLimit = default; + NativeIPv6PrefixLimitProperties nativeIPv6PrefixLimit = default; + LastOperationProperties lastOperation = default; NetworkFabricConfigurationState? configurationState = default; NetworkFabricProvisioningState? provisioningState = default; NetworkFabricAdministrativeState? administrativeState = default; @@ -261,24 +267,6 @@ internal static NetworkFabricInternalNetworkData DeserializeNetworkFabricInterna connectedIPv6Subnets = array; continue; } - if (property0.NameEquals("importRoutePolicyId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - importRoutePolicyId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("exportRoutePolicyId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - exportRoutePolicyId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } if (property0.NameEquals("importRoutePolicy"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -344,7 +332,7 @@ internal static NetworkFabricInternalNetworkData DeserializeNetworkFabricInterna { continue; } - bgpConfiguration = InternalNetworkBgpConfiguration.DeserializeInternalNetworkBgpConfiguration(property0.Value, options); + bgpConfiguration = BgpConfiguration.DeserializeBgpConfiguration(property0.Value, options); continue; } if (property0.NameEquals("staticRouteConfiguration"u8)) @@ -353,7 +341,34 @@ internal static NetworkFabricInternalNetworkData DeserializeNetworkFabricInterna { continue; } - staticRouteConfiguration = InternalNetworkStaticRouteConfiguration.DeserializeInternalNetworkStaticRouteConfiguration(property0.Value, options); + staticRouteConfiguration = StaticRouteConfiguration.DeserializeStaticRouteConfiguration(property0.Value, options); + continue; + } + if (property0.NameEquals("nativeIpv4PrefixLimit"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nativeIPv4PrefixLimit = NativeIPv4PrefixLimitProperties.DeserializeNativeIPv4PrefixLimitProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("nativeIpv6PrefixLimit"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nativeIPv6PrefixLimit = NativeIPv6PrefixLimitProperties.DeserializeNativeIPv6PrefixLimitProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("lastOperation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property0.Value, options); continue; } if (property0.NameEquals("configurationState"u8)) @@ -401,8 +416,6 @@ internal static NetworkFabricInternalNetworkData DeserializeNetworkFabricInterna mtu, connectedIPv4Subnets ?? new ChangeTrackingList(), connectedIPv6Subnets ?? new ChangeTrackingList(), - importRoutePolicyId, - exportRoutePolicyId, importRoutePolicy, exportRoutePolicy, ingressAclId, @@ -412,6 +425,9 @@ internal static NetworkFabricInternalNetworkData DeserializeNetworkFabricInterna vlanId, bgpConfiguration, staticRouteConfiguration, + nativeIPv4PrefixLimit, + nativeIPv6PrefixLimit, + lastOperation, configurationState, provisioningState, administrativeState, diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternalNetworkData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternalNetworkData.cs index 7199c46ce55e..701d1a20e5ee 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternalNetworkData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternalNetworkData.cs @@ -69,8 +69,6 @@ public NetworkFabricInternalNetworkData(int vlanId) /// Maximum transmission unit. Default value is 1500. /// List of Connected IPv4 Subnets. /// List of connected IPv6 Subnets. - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. /// Import Route Policy either IPv4 or IPv6. /// Export Route Policy either IPv4 or IPv6. /// Ingress Acl. ARM resource ID of Access Control Lists. @@ -80,18 +78,19 @@ public NetworkFabricInternalNetworkData(int vlanId) /// Vlan identifier. Example: 1001. /// BGP configuration properties. /// Static Route Configuration properties. + /// Native IPv4 Prefix Limit Configuration properties. + /// Native IPv6 Prefix Limit Configuration properties. + /// Details of the last operation performed on the resource. /// Configuration state of the resource. /// Provisioning state of the resource. /// Administrative state of the resource. /// Keeps track of any properties unknown to the library. - internal NetworkFabricInternalNetworkData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string annotation, int? mtu, IList connectedIPv4Subnets, IList connectedIPv6Subnets, ResourceIdentifier importRoutePolicyId, ResourceIdentifier exportRoutePolicyId, ImportRoutePolicy importRoutePolicy, ExportRoutePolicy exportRoutePolicy, ResourceIdentifier ingressAclId, ResourceIdentifier egressAclId, IsMonitoringEnabled? isMonitoringEnabled, StaticRouteConfigurationExtension? extension, int vlanId, InternalNetworkBgpConfiguration bgpConfiguration, InternalNetworkStaticRouteConfiguration staticRouteConfiguration, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal NetworkFabricInternalNetworkData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string annotation, int? mtu, IList connectedIPv4Subnets, IList connectedIPv6Subnets, ImportRoutePolicy importRoutePolicy, ExportRoutePolicy exportRoutePolicy, ResourceIdentifier ingressAclId, ResourceIdentifier egressAclId, IsMonitoringEnabled? isMonitoringEnabled, StaticRouteConfigurationExtension? extension, int vlanId, BgpConfiguration bgpConfiguration, StaticRouteConfiguration staticRouteConfiguration, NativeIPv4PrefixLimitProperties nativeIPv4PrefixLimit, NativeIPv6PrefixLimitProperties nativeIPv6PrefixLimit, LastOperationProperties lastOperation, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Annotation = annotation; Mtu = mtu; ConnectedIPv4Subnets = connectedIPv4Subnets; ConnectedIPv6Subnets = connectedIPv6Subnets; - ImportRoutePolicyId = importRoutePolicyId; - ExportRoutePolicyId = exportRoutePolicyId; ImportRoutePolicy = importRoutePolicy; ExportRoutePolicy = exportRoutePolicy; IngressAclId = ingressAclId; @@ -101,6 +100,9 @@ internal NetworkFabricInternalNetworkData(ResourceIdentifier id, string name, Re VlanId = vlanId; BgpConfiguration = bgpConfiguration; StaticRouteConfiguration = staticRouteConfiguration; + NativeIPv4PrefixLimit = nativeIPv4PrefixLimit; + NativeIPv6PrefixLimit = nativeIPv6PrefixLimit; + LastOperation = lastOperation; ConfigurationState = configurationState; ProvisioningState = provisioningState; AdministrativeState = administrativeState; @@ -120,10 +122,6 @@ internal NetworkFabricInternalNetworkData() public IList ConnectedIPv4Subnets { get; } /// List of connected IPv6 Subnets. public IList ConnectedIPv6Subnets { get; } - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. - public ResourceIdentifier ImportRoutePolicyId { get; set; } - /// ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. - public ResourceIdentifier ExportRoutePolicyId { get; set; } /// Import Route Policy either IPv4 or IPv6. public ImportRoutePolicy ImportRoutePolicy { get; set; } /// Export Route Policy either IPv4 or IPv6. @@ -139,9 +137,43 @@ internal NetworkFabricInternalNetworkData() /// Vlan identifier. Example: 1001. public int VlanId { get; set; } /// BGP configuration properties. - public InternalNetworkBgpConfiguration BgpConfiguration { get; set; } + public BgpConfiguration BgpConfiguration { get; set; } /// Static Route Configuration properties. - public InternalNetworkStaticRouteConfiguration StaticRouteConfiguration { get; set; } + public StaticRouteConfiguration StaticRouteConfiguration { get; set; } + /// Native IPv4 Prefix Limit Configuration properties. + internal NativeIPv4PrefixLimitProperties NativeIPv4PrefixLimit { get; set; } + /// Prefix limits. + public IList NativeIPv4PrefixLimits + { + get + { + if (NativeIPv4PrefixLimit is null) + NativeIPv4PrefixLimit = new NativeIPv4PrefixLimitProperties(); + return NativeIPv4PrefixLimit.PrefixLimits; + } + } + + /// Native IPv6 Prefix Limit Configuration properties. + internal NativeIPv6PrefixLimitProperties NativeIPv6PrefixLimit { get; set; } + /// Prefix limits. + public IList NativeIPv6PrefixLimits + { + get + { + if (NativeIPv6PrefixLimit is null) + NativeIPv6PrefixLimit = new NativeIPv6PrefixLimitProperties(); + return NativeIPv6PrefixLimit.PrefixLimits; + } + } + + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + /// Configuration state of the resource. public NetworkFabricConfigurationState? ConfigurationState { get; } /// Provisioning state of the resource. diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternalNetworkResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternalNetworkResource.cs index a1af2cc0d510..4dc88b1b02a9 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternalNetworkResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternalNetworkResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> Up /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -358,7 +358,7 @@ public virtual ArmOperation Update(WaitUnt /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -404,7 +404,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -438,19 +438,19 @@ public virtual ArmOperation UpdateAdministrat } /// - /// Update BGP state for internalNetwork. Allowed only on edge devices. + /// BFD administrative state for either static or bgp for internalNetwork. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBgpAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBfdAdministrativeState /// /// /// Operation Id - /// InternalNetworks_UpdateBgpAdministrativeState + /// InternalNetworks_UpdateBfdAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -462,16 +462,16 @@ public virtual ArmOperation UpdateAdministrat /// Request payload. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateBgpAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual async Task> UpdateBfdAdministrativeStateAsync(WaitUntil waitUntil, InternalNetworkBfdAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _networkFabricInternalNetworkInternalNetworksClientDiagnostics.CreateScope("NetworkFabricInternalNetworkResource.UpdateBgpAdministrativeState"); + using var scope = _networkFabricInternalNetworkInternalNetworksClientDiagnostics.CreateScope("NetworkFabricInternalNetworkResource.UpdateBfdAdministrativeState"); scope.Start(); try { - var response = await _networkFabricInternalNetworkInternalNetworksRestClient.UpdateBgpAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricInternalNetworkInternalNetworksClientDiagnostics, Pipeline, _networkFabricInternalNetworkInternalNetworksRestClient.CreateUpdateBgpAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricInternalNetworkInternalNetworksRestClient.UpdateBfdAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new InternalNetworkBfdAdministrativeStateResultOperationSource(), _networkFabricInternalNetworkInternalNetworksClientDiagnostics, Pipeline, _networkFabricInternalNetworkInternalNetworksRestClient.CreateUpdateBfdAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -484,19 +484,19 @@ public virtual async Task> Updat } /// - /// Update BGP state for internalNetwork. Allowed only on edge devices. + /// BFD administrative state for either static or bgp for internalNetwork. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBgpAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBfdAdministrativeState /// /// /// Operation Id - /// InternalNetworks_UpdateBgpAdministrativeState + /// InternalNetworks_UpdateBfdAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -508,16 +508,16 @@ public virtual async Task> Updat /// Request payload. /// The cancellation token to use. /// is null. - public virtual ArmOperation UpdateBgpAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation UpdateBfdAdministrativeState(WaitUntil waitUntil, InternalNetworkBfdAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _networkFabricInternalNetworkInternalNetworksClientDiagnostics.CreateScope("NetworkFabricInternalNetworkResource.UpdateBgpAdministrativeState"); + using var scope = _networkFabricInternalNetworkInternalNetworksClientDiagnostics.CreateScope("NetworkFabricInternalNetworkResource.UpdateBfdAdministrativeState"); scope.Start(); try { - var response = _networkFabricInternalNetworkInternalNetworksRestClient.UpdateBgpAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricInternalNetworkInternalNetworksClientDiagnostics, Pipeline, _networkFabricInternalNetworkInternalNetworksRestClient.CreateUpdateBgpAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricInternalNetworkInternalNetworksRestClient.UpdateBfdAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new InternalNetworkBfdAdministrativeStateResultOperationSource(), _networkFabricInternalNetworkInternalNetworksClientDiagnostics, Pipeline, _networkFabricInternalNetworkInternalNetworksRestClient.CreateUpdateBfdAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -530,19 +530,19 @@ public virtual ArmOperation UpdateBgpAdminist } /// - /// Update Static Route BFD administrative state for internalNetwork. + /// Update BGP state for internalNetwork. Allowed only on edge devices. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateStaticRouteBfdAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBgpAdministrativeState /// /// /// Operation Id - /// InternalNetworks_UpdateStaticRouteBfdAdministrativeState + /// InternalNetworks_UpdateBgpAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -554,16 +554,16 @@ public virtual ArmOperation UpdateBgpAdminist /// Request payload. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateStaticRouteBfdAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual async Task> UpdateBgpAdministrativeStateAsync(WaitUntil waitUntil, InternalNetworkBgpAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _networkFabricInternalNetworkInternalNetworksClientDiagnostics.CreateScope("NetworkFabricInternalNetworkResource.UpdateStaticRouteBfdAdministrativeState"); + using var scope = _networkFabricInternalNetworkInternalNetworksClientDiagnostics.CreateScope("NetworkFabricInternalNetworkResource.UpdateBgpAdministrativeState"); scope.Start(); try { - var response = await _networkFabricInternalNetworkInternalNetworksRestClient.UpdateStaticRouteBfdAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricInternalNetworkInternalNetworksClientDiagnostics, Pipeline, _networkFabricInternalNetworkInternalNetworksRestClient.CreateUpdateStaticRouteBfdAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricInternalNetworkInternalNetworksRestClient.UpdateBgpAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new InternalNetworkBgpAdministrativeStateResultOperationSource(), _networkFabricInternalNetworkInternalNetworksClientDiagnostics, Pipeline, _networkFabricInternalNetworkInternalNetworksRestClient.CreateUpdateBgpAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -576,19 +576,19 @@ public virtual async Task> Updat } /// - /// Update Static Route BFD administrative state for internalNetwork. + /// Update BGP state for internalNetwork. Allowed only on edge devices. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateStaticRouteBfdAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBgpAdministrativeState /// /// /// Operation Id - /// InternalNetworks_UpdateStaticRouteBfdAdministrativeState + /// InternalNetworks_UpdateBgpAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -600,16 +600,16 @@ public virtual async Task> Updat /// Request payload. /// The cancellation token to use. /// is null. - public virtual ArmOperation UpdateStaticRouteBfdAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation UpdateBgpAdministrativeState(WaitUntil waitUntil, InternalNetworkBgpAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _networkFabricInternalNetworkInternalNetworksClientDiagnostics.CreateScope("NetworkFabricInternalNetworkResource.UpdateStaticRouteBfdAdministrativeState"); + using var scope = _networkFabricInternalNetworkInternalNetworksClientDiagnostics.CreateScope("NetworkFabricInternalNetworkResource.UpdateBgpAdministrativeState"); scope.Start(); try { - var response = _networkFabricInternalNetworkInternalNetworksRestClient.UpdateStaticRouteBfdAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricInternalNetworkInternalNetworksClientDiagnostics, Pipeline, _networkFabricInternalNetworkInternalNetworksRestClient.CreateUpdateStaticRouteBfdAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricInternalNetworkInternalNetworksRestClient.UpdateBgpAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new InternalNetworkBgpAdministrativeStateResultOperationSource(), _networkFabricInternalNetworkInternalNetworksClientDiagnostics, Pipeline, _networkFabricInternalNetworkInternalNetworksRestClient.CreateUpdateBgpAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayCollection.cs index e49dc982f11d..d12fbfbbbd15 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -110,7 +110,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -155,7 +155,7 @@ public virtual Response Get(string interne /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -185,7 +185,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -215,7 +215,7 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -258,7 +258,7 @@ public virtual async Task> ExistsAsync(string internetGatewayName /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -301,7 +301,7 @@ public virtual Response Exists(string internetGatewayName, CancellationTok /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -346,7 +346,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayData.Serialization.cs index df9a9dd16f12..a012127313d6 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayData.Serialization.cs @@ -60,10 +60,23 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("port"u8); writer.WriteNumberValue(Port.Value); } - writer.WritePropertyName("type"u8); - writer.WriteStringValue(TypePropertiesType.ToString()); + if (Optional.IsDefined(TypePropertiesType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(TypePropertiesType.Value.ToString()); + } + if (Optional.IsDefined(InternetGatewayType)) + { + writer.WritePropertyName("internetGatewayType"u8); + writer.WriteStringValue(InternetGatewayType.Value.ToString()); + } writer.WritePropertyName("networkFabricControllerId"u8); writer.WriteStringValue(NetworkFabricControllerId); + if (options.Format != "W" && Optional.IsDefined(LastOperation)) + { + writer.WritePropertyName("lastOperation"u8); + writer.WriteObjectValue(LastOperation, options); + } if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -102,8 +115,10 @@ internal static NetworkFabricInternetGatewayData DeserializeNetworkFabricInterne ResourceIdentifier internetGatewayRuleId = default; string ipv4Address = default; int? port = default; - InternetGatewayType type0 = default; + InternetGatewayType? type0 = default; + InternetGatewayType? internetGatewayType = default; ResourceIdentifier networkFabricControllerId = default; + LastOperationProperties lastOperation = default; NetworkFabricProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -191,14 +206,36 @@ internal static NetworkFabricInternetGatewayData DeserializeNetworkFabricInterne } if (property0.NameEquals("type"u8)) { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } type0 = new InternetGatewayType(property0.Value.GetString()); continue; } + if (property0.NameEquals("internetGatewayType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + internetGatewayType = new InternetGatewayType(property0.Value.GetString()); + continue; + } if (property0.NameEquals("networkFabricControllerId"u8)) { networkFabricControllerId = new ResourceIdentifier(property0.Value.GetString()); continue; } + if (property0.NameEquals("lastOperation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastOperation = LastOperationProperties.DeserializeLastOperationProperties(property0.Value, options); + continue; + } if (property0.NameEquals("provisioningState"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -229,7 +266,9 @@ internal static NetworkFabricInternetGatewayData DeserializeNetworkFabricInterne ipv4Address, port, type0, + internetGatewayType, networkFabricControllerId, + lastOperation, provisioningState, serializedAdditionalRawData); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayData.cs index 6de03270f84a..532ce333eaa9 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayData.cs @@ -53,14 +53,12 @@ public partial class NetworkFabricInternetGatewayData : TrackedResourceData /// Initializes a new instance of . /// The location. - /// Gateway Type of the resource. /// ARM Resource ID of the Network Fabric Controller. /// is null. - public NetworkFabricInternetGatewayData(AzureLocation location, InternetGatewayType typePropertiesType, ResourceIdentifier networkFabricControllerId) : base(location) + public NetworkFabricInternetGatewayData(AzureLocation location, ResourceIdentifier networkFabricControllerId) : base(location) { Argument.AssertNotNull(networkFabricControllerId, nameof(networkFabricControllerId)); - TypePropertiesType = typePropertiesType; NetworkFabricControllerId = networkFabricControllerId; } @@ -76,17 +74,21 @@ public NetworkFabricInternetGatewayData(AzureLocation location, InternetGatewayT /// IPv4 Address of Internet Gateway. /// Port number of Internet Gateway. /// Gateway Type of the resource. + /// Gateway Type of the resource. /// ARM Resource ID of the Network Fabric Controller. + /// Details of the last operation performed on the resource. /// Provisioning state of resource. /// Keeps track of any properties unknown to the library. - internal NetworkFabricInternetGatewayData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, ResourceIdentifier internetGatewayRuleId, string ipV4Address, int? port, InternetGatewayType typePropertiesType, ResourceIdentifier networkFabricControllerId, NetworkFabricProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NetworkFabricInternetGatewayData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, ResourceIdentifier internetGatewayRuleId, string ipV4Address, int? port, InternetGatewayType? typePropertiesType, InternetGatewayType? internetGatewayType, ResourceIdentifier networkFabricControllerId, LastOperationProperties lastOperation, NetworkFabricProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Annotation = annotation; InternetGatewayRuleId = internetGatewayRuleId; IPV4Address = ipV4Address; Port = port; TypePropertiesType = typePropertiesType; + InternetGatewayType = internetGatewayType; NetworkFabricControllerId = networkFabricControllerId; + LastOperation = lastOperation; ProvisioningState = provisioningState; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -105,9 +107,19 @@ internal NetworkFabricInternetGatewayData() /// Port number of Internet Gateway. public int? Port { get; } /// Gateway Type of the resource. - public InternetGatewayType TypePropertiesType { get; set; } + public InternetGatewayType? TypePropertiesType { get; set; } + /// Gateway Type of the resource. + public InternetGatewayType? InternetGatewayType { get; set; } /// ARM Resource ID of the Network Fabric Controller. public ResourceIdentifier NetworkFabricControllerId { get; set; } + /// Details of the last operation performed on the resource. + internal LastOperationProperties LastOperation { get; } + /// Details status of the last operation performed on the resource. + public string LastOperationDetails + { + get => LastOperation?.Details; + } + /// Provisioning state of resource. public NetworkFabricProvisioningState? ProvisioningState { get; } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayResource.cs index c398b9485d24..fbf921e74d81 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -192,7 +192,7 @@ public virtual Response Get(CancellationTo /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// API to update certain properties of the L2 Isolation Domain resource.. + /// API to update certain properties of the InternetGateway resource.. /// The cancellation token to use. /// is null. public virtual async Task> UpdateAsync(WaitUntil waitUntil, NetworkFabricInternetGatewayPatch patch, CancellationToken cancellationToken = default) @@ -229,7 +229,7 @@ public virtual async Task> Up /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -238,7 +238,7 @@ public virtual async Task> Up /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// API to update certain properties of the L2 Isolation Domain resource.. + /// API to update certain properties of the InternetGateway resource.. /// The cancellation token to use. /// is null. public virtual ArmOperation Update(WaitUntil waitUntil, NetworkFabricInternetGatewayPatch patch, CancellationToken cancellationToken = default) @@ -275,7 +275,7 @@ public virtual ArmOperation Update(WaitUnt /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -337,7 +337,7 @@ public virtual async Task> AddTag /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response AddTag(string key, /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -456,7 +456,7 @@ public virtual async Task> SetTag /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -513,7 +513,7 @@ public virtual Response SetTags(IDictionar /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -573,7 +573,7 @@ public virtual async Task> Remove /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayRuleCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayRuleCollection.cs index 0b921c2fc010..adaaca78106e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayRuleCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayRuleCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string int /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsy /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string internetGatewayRule /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string internetGatewayRuleName, Cancellatio /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayRuleData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayRuleData.Serialization.cs index 39999acff664..37e53942b5e3 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayRuleData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayRuleData.Serialization.cs @@ -39,35 +39,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) - { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); - } - writer.WritePropertyName("ruleProperties"u8); - writer.WriteObjectValue(RuleProperties, options); - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsCollectionDefined(InternetGatewayIds)) - { - writer.WritePropertyName("internetGatewayIds"u8); - writer.WriteStartArray(); - foreach (var item in InternetGatewayIds) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); + writer.WriteObjectValue(Properties, options); } NetworkFabricInternetGatewayRuleData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -90,20 +62,22 @@ internal static NetworkFabricInternetGatewayRuleData DeserializeNetworkFabricInt { return null; } + InternetGatewayRuleProperties properties = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - string annotation = default; - InternetGatewayRules ruleProperties = default; - NetworkFabricProvisioningState? provisioningState = default; - IReadOnlyList internetGatewayIds = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + properties = InternetGatewayRuleProperties.DeserializeInternetGatewayRuleProperties(property.Value, options); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -147,58 +121,6 @@ internal static NetworkFabricInternetGatewayRuleData DeserializeNetworkFabricInt systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerManagedNetworkFabricContext.Default); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("ruleProperties"u8)) - { - ruleProperties = InternetGatewayRules.DeserializeInternetGatewayRules(property0.Value, options); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkFabricProvisioningState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("internetGatewayIds"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } - } - internetGatewayIds = array; - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -212,10 +134,7 @@ internal static NetworkFabricInternetGatewayRuleData DeserializeNetworkFabricInt systemData, tags ?? new ChangeTrackingDictionary(), location, - annotation, - ruleProperties, - provisioningState, - internetGatewayIds ?? new ChangeTrackingList(), + properties, serializedAdditionalRawData); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayRuleData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayRuleData.cs index 925415cf4c63..7422a631c726 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayRuleData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayRuleData.cs @@ -53,14 +53,13 @@ public partial class NetworkFabricInternetGatewayRuleData : TrackedResourceData /// Initializes a new instance of . /// The location. - /// Rules for the InternetGateways. - /// is null. - public NetworkFabricInternetGatewayRuleData(AzureLocation location, InternetGatewayRules ruleProperties) : base(location) + /// The Internet Gateway Rule properties. + /// is null. + public NetworkFabricInternetGatewayRuleData(AzureLocation location, InternetGatewayRuleProperties properties) : base(location) { - Argument.AssertNotNull(ruleProperties, nameof(ruleProperties)); + Argument.AssertNotNull(properties, nameof(properties)); - RuleProperties = ruleProperties; - InternetGatewayIds = new ChangeTrackingList(); + Properties = properties; } /// Initializes a new instance of . @@ -70,17 +69,11 @@ public NetworkFabricInternetGatewayRuleData(AzureLocation location, InternetGate /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// Rules for the InternetGateways. - /// Provisioning state of the resource. - /// List of Internet Gateway resource Id. + /// The Internet Gateway Rule properties. /// Keeps track of any properties unknown to the library. - internal NetworkFabricInternetGatewayRuleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, InternetGatewayRules ruleProperties, NetworkFabricProvisioningState? provisioningState, IReadOnlyList internetGatewayIds, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NetworkFabricInternetGatewayRuleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, InternetGatewayRuleProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - Annotation = annotation; - RuleProperties = ruleProperties; - ProvisioningState = provisioningState; - InternetGatewayIds = internetGatewayIds; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -89,13 +82,7 @@ internal NetworkFabricInternetGatewayRuleData() { } - /// Switch configuration description. - public string Annotation { get; set; } - /// Rules for the InternetGateways. - public InternetGatewayRules RuleProperties { get; set; } - /// Provisioning state of the resource. - public NetworkFabricProvisioningState? ProvisioningState { get; } - /// List of Internet Gateway resource Id. - public IReadOnlyList InternetGatewayIds { get; } + /// The Internet Gateway Rule properties. + public InternetGatewayRuleProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayRuleResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayRuleResource.cs index 4146d0e84f4c..c055bd3aaccf 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayRuleResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricInternetGatewayRuleResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(Wai /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -421,7 +421,7 @@ public virtual async Task> Ad /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -483,7 +483,7 @@ public virtual Response AddTag(string /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -540,7 +540,7 @@ public virtual async Task> Se /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -597,7 +597,7 @@ public virtual Response SetTags(IDicti /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task> Re /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL2IsolationDomainCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL2IsolationDomainCollection.cs index 88ac1a922c31..8c969b6b6709 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL2IsolationDomainCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL2IsolationDomainCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string l2Iso /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string l2IsolationDomainNa /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string l2IsolationDomainName, CancellationT /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL2IsolationDomainData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL2IsolationDomainData.Serialization.cs index 92a087c68135..cf99e990de3d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL2IsolationDomainData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL2IsolationDomainData.Serialization.cs @@ -39,37 +39,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) - { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); - } - writer.WritePropertyName("networkFabricId"u8); - writer.WriteStringValue(NetworkFabricId); - writer.WritePropertyName("vlanId"u8); - writer.WriteNumberValue(VlanId); - if (Optional.IsDefined(Mtu)) - { - writer.WritePropertyName("mtu"u8); - writer.WriteNumberValue(Mtu.Value); - } - if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) - { - writer.WritePropertyName("configurationState"u8); - writer.WriteStringValue(ConfigurationState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) - { - writer.WritePropertyName("administrativeState"u8); - writer.WriteStringValue(AdministrativeState.Value.ToString()); - } - writer.WriteEndObject(); + writer.WriteObjectValue(Properties, options); } NetworkFabricL2IsolationDomainData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -92,23 +62,22 @@ internal static NetworkFabricL2IsolationDomainData DeserializeNetworkFabricL2Iso { return null; } + L2IsolationDomainProperties properties = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - string annotation = default; - ResourceIdentifier networkFabricId = default; - int vlanId = default; - int? mtu = default; - NetworkFabricConfigurationState? configurationState = default; - NetworkFabricProvisioningState? provisioningState = default; - NetworkFabricAdministrativeState? administrativeState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + properties = L2IsolationDomainProperties.DeserializeL2IsolationDomainProperties(property.Value, options); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -152,69 +121,6 @@ internal static NetworkFabricL2IsolationDomainData DeserializeNetworkFabricL2Iso systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerManagedNetworkFabricContext.Default); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("networkFabricId"u8)) - { - networkFabricId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("vlanId"u8)) - { - vlanId = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("mtu"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mtu = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("configurationState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - configurationState = new NetworkFabricConfigurationState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkFabricProvisioningState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("administrativeState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - administrativeState = new NetworkFabricAdministrativeState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -228,13 +134,7 @@ internal static NetworkFabricL2IsolationDomainData DeserializeNetworkFabricL2Iso systemData, tags ?? new ChangeTrackingDictionary(), location, - annotation, - networkFabricId, - vlanId, - mtu, - configurationState, - provisioningState, - administrativeState, + properties, serializedAdditionalRawData); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL2IsolationDomainData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL2IsolationDomainData.cs index 36afddeb2bfa..74bb94ecde94 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL2IsolationDomainData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL2IsolationDomainData.cs @@ -53,15 +53,13 @@ public partial class NetworkFabricL2IsolationDomainData : TrackedResourceData /// Initializes a new instance of . /// The location. - /// ARM Resource ID of the Network Fabric. - /// Vlan Identifier of the Network Fabric. Example: 501. - /// is null. - public NetworkFabricL2IsolationDomainData(AzureLocation location, ResourceIdentifier networkFabricId, int vlanId) : base(location) + /// The L2IsolationDomain properties. + /// is null. + public NetworkFabricL2IsolationDomainData(AzureLocation location, L2IsolationDomainProperties properties) : base(location) { - Argument.AssertNotNull(networkFabricId, nameof(networkFabricId)); + Argument.AssertNotNull(properties, nameof(properties)); - NetworkFabricId = networkFabricId; - VlanId = vlanId; + Properties = properties; } /// Initializes a new instance of . @@ -71,23 +69,11 @@ public NetworkFabricL2IsolationDomainData(AzureLocation location, ResourceIdenti /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// ARM Resource ID of the Network Fabric. - /// Vlan Identifier of the Network Fabric. Example: 501. - /// Maximum transmission unit. Default value is 1500. - /// Configuration state of the resource. - /// Provisioning state of the resource. - /// Administrative state of the resource. + /// The L2IsolationDomain properties. /// Keeps track of any properties unknown to the library. - internal NetworkFabricL2IsolationDomainData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, ResourceIdentifier networkFabricId, int vlanId, int? mtu, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NetworkFabricL2IsolationDomainData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, L2IsolationDomainProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - Annotation = annotation; - NetworkFabricId = networkFabricId; - VlanId = vlanId; - Mtu = mtu; - ConfigurationState = configurationState; - ProvisioningState = provisioningState; - AdministrativeState = administrativeState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -96,19 +82,7 @@ internal NetworkFabricL2IsolationDomainData() { } - /// Switch configuration description. - public string Annotation { get; set; } - /// ARM Resource ID of the Network Fabric. - public ResourceIdentifier NetworkFabricId { get; set; } - /// Vlan Identifier of the Network Fabric. Example: 501. - public int VlanId { get; set; } - /// Maximum transmission unit. Default value is 1500. - public int? Mtu { get; set; } - /// Configuration state of the resource. - public NetworkFabricConfigurationState? ConfigurationState { get; } - /// Provisioning state of the resource. - public NetworkFabricProvisioningState? ProvisioningState { get; } - /// Administrative state of the resource. - public NetworkFabricAdministrativeState? AdministrativeState { get; } + /// The L2IsolationDomain properties. + public L2IsolationDomainProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL2IsolationDomainResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL2IsolationDomainResource.cs index db08260d3523..c482ec32bf33 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL2IsolationDomainResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL2IsolationDomainResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -347,19 +347,19 @@ public virtual ArmOperation Update(WaitU } /// - /// Enables isolation domain across the fabric or on specified racks. + /// Commits the configuration of the given resources. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/updateAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/commitConfiguration /// /// /// Operation Id - /// L2IsolationDomains_UpdateAdministrativeState + /// L2IsolationDomains_CommitConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -368,19 +368,15 @@ public virtual ArmOperation Update(WaitU /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Request payload. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual async Task> CommitConfigurationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL2IsolationDomainResource.UpdateAdministrativeState"); + using var scope = _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL2IsolationDomainResource.CommitConfiguration"); scope.Start(); try { - var response = await _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.UpdateAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.CommitConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.CreateCommitConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -393,19 +389,19 @@ public virtual async Task> Upda } /// - /// Enables isolation domain across the fabric or on specified racks. + /// Commits the configuration of the given resources. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/updateAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/commitConfiguration /// /// /// Operation Id - /// L2IsolationDomains_UpdateAdministrativeState + /// L2IsolationDomains_CommitConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -414,19 +410,15 @@ public virtual async Task> Upda /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Request payload. /// The cancellation token to use. - /// is null. - public virtual ArmOperation UpdateAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation CommitConfiguration(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL2IsolationDomainResource.UpdateAdministrativeState"); + using var scope = _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL2IsolationDomainResource.CommitConfiguration"); scope.Start(); try { - var response = _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.UpdateAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.CommitConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.CreateCommitConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -439,19 +431,19 @@ public virtual ArmOperation UpdateAdministra } /// - /// Validates the configuration of the resources. + /// Enables isolation domain across the fabric or on specified racks. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/validateConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/updateAdministrativeState /// /// /// Operation Id - /// L2IsolationDomains_ValidateConfiguration + /// L2IsolationDomains_UpdateAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -460,15 +452,19 @@ public virtual ArmOperation UpdateAdministra /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. /// The cancellation token to use. - public virtual async Task> ValidateConfigurationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { - using var scope = _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL2IsolationDomainResource.ValidateConfiguration"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL2IsolationDomainResource.UpdateAdministrativeState"); scope.Start(); try { - var response = await _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.ValidateConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.CreateValidateConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.UpdateAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -481,19 +477,19 @@ public virtual async Task> ValidateCon } /// - /// Validates the configuration of the resources. + /// Enables isolation domain across the fabric or on specified racks. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/validateConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/updateAdministrativeState /// /// /// Operation Id - /// L2IsolationDomains_ValidateConfiguration + /// L2IsolationDomains_UpdateAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -502,15 +498,19 @@ public virtual async Task> ValidateCon /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. /// The cancellation token to use. - public virtual ArmOperation ValidateConfiguration(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation UpdateAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { - using var scope = _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL2IsolationDomainResource.ValidateConfiguration"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL2IsolationDomainResource.UpdateAdministrativeState"); scope.Start(); try { - var response = _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.ValidateConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.CreateValidateConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.UpdateAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -523,19 +523,19 @@ public virtual ArmOperation ValidateConfiguration(W } /// - /// Commits the configuration of the given resources. + /// Validates the configuration of the resources. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/commitConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/validateConfiguration /// /// /// Operation Id - /// L2IsolationDomains_CommitConfiguration + /// L2IsolationDomains_ValidateConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -545,14 +545,14 @@ public virtual ArmOperation ValidateConfiguration(W /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - public virtual async Task> CommitConfigurationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual async Task> ValidateConfigurationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL2IsolationDomainResource.CommitConfiguration"); + using var scope = _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL2IsolationDomainResource.ValidateConfiguration"); scope.Start(); try { - var response = await _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.CommitConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.CreateCommitConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.ValidateConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.CreateValidateConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -565,19 +565,19 @@ public virtual async Task> Commi } /// - /// Commits the configuration of the given resources. + /// Validates the configuration of the resources. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/commitConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/validateConfiguration /// /// /// Operation Id - /// L2IsolationDomains_CommitConfiguration + /// L2IsolationDomains_ValidateConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -587,14 +587,14 @@ public virtual async Task> Commi /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - public virtual ArmOperation CommitConfiguration(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual ArmOperation ValidateConfiguration(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL2IsolationDomainResource.CommitConfiguration"); + using var scope = _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL2IsolationDomainResource.ValidateConfiguration"); scope.Start(); try { - var response = _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.CommitConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.CreateCommitConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.ValidateConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL2IsolationDomainL2IsolationDomainsRestClient.CreateValidateConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -619,7 +619,7 @@ public virtual ArmOperation CommitConfigurati /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -681,7 +681,7 @@ public virtual async Task> AddT /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -743,7 +743,7 @@ public virtual Response AddTag(string ke /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -800,7 +800,7 @@ public virtual async Task> SetT /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -857,7 +857,7 @@ public virtual Response SetTags(IDiction /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -917,7 +917,7 @@ public virtual async Task> Remo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainCollection.cs index b96af48d120e..9cb42cad9782 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string l3Iso /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string l3IsolationDomainNa /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string l3IsolationDomainName, CancellationT /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainData.Serialization.cs index 9211b2f13897..48503b3877a7 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainData.Serialization.cs @@ -39,50 +39,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) - { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); - } - if (Optional.IsDefined(RedistributeConnectedSubnets)) - { - writer.WritePropertyName("redistributeConnectedSubnets"u8); - writer.WriteStringValue(RedistributeConnectedSubnets.Value.ToString()); - } - if (Optional.IsDefined(RedistributeStaticRoutes)) - { - writer.WritePropertyName("redistributeStaticRoutes"u8); - writer.WriteStringValue(RedistributeStaticRoutes.Value.ToString()); - } - if (Optional.IsDefined(AggregateRouteConfiguration)) - { - writer.WritePropertyName("aggregateRouteConfiguration"u8); - writer.WriteObjectValue(AggregateRouteConfiguration, options); - } - if (Optional.IsDefined(ConnectedSubnetRoutePolicy)) - { - writer.WritePropertyName("connectedSubnetRoutePolicy"u8); - writer.WriteObjectValue(ConnectedSubnetRoutePolicy, options); - } - writer.WritePropertyName("networkFabricId"u8); - writer.WriteStringValue(NetworkFabricId); - if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) - { - writer.WritePropertyName("configurationState"u8); - writer.WriteStringValue(ConfigurationState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) - { - writer.WritePropertyName("administrativeState"u8); - writer.WriteStringValue(AdministrativeState.Value.ToString()); - } - writer.WriteEndObject(); + writer.WriteObjectValue(Properties, options); } NetworkFabricL3IsolationDomainData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -105,25 +62,22 @@ internal static NetworkFabricL3IsolationDomainData DeserializeNetworkFabricL3Iso { return null; } + L3IsolationDomainProperties properties = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - string annotation = default; - RedistributeConnectedSubnet? redistributeConnectedSubnets = default; - RedistributeStaticRoute? redistributeStaticRoutes = default; - AggregateRouteConfiguration aggregateRouteConfiguration = default; - ConnectedSubnetRoutePolicy connectedSubnetRoutePolicy = default; - ResourceIdentifier networkFabricId = default; - NetworkFabricConfigurationState? configurationState = default; - NetworkFabricProvisioningState? provisioningState = default; - NetworkFabricAdministrativeState? administrativeState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + properties = L3IsolationDomainProperties.DeserializeL3IsolationDomainProperties(property.Value, options); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -167,91 +121,6 @@ internal static NetworkFabricL3IsolationDomainData DeserializeNetworkFabricL3Iso systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerManagedNetworkFabricContext.Default); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("redistributeConnectedSubnets"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - redistributeConnectedSubnets = new RedistributeConnectedSubnet(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("redistributeStaticRoutes"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - redistributeStaticRoutes = new RedistributeStaticRoute(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("aggregateRouteConfiguration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - aggregateRouteConfiguration = AggregateRouteConfiguration.DeserializeAggregateRouteConfiguration(property0.Value, options); - continue; - } - if (property0.NameEquals("connectedSubnetRoutePolicy"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - connectedSubnetRoutePolicy = ConnectedSubnetRoutePolicy.DeserializeConnectedSubnetRoutePolicy(property0.Value, options); - continue; - } - if (property0.NameEquals("networkFabricId"u8)) - { - networkFabricId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("configurationState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - configurationState = new NetworkFabricConfigurationState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkFabricProvisioningState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("administrativeState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - administrativeState = new NetworkFabricAdministrativeState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -265,15 +134,7 @@ internal static NetworkFabricL3IsolationDomainData DeserializeNetworkFabricL3Iso systemData, tags ?? new ChangeTrackingDictionary(), location, - annotation, - redistributeConnectedSubnets, - redistributeStaticRoutes, - aggregateRouteConfiguration, - connectedSubnetRoutePolicy, - networkFabricId, - configurationState, - provisioningState, - administrativeState, + properties, serializedAdditionalRawData); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainData.cs index 64ceaf2435d0..95e21fa8c7f8 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainData.cs @@ -53,13 +53,13 @@ public partial class NetworkFabricL3IsolationDomainData : TrackedResourceData /// Initializes a new instance of . /// The location. - /// ARM Resource ID of the Network Fabric. - /// is null. - public NetworkFabricL3IsolationDomainData(AzureLocation location, ResourceIdentifier networkFabricId) : base(location) + /// The L3 Isolation Domain Properties. + /// is null. + public NetworkFabricL3IsolationDomainData(AzureLocation location, L3IsolationDomainProperties properties) : base(location) { - Argument.AssertNotNull(networkFabricId, nameof(networkFabricId)); + Argument.AssertNotNull(properties, nameof(properties)); - NetworkFabricId = networkFabricId; + Properties = properties; } /// Initializes a new instance of . @@ -69,27 +69,11 @@ public NetworkFabricL3IsolationDomainData(AzureLocation location, ResourceIdenti /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// Advertise Connected Subnets. Ex: "True" | "False". - /// Advertise Static Routes. Ex: "True" | "False". - /// Aggregate route configurations. - /// Connected Subnet RoutePolicy. - /// ARM Resource ID of the Network Fabric. - /// Configuration state of the resource. - /// Provisioning state of the resource. - /// Administrative state of the resource. + /// The L3 Isolation Domain Properties. /// Keeps track of any properties unknown to the library. - internal NetworkFabricL3IsolationDomainData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, RedistributeConnectedSubnet? redistributeConnectedSubnets, RedistributeStaticRoute? redistributeStaticRoutes, AggregateRouteConfiguration aggregateRouteConfiguration, ConnectedSubnetRoutePolicy connectedSubnetRoutePolicy, ResourceIdentifier networkFabricId, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NetworkFabricL3IsolationDomainData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, L3IsolationDomainProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - Annotation = annotation; - RedistributeConnectedSubnets = redistributeConnectedSubnets; - RedistributeStaticRoutes = redistributeStaticRoutes; - AggregateRouteConfiguration = aggregateRouteConfiguration; - ConnectedSubnetRoutePolicy = connectedSubnetRoutePolicy; - NetworkFabricId = networkFabricId; - ConfigurationState = configurationState; - ProvisioningState = provisioningState; - AdministrativeState = administrativeState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -98,23 +82,7 @@ internal NetworkFabricL3IsolationDomainData() { } - /// Switch configuration description. - public string Annotation { get; set; } - /// Advertise Connected Subnets. Ex: "True" | "False". - public RedistributeConnectedSubnet? RedistributeConnectedSubnets { get; set; } - /// Advertise Static Routes. Ex: "True" | "False". - public RedistributeStaticRoute? RedistributeStaticRoutes { get; set; } - /// Aggregate route configurations. - public AggregateRouteConfiguration AggregateRouteConfiguration { get; set; } - /// Connected Subnet RoutePolicy. - public ConnectedSubnetRoutePolicy ConnectedSubnetRoutePolicy { get; set; } - /// ARM Resource ID of the Network Fabric. - public ResourceIdentifier NetworkFabricId { get; set; } - /// Configuration state of the resource. - public NetworkFabricConfigurationState? ConfigurationState { get; } - /// Provisioning state of the resource. - public NetworkFabricProvisioningState? ProvisioningState { get; } - /// Administrative state of the resource. - public NetworkFabricAdministrativeState? AdministrativeState { get; } + /// The L3 Isolation Domain Properties. + public L3IsolationDomainProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainResource.cs index 07dc39dc2571..309833baeac3 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainResource.cs @@ -90,142 +90,142 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } - /// Gets a collection of NetworkFabricInternalNetworkResources in the NetworkFabricL3IsolationDomain. - /// An object representing collection of NetworkFabricInternalNetworkResources and their operations over a NetworkFabricInternalNetworkResource. - public virtual NetworkFabricInternalNetworkCollection GetNetworkFabricInternalNetworks() + /// Gets a collection of NetworkFabricExternalNetworkResources in the NetworkFabricL3IsolationDomain. + /// An object representing collection of NetworkFabricExternalNetworkResources and their operations over a NetworkFabricExternalNetworkResource. + public virtual NetworkFabricExternalNetworkCollection GetNetworkFabricExternalNetworks() { - return GetCachedClient(client => new NetworkFabricInternalNetworkCollection(client, Id)); + return GetCachedClient(client => new NetworkFabricExternalNetworkCollection(client, Id)); } /// - /// Gets a InternalNetworks. + /// Implements ExternalNetworks GET method. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName} /// /// /// Operation Id - /// InternalNetworks_Get + /// ExternalNetworks_Get /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// - /// Name of the Internal Network. + /// Name of the External Network. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetNetworkFabricInternalNetworkAsync(string internalNetworkName, CancellationToken cancellationToken = default) + public virtual async Task> GetNetworkFabricExternalNetworkAsync(string externalNetworkName, CancellationToken cancellationToken = default) { - return await GetNetworkFabricInternalNetworks().GetAsync(internalNetworkName, cancellationToken).ConfigureAwait(false); + return await GetNetworkFabricExternalNetworks().GetAsync(externalNetworkName, cancellationToken).ConfigureAwait(false); } /// - /// Gets a InternalNetworks. + /// Implements ExternalNetworks GET method. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName} /// /// /// Operation Id - /// InternalNetworks_Get + /// ExternalNetworks_Get /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// - /// Name of the Internal Network. + /// Name of the External Network. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetNetworkFabricInternalNetwork(string internalNetworkName, CancellationToken cancellationToken = default) + public virtual Response GetNetworkFabricExternalNetwork(string externalNetworkName, CancellationToken cancellationToken = default) { - return GetNetworkFabricInternalNetworks().Get(internalNetworkName, cancellationToken); + return GetNetworkFabricExternalNetworks().Get(externalNetworkName, cancellationToken); } - /// Gets a collection of NetworkFabricExternalNetworkResources in the NetworkFabricL3IsolationDomain. - /// An object representing collection of NetworkFabricExternalNetworkResources and their operations over a NetworkFabricExternalNetworkResource. - public virtual NetworkFabricExternalNetworkCollection GetNetworkFabricExternalNetworks() + /// Gets a collection of NetworkFabricInternalNetworkResources in the NetworkFabricL3IsolationDomain. + /// An object representing collection of NetworkFabricInternalNetworkResources and their operations over a NetworkFabricInternalNetworkResource. + public virtual NetworkFabricInternalNetworkCollection GetNetworkFabricInternalNetworks() { - return GetCachedClient(client => new NetworkFabricExternalNetworkCollection(client, Id)); + return GetCachedClient(client => new NetworkFabricInternalNetworkCollection(client, Id)); } /// - /// Implements ExternalNetworks GET method. + /// Gets a InternalNetworks. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName} /// /// /// Operation Id - /// ExternalNetworks_Get + /// InternalNetworks_Get /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// - /// Name of the External Network. + /// Name of the Internal Network. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetNetworkFabricExternalNetworkAsync(string externalNetworkName, CancellationToken cancellationToken = default) + public virtual async Task> GetNetworkFabricInternalNetworkAsync(string internalNetworkName, CancellationToken cancellationToken = default) { - return await GetNetworkFabricExternalNetworks().GetAsync(externalNetworkName, cancellationToken).ConfigureAwait(false); + return await GetNetworkFabricInternalNetworks().GetAsync(internalNetworkName, cancellationToken).ConfigureAwait(false); } /// - /// Implements ExternalNetworks GET method. + /// Gets a InternalNetworks. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName} /// /// /// Operation Id - /// ExternalNetworks_Get + /// InternalNetworks_Get /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource - /// + /// /// /// /// - /// Name of the External Network. + /// Name of the Internal Network. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetNetworkFabricExternalNetwork(string externalNetworkName, CancellationToken cancellationToken = default) + public virtual Response GetNetworkFabricInternalNetwork(string internalNetworkName, CancellationToken cancellationToken = default) { - return GetNetworkFabricExternalNetworks().Get(externalNetworkName, cancellationToken); + return GetNetworkFabricInternalNetworks().Get(internalNetworkName, cancellationToken); } /// @@ -241,7 +241,7 @@ public virtual Response GetNetworkFabricEx /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -281,7 +281,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -321,7 +321,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -363,7 +363,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -405,7 +405,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -451,7 +451,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -485,19 +485,19 @@ public virtual ArmOperation Update(WaitU } /// - /// Enables racks for this Isolation Domain. + /// Commits the configuration of the given resources. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/updateAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/commitConfiguration /// /// /// Operation Id - /// L3IsolationDomains_UpdateAdministrativeState + /// L3IsolationDomains_CommitConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -506,19 +506,15 @@ public virtual ArmOperation Update(WaitU /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Request payload. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual async Task> CommitConfigurationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL3IsolationDomainResource.UpdateAdministrativeState"); + using var scope = _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL3IsolationDomainResource.CommitConfiguration"); scope.Start(); try { - var response = await _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.UpdateAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.CommitConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.CreateCommitConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -531,19 +527,19 @@ public virtual async Task> Upda } /// - /// Enables racks for this Isolation Domain. + /// Commits the configuration of the given resources. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/updateAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/commitConfiguration /// /// /// Operation Id - /// L3IsolationDomains_UpdateAdministrativeState + /// L3IsolationDomains_CommitConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -552,19 +548,15 @@ public virtual async Task> Upda /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Request payload. /// The cancellation token to use. - /// is null. - public virtual ArmOperation UpdateAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation CommitConfiguration(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL3IsolationDomainResource.UpdateAdministrativeState"); + using var scope = _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL3IsolationDomainResource.CommitConfiguration"); scope.Start(); try { - var response = _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.UpdateAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.CommitConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.CreateCommitConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -577,19 +569,19 @@ public virtual ArmOperation UpdateAdministra } /// - /// Validates the configuration of the resources. + /// Enables racks for this Isolation Domain. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/validateConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/updateAdministrativeState /// /// /// Operation Id - /// L3IsolationDomains_ValidateConfiguration + /// L3IsolationDomains_UpdateAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -598,15 +590,19 @@ public virtual ArmOperation UpdateAdministra /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. /// The cancellation token to use. - public virtual async Task> ValidateConfigurationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { - using var scope = _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL3IsolationDomainResource.ValidateConfiguration"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL3IsolationDomainResource.UpdateAdministrativeState"); scope.Start(); try { - var response = await _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.ValidateConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.CreateValidateConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.UpdateAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -619,19 +615,19 @@ public virtual async Task> ValidateCon } /// - /// Validates the configuration of the resources. + /// Enables racks for this Isolation Domain. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/validateConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/updateAdministrativeState /// /// /// Operation Id - /// L3IsolationDomains_ValidateConfiguration + /// L3IsolationDomains_UpdateAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -640,15 +636,19 @@ public virtual async Task> ValidateCon /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. /// The cancellation token to use. - public virtual ArmOperation ValidateConfiguration(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation UpdateAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { - using var scope = _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL3IsolationDomainResource.ValidateConfiguration"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL3IsolationDomainResource.UpdateAdministrativeState"); scope.Start(); try { - var response = _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.ValidateConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.CreateValidateConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.UpdateAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -661,19 +661,19 @@ public virtual ArmOperation ValidateConfiguration(W } /// - /// Commits the configuration of the given resources. + /// Validates the configuration of the resources. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/commitConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/validateConfiguration /// /// /// Operation Id - /// L3IsolationDomains_CommitConfiguration + /// L3IsolationDomains_ValidateConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -683,14 +683,14 @@ public virtual ArmOperation ValidateConfiguration(W /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - public virtual async Task> CommitConfigurationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual async Task> ValidateConfigurationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL3IsolationDomainResource.CommitConfiguration"); + using var scope = _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL3IsolationDomainResource.ValidateConfiguration"); scope.Start(); try { - var response = await _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.CommitConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.CreateCommitConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.ValidateConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.CreateValidateConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -703,19 +703,19 @@ public virtual async Task> Commi } /// - /// Commits the configuration of the given resources. + /// Validates the configuration of the resources. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/commitConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/validateConfiguration /// /// /// Operation Id - /// L3IsolationDomains_CommitConfiguration + /// L3IsolationDomains_ValidateConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -725,14 +725,14 @@ public virtual async Task> Commi /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - public virtual ArmOperation CommitConfiguration(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual ArmOperation ValidateConfiguration(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL3IsolationDomainResource.CommitConfiguration"); + using var scope = _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics.CreateScope("NetworkFabricL3IsolationDomainResource.ValidateConfiguration"); scope.Start(); try { - var response = _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.CommitConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.CreateCommitConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.ValidateConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics, Pipeline, _networkFabricL3IsolationDomainL3IsolationDomainsRestClient.CreateValidateConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -757,7 +757,7 @@ public virtual ArmOperation CommitConfigurati /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -819,7 +819,7 @@ public virtual async Task> AddT /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -881,7 +881,7 @@ public virtual Response AddTag(string ke /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -938,7 +938,7 @@ public virtual async Task> SetT /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -995,7 +995,7 @@ public virtual Response SetTags(IDiction /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1055,7 +1055,7 @@ public virtual async Task> Remo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricNeighborGroupCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricNeighborGroupCollection.cs index 52e5fd46b164..cb0b7b014c64 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricNeighborGroupCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricNeighborGroupCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Crea /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(W /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string neighborG /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Can /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationT /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string neighborGroupName, /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string neighborGroupName, CancellationToken /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricNeighborGroupData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricNeighborGroupData.Serialization.cs index ecfe7007c4b5..89106b72ebf4 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricNeighborGroupData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricNeighborGroupData.Serialization.cs @@ -39,53 +39,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) - { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); - } - if (Optional.IsDefined(Destination)) - { - writer.WritePropertyName("destination"u8); - writer.WriteObjectValue(Destination, options); - } - if (options.Format != "W" && Optional.IsCollectionDefined(NetworkTapIds)) - { - writer.WritePropertyName("networkTapIds"u8); - writer.WriteStartArray(); - foreach (var item in NetworkTapIds) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsCollectionDefined(NetworkTapRuleIds)) - { - writer.WritePropertyName("networkTapRuleIds"u8); - writer.WriteStartArray(); - foreach (var item in NetworkTapRuleIds) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - writer.WriteEndObject(); + writer.WriteObjectValue(Properties, options); } NetworkFabricNeighborGroupData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -108,21 +62,22 @@ internal static NetworkFabricNeighborGroupData DeserializeNetworkFabricNeighborG { return null; } + NeighborGroupProperties properties = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - string annotation = default; - NeighborGroupDestination destination = default; - IReadOnlyList networkTapIds = default; - IReadOnlyList networkTapRuleIds = default; - NetworkFabricProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + properties = NeighborGroupProperties.DeserializeNeighborGroupProperties(property.Value, options); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -166,83 +121,6 @@ internal static NetworkFabricNeighborGroupData DeserializeNetworkFabricNeighborG systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerManagedNetworkFabricContext.Default); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("destination"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - destination = NeighborGroupDestination.DeserializeNeighborGroupDestination(property0.Value, options); - continue; - } - if (property0.NameEquals("networkTapIds"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } - } - networkTapIds = array; - continue; - } - if (property0.NameEquals("networkTapRuleIds"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } - } - networkTapRuleIds = array; - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkFabricProvisioningState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -256,11 +134,7 @@ internal static NetworkFabricNeighborGroupData DeserializeNetworkFabricNeighborG systemData, tags ?? new ChangeTrackingDictionary(), location, - annotation, - destination, - networkTapIds ?? new ChangeTrackingList(), - networkTapRuleIds ?? new ChangeTrackingList(), - provisioningState, + properties, serializedAdditionalRawData); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricNeighborGroupData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricNeighborGroupData.cs index 73e3b9184cb1..6ddf01da9319 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricNeighborGroupData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricNeighborGroupData.cs @@ -53,10 +53,13 @@ public partial class NetworkFabricNeighborGroupData : TrackedResourceData /// Initializes a new instance of . /// The location. - public NetworkFabricNeighborGroupData(AzureLocation location) : base(location) + /// The NeighborGroup Properties. + /// is null. + public NetworkFabricNeighborGroupData(AzureLocation location, NeighborGroupProperties properties) : base(location) { - NetworkTapIds = new ChangeTrackingList(); - NetworkTapRuleIds = new ChangeTrackingList(); + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; } /// Initializes a new instance of . @@ -66,19 +69,11 @@ public NetworkFabricNeighborGroupData(AzureLocation location) : base(location) /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// An array of destination IPv4 Addresses or IPv6 Addresses. - /// List of NetworkTap IDs where neighbor group is associated. - /// List of Network Tap Rule IDs where neighbor group is associated. - /// The provisioning state of the resource. + /// The NeighborGroup Properties. /// Keeps track of any properties unknown to the library. - internal NetworkFabricNeighborGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, NeighborGroupDestination destination, IReadOnlyList networkTapIds, IReadOnlyList networkTapRuleIds, NetworkFabricProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NetworkFabricNeighborGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, NeighborGroupProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - Annotation = annotation; - Destination = destination; - NetworkTapIds = networkTapIds; - NetworkTapRuleIds = networkTapRuleIds; - ProvisioningState = provisioningState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,15 +82,7 @@ internal NetworkFabricNeighborGroupData() { } - /// Switch configuration description. - public string Annotation { get; set; } - /// An array of destination IPv4 Addresses or IPv6 Addresses. - public NeighborGroupDestination Destination { get; set; } - /// List of NetworkTap IDs where neighbor group is associated. - public IReadOnlyList NetworkTapIds { get; } - /// List of Network Tap Rule IDs where neighbor group is associated. - public IReadOnlyList NetworkTapRuleIds { get; } - /// The provisioning state of the resource. - public NetworkFabricProvisioningState? ProvisioningState { get; } + /// The NeighborGroup Properties. + public NeighborGroupProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricNeighborGroupResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricNeighborGroupResource.cs index a5eee6531c52..a886232455f1 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricNeighborGroupResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricNeighborGroupResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToke /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> Upda /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUntil /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -421,7 +421,7 @@ public virtual async Task> AddTagAs /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -483,7 +483,7 @@ public virtual Response AddTag(string key, s /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -540,7 +540,7 @@ public virtual async Task> SetTagsA /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -597,7 +597,7 @@ public virtual Response SetTags(IDictionary< /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task> RemoveTa /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricResource.cs index e50c2f6b7983..ccfaff4a6600 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricResource.cs @@ -110,7 +110,7 @@ public virtual NetworkToNetworkInterconnectCollection GetNetworkToNetworkInterco /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetNet /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -172,7 +172,7 @@ public virtual Response GetNetworkToNetwor /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(Cancellation /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(CancellationToken cancellatio /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -336,7 +336,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -382,7 +382,7 @@ public virtual async Task> UpdateAsync(WaitU /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -416,19 +416,409 @@ public virtual ArmOperation Update(WaitUntil waitUntil, N } /// - /// Provisions the underlying resources in the given Network Fabric instance. + /// Post action: Triggers diff of NetworkFabric ARM Configuration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/armConfigurationDiff + /// + /// + /// Operation Id + /// NetworkFabrics_ArmConfigurationDiff + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task> ArmConfigurationDiffAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.ArmConfigurationDiff"); + scope.Start(); + try + { + var response = await _networkFabricRestClient.ArmConfigurationDiffAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new ArmConfigurationDiffResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateArmConfigurationDiffRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Post action: Triggers diff of NetworkFabric ARM Configuration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/armConfigurationDiff + /// + /// + /// Operation Id + /// NetworkFabrics_ArmConfigurationDiff + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation ArmConfigurationDiff(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.ArmConfigurationDiff"); + scope.Start(); + try + { + var response = _networkFabricRestClient.ArmConfigurationDiff(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new ArmConfigurationDiffResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateArmConfigurationDiffRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Post action: Returns a status of commit batch operation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/commitBatchStatus + /// + /// + /// Operation Id + /// NetworkFabrics_CommitBatchStatus + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. + /// The cancellation token to use. + /// is null. + public virtual async Task> CommitBatchStatusAsync(WaitUntil waitUntil, CommitBatchStatusContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.CommitBatchStatus"); + scope.Start(); + try + { + var response = await _networkFabricRestClient.CommitBatchStatusAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new CommitBatchStatusResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateCommitBatchStatusRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Post action: Returns a status of commit batch operation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/commitBatchStatus + /// + /// + /// Operation Id + /// NetworkFabrics_CommitBatchStatus + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation CommitBatchStatus(WaitUntil waitUntil, CommitBatchStatusContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.CommitBatchStatus"); + scope.Start(); + try + { + var response = _networkFabricRestClient.CommitBatchStatus(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new CommitBatchStatusResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateCommitBatchStatusRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric level. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/commitConfiguration + /// + /// + /// Operation Id + /// NetworkFabrics_CommitConfiguration + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task> CommitConfigurationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.CommitConfiguration"); + scope.Start(); + try + { + var response = await _networkFabricRestClient.CommitConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateCommitConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric level. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/commitConfiguration + /// + /// + /// Operation Id + /// NetworkFabrics_CommitConfiguration + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation CommitConfiguration(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.CommitConfiguration"); + scope.Start(); + try + { + var response = _networkFabricRestClient.CommitConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateCommitConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deprovisions the underlying resources in the given Network Fabric instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/deprovision + /// + /// + /// Operation Id + /// NetworkFabrics_Deprovision + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task> DeprovisionAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.Deprovision"); + scope.Start(); + try + { + var response = await _networkFabricRestClient.DeprovisionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateDeprovisionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deprovisions the underlying resources in the given Network Fabric instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/deprovision + /// + /// + /// Operation Id + /// NetworkFabrics_Deprovision + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Deprovision(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.Deprovision"); + scope.Start(); + try + { + var response = _networkFabricRestClient.Deprovision(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateDeprovisionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Post action: Discards a Batch operation in progress. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/discardCommitBatch + /// + /// + /// Operation Id + /// NetworkFabrics_DiscardCommitBatch + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. + /// The cancellation token to use. + /// is null. + public virtual async Task> DiscardCommitBatchAsync(WaitUntil waitUntil, DiscardCommitBatchContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.DiscardCommitBatch"); + scope.Start(); + try + { + var response = await _networkFabricRestClient.DiscardCommitBatchAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new DiscardCommitBatchResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateDiscardCommitBatchRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Post action: Discards a Batch operation in progress. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/provision + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/discardCommitBatch /// /// /// Operation Id - /// NetworkFabrics_Provision + /// NetworkFabrics_DiscardCommitBatch /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -437,15 +827,61 @@ public virtual ArmOperation Update(WaitUntil waitUntil, N /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. /// The cancellation token to use. - public virtual async Task> ProvisionAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation DiscardCommitBatch(WaitUntil waitUntil, DiscardCommitBatchContent content, CancellationToken cancellationToken = default) { - using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.Provision"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.DiscardCommitBatch"); scope.Start(); try { - var response = await _networkFabricRestClient.ProvisionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateProvisionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricRestClient.DiscardCommitBatch(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new DiscardCommitBatchResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateDiscardCommitBatchRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets Topology of the underlying resources in the given Network Fabric instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/getTopology + /// + /// + /// Operation Id + /// NetworkFabrics_GetTopology + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task> GetTopologyAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.GetTopology"); + scope.Start(); + try + { + var response = await _networkFabricRestClient.GetTopologyAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateGetTopologyRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -458,19 +894,19 @@ public virtual async Task> Prov } /// - /// Provisions the underlying resources in the given Network Fabric instance. + /// Gets Topology of the underlying resources in the given Network Fabric instance. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/provision + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/getTopology /// /// /// Operation Id - /// NetworkFabrics_Provision + /// NetworkFabrics_GetTopology /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -480,14 +916,14 @@ public virtual async Task> Prov /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - public virtual ArmOperation Provision(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual ArmOperation GetTopology(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.Provision"); + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.GetTopology"); scope.Start(); try { - var response = _networkFabricRestClient.Provision(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateProvisionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricRestClient.GetTopology(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateGetTopologyRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -500,19 +936,19 @@ public virtual ArmOperation Provision(WaitUn } /// - /// Deprovisions the underlying resources in the given Network Fabric instance. + /// Post action: Triggers network fabric lock operation. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/deprovision + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/lockFabric /// /// /// Operation Id - /// NetworkFabrics_Deprovision + /// NetworkFabrics_LockFabric /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -521,15 +957,19 @@ public virtual ArmOperation Provision(WaitUn /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. /// The cancellation token to use. - public virtual async Task> DeprovisionAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> LockFabricAsync(WaitUntil waitUntil, NetworkFabricLockContent content, CancellationToken cancellationToken = default) { - using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.Deprovision"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.LockFabric"); scope.Start(); try { - var response = await _networkFabricRestClient.DeprovisionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateDeprovisionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricRestClient.LockFabricAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateLockFabricRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -542,19 +982,19 @@ public virtual async Task> Depr } /// - /// Deprovisions the underlying resources in the given Network Fabric instance. + /// Post action: Triggers network fabric lock operation. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/deprovision + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/lockFabric /// /// /// Operation Id - /// NetworkFabrics_Deprovision + /// NetworkFabrics_LockFabric /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -563,15 +1003,19 @@ public virtual async Task> Depr /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. /// The cancellation token to use. - public virtual ArmOperation Deprovision(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation LockFabric(WaitUntil waitUntil, NetworkFabricLockContent content, CancellationToken cancellationToken = default) { - using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.Deprovision"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.LockFabric"); scope.Start(); try { - var response = _networkFabricRestClient.Deprovision(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateDeprovisionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricRestClient.LockFabric(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateLockFabricRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -584,19 +1028,19 @@ public virtual ArmOperation Deprovision(Wait } /// - /// Upgrades the version of the underlying resources in the given Network Fabric instance. + /// Provisions the underlying resources in the given Network Fabric instance. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/upgrade + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/provision /// /// /// Operation Id - /// NetworkFabrics_Upgrade + /// NetworkFabrics_Provision /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -605,19 +1049,15 @@ public virtual ArmOperation Deprovision(Wait /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Network Fabric properties to update. /// The cancellation token to use. - /// is null. - public virtual async Task> UpgradeAsync(WaitUntil waitUntil, NetworkFabricUpdateVersionContent content, CancellationToken cancellationToken = default) + public virtual async Task> ProvisionAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.Upgrade"); + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.Provision"); scope.Start(); try { - var response = await _networkFabricRestClient.UpgradeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateUpgradeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricRestClient.ProvisionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateProvisionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -630,19 +1070,19 @@ public virtual async Task> Upgra } /// - /// Upgrades the version of the underlying resources in the given Network Fabric instance. + /// Provisions the underlying resources in the given Network Fabric instance. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/upgrade + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/provision /// /// /// Operation Id - /// NetworkFabrics_Upgrade + /// NetworkFabrics_Provision /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -651,19 +1091,15 @@ public virtual async Task> Upgra /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Network Fabric properties to update. /// The cancellation token to use. - /// is null. - public virtual ArmOperation Upgrade(WaitUntil waitUntil, NetworkFabricUpdateVersionContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation Provision(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.Upgrade"); + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.Provision"); scope.Start(); try { - var response = _networkFabricRestClient.Upgrade(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateUpgradeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricRestClient.Provision(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateProvisionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -688,7 +1124,7 @@ public virtual ArmOperation Upgrade(WaitUntil /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -730,7 +1166,7 @@ public virtual async Task> Refre /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -760,19 +1196,19 @@ public virtual ArmOperation RefreshConfigurat } /// - /// Updates the Workload Management BFD Configuration of the underlying resources in the given Network Fabric instance. + /// Updates the Infra Management BFD Configuration of the underlying resources in the given Network Fabric instance. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateWorkloadManagementBfdConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateInfraManagementBfdConfiguration /// /// /// Operation Id - /// NetworkFabrics_UpdateWorkloadManagementBfdConfiguration + /// NetworkFabrics_UpdateInfraManagementBfdConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -784,16 +1220,16 @@ public virtual ArmOperation RefreshConfigurat /// Request payload. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateWorkloadManagementBfdConfigurationAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual async Task> UpdateInfraManagementBfdConfigurationAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.UpdateWorkloadManagementBfdConfiguration"); + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.UpdateInfraManagementBfdConfiguration"); scope.Start(); try { - var response = await _networkFabricRestClient.UpdateWorkloadManagementBfdConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateUpdateWorkloadManagementBfdConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricRestClient.UpdateInfraManagementBfdConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateUpdateInfraManagementBfdConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -806,19 +1242,19 @@ public virtual async Task> Updat } /// - /// Updates the Workload Management BFD Configuration of the underlying resources in the given Network Fabric instance. + /// Updates the Infra Management BFD Configuration of the underlying resources in the given Network Fabric instance. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateWorkloadManagementBfdConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateInfraManagementBfdConfiguration /// /// /// Operation Id - /// NetworkFabrics_UpdateWorkloadManagementBfdConfiguration + /// NetworkFabrics_UpdateInfraManagementBfdConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -830,16 +1266,16 @@ public virtual async Task> Updat /// Request payload. /// The cancellation token to use. /// is null. - public virtual ArmOperation UpdateWorkloadManagementBfdConfiguration(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation UpdateInfraManagementBfdConfiguration(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.UpdateWorkloadManagementBfdConfiguration"); + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.UpdateInfraManagementBfdConfiguration"); scope.Start(); try { - var response = _networkFabricRestClient.UpdateWorkloadManagementBfdConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateUpdateWorkloadManagementBfdConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricRestClient.UpdateInfraManagementBfdConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateUpdateInfraManagementBfdConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -852,19 +1288,19 @@ public virtual ArmOperation UpdateWorkloadMan } /// - /// Updates the Infra Management BFD Configuration of the underlying resources in the given Network Fabric instance. + /// Updates the Workload Management BFD Configuration of the underlying resources in the given Network Fabric instance. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateInfraManagementBfdConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateWorkloadManagementBfdConfiguration /// /// /// Operation Id - /// NetworkFabrics_UpdateInfraManagementBfdConfiguration + /// NetworkFabrics_UpdateWorkloadManagementBfdConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -876,16 +1312,16 @@ public virtual ArmOperation UpdateWorkloadMan /// Request payload. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateInfraManagementBfdConfigurationAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual async Task> UpdateWorkloadManagementBfdConfigurationAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.UpdateInfraManagementBfdConfiguration"); + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.UpdateWorkloadManagementBfdConfiguration"); scope.Start(); try { - var response = await _networkFabricRestClient.UpdateInfraManagementBfdConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateUpdateInfraManagementBfdConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricRestClient.UpdateWorkloadManagementBfdConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateUpdateWorkloadManagementBfdConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -898,19 +1334,19 @@ public virtual async Task> Updat } /// - /// Updates the Infra Management BFD Configuration of the underlying resources in the given Network Fabric instance. + /// Updates the Workload Management BFD Configuration of the underlying resources in the given Network Fabric instance. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateInfraManagementBfdConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateWorkloadManagementBfdConfiguration /// /// /// Operation Id - /// NetworkFabrics_UpdateInfraManagementBfdConfiguration + /// NetworkFabrics_UpdateWorkloadManagementBfdConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -922,16 +1358,16 @@ public virtual async Task> Updat /// Request payload. /// The cancellation token to use. /// is null. - public virtual ArmOperation UpdateInfraManagementBfdConfiguration(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation UpdateWorkloadManagementBfdConfiguration(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.UpdateInfraManagementBfdConfiguration"); + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.UpdateWorkloadManagementBfdConfiguration"); scope.Start(); try { - var response = _networkFabricRestClient.UpdateInfraManagementBfdConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateUpdateInfraManagementBfdConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricRestClient.UpdateWorkloadManagementBfdConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateUpdateWorkloadManagementBfdConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -944,19 +1380,19 @@ public virtual ArmOperation UpdateInfraManage } /// - /// Validates the configuration of the underlying resources in the given Network Fabric instance. + /// Upgrades the version of the underlying resources in the given Network Fabric instance. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/validateConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/upgrade /// /// /// Operation Id - /// NetworkFabrics_ValidateConfiguration + /// NetworkFabrics_Upgrade /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -965,19 +1401,19 @@ public virtual ArmOperation UpdateInfraManage /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Validate configuration properties. + /// Network Fabric properties to update. /// The cancellation token to use. - /// is null. - public virtual async Task> ValidateConfigurationAsync(WaitUntil waitUntil, ValidateConfigurationContent content, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpgradeAsync(WaitUntil waitUntil, UpgradeNetworkFabricProperties body, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(body, nameof(body)); - using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.ValidateConfiguration"); + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.Upgrade"); scope.Start(); try { - var response = await _networkFabricRestClient.ValidateConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateValidateConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricRestClient.UpgradeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateUpgradeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -990,19 +1426,19 @@ public virtual async Task> ValidateCon } /// - /// Validates the configuration of the underlying resources in the given Network Fabric instance. + /// Upgrades the version of the underlying resources in the given Network Fabric instance. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/validateConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/upgrade /// /// /// Operation Id - /// NetworkFabrics_ValidateConfiguration + /// NetworkFabrics_Upgrade /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1011,19 +1447,19 @@ public virtual async Task> ValidateCon /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Validate configuration properties. + /// Network Fabric properties to update. /// The cancellation token to use. - /// is null. - public virtual ArmOperation ValidateConfiguration(WaitUntil waitUntil, ValidateConfigurationContent content, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation Upgrade(WaitUntil waitUntil, UpgradeNetworkFabricProperties body, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(body, nameof(body)); - using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.ValidateConfiguration"); + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.Upgrade"); scope.Start(); try { - var response = _networkFabricRestClient.ValidateConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateValidateConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricRestClient.Upgrade(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateUpgradeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -1036,19 +1472,19 @@ public virtual ArmOperation ValidateConfiguration(W } /// - /// Gets Topology of the underlying resources in the given Network Fabric instance. + /// Validates the configuration of the underlying resources in the given Network Fabric instance. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/getTopology + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/validateConfiguration /// /// /// Operation Id - /// NetworkFabrics_GetTopology + /// NetworkFabrics_ValidateConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1057,15 +1493,19 @@ public virtual ArmOperation ValidateConfiguration(W /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Validate configuration properties. /// The cancellation token to use. - public virtual async Task> GetTopologyAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> ValidateConfigurationAsync(WaitUntil waitUntil, ValidateConfigurationContent content, CancellationToken cancellationToken = default) { - using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.GetTopology"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.ValidateConfiguration"); scope.Start(); try { - var response = await _networkFabricRestClient.GetTopologyAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateGetTopologyRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricRestClient.ValidateConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateValidateConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -1078,19 +1518,19 @@ public virtual async Task> GetTopology } /// - /// Gets Topology of the underlying resources in the given Network Fabric instance. + /// Validates the configuration of the underlying resources in the given Network Fabric instance. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/getTopology + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/validateConfiguration /// /// /// Operation Id - /// NetworkFabrics_GetTopology + /// NetworkFabrics_ValidateConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1099,15 +1539,19 @@ public virtual async Task> GetTopology /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Validate configuration properties. /// The cancellation token to use. - public virtual ArmOperation GetTopology(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation ValidateConfiguration(WaitUntil waitUntil, ValidateConfigurationContent content, CancellationToken cancellationToken = default) { - using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.GetTopology"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.ValidateConfiguration"); scope.Start(); try { - var response = _networkFabricRestClient.GetTopology(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateGetTopologyRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricRestClient.ValidateConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateValidateConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -1120,19 +1564,19 @@ public virtual ArmOperation GetTopology(WaitUntil w } /// - /// Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric level. + /// Post action: Triggers view of network fabric configuration. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/commitConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/viewDeviceConfiguration /// /// /// Operation Id - /// NetworkFabrics_CommitConfiguration + /// NetworkFabrics_ViewDeviceConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1142,14 +1586,14 @@ public virtual ArmOperation GetTopology(WaitUntil w /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - public virtual async Task> CommitConfigurationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual async Task> ViewDeviceConfigurationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.CommitConfiguration"); + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.ViewDeviceConfiguration"); scope.Start(); try { - var response = await _networkFabricRestClient.CommitConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateCommitConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricRestClient.ViewDeviceConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new ViewDeviceConfigurationResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateViewDeviceConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -1162,19 +1606,19 @@ public virtual async Task> Commi } /// - /// Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric level. + /// Post action: Triggers view of network fabric configuration. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/commitConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/viewDeviceConfiguration /// /// /// Operation Id - /// NetworkFabrics_CommitConfiguration + /// NetworkFabrics_ViewDeviceConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1184,14 +1628,14 @@ public virtual async Task> Commi /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - public virtual ArmOperation CommitConfiguration(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual ArmOperation ViewDeviceConfiguration(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.CommitConfiguration"); + using var scope = _networkFabricClientDiagnostics.CreateScope("NetworkFabricResource.ViewDeviceConfiguration"); scope.Start(); try { - var response = _networkFabricRestClient.CommitConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateCommitConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricRestClient.ViewDeviceConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new ViewDeviceConfigurationResultOperationSource(), _networkFabricClientDiagnostics, Pipeline, _networkFabricRestClient.CreateViewDeviceConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -1216,7 +1660,7 @@ public virtual ArmOperation CommitConfigurati /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1278,7 +1722,7 @@ public virtual async Task> AddTagAsync(string ke /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1340,7 +1784,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1397,7 +1841,7 @@ public virtual async Task> SetTagsAsync(IDiction /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1454,7 +1898,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -1514,7 +1958,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyCollection.cs index 9ed368804024..748d906d5666 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string routePolicy /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string routePolicyName, Ca /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string routePolicyName, CancellationToken c /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyData.Serialization.cs index 7cf6fc634c30..0385f50701bc 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyData.Serialization.cs @@ -39,50 +39,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) - { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); - } - if (Optional.IsDefined(DefaultAction)) - { - writer.WritePropertyName("defaultAction"u8); - writer.WriteStringValue(DefaultAction.Value.ToString()); - } - if (Optional.IsCollectionDefined(Statements)) - { - writer.WritePropertyName("statements"u8); - writer.WriteStartArray(); - foreach (var item in Statements) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - writer.WritePropertyName("networkFabricId"u8); - writer.WriteStringValue(NetworkFabricId); - if (Optional.IsDefined(AddressFamilyType)) - { - writer.WritePropertyName("addressFamilyType"u8); - writer.WriteStringValue(AddressFamilyType.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) - { - writer.WritePropertyName("configurationState"u8); - writer.WriteStringValue(ConfigurationState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) - { - writer.WritePropertyName("administrativeState"u8); - writer.WriteStringValue(AdministrativeState.Value.ToString()); - } - writer.WriteEndObject(); + writer.WriteObjectValue(Properties, options); } NetworkFabricRoutePolicyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -105,24 +62,22 @@ internal static NetworkFabricRoutePolicyData DeserializeNetworkFabricRoutePolicy { return null; } + RoutePolicyProperties properties = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - string annotation = default; - CommunityActionType? defaultAction = default; - IList statements = default; - ResourceIdentifier networkFabricId = default; - AddressFamilyType? addressFamilyType = default; - NetworkFabricConfigurationState? configurationState = default; - NetworkFabricProvisioningState? provisioningState = default; - NetworkFabricAdministrativeState? administrativeState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + properties = RoutePolicyProperties.DeserializeRoutePolicyProperties(property.Value, options); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -166,87 +121,6 @@ internal static NetworkFabricRoutePolicyData DeserializeNetworkFabricRoutePolicy systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerManagedNetworkFabricContext.Default); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("defaultAction"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - defaultAction = new CommunityActionType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("statements"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(RoutePolicyStatementProperties.DeserializeRoutePolicyStatementProperties(item, options)); - } - statements = array; - continue; - } - if (property0.NameEquals("networkFabricId"u8)) - { - networkFabricId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("addressFamilyType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - addressFamilyType = new AddressFamilyType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("configurationState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - configurationState = new NetworkFabricConfigurationState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkFabricProvisioningState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("administrativeState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - administrativeState = new NetworkFabricAdministrativeState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -260,14 +134,7 @@ internal static NetworkFabricRoutePolicyData DeserializeNetworkFabricRoutePolicy systemData, tags ?? new ChangeTrackingDictionary(), location, - annotation, - defaultAction, - statements ?? new ChangeTrackingList(), - networkFabricId, - addressFamilyType, - configurationState, - provisioningState, - administrativeState, + properties, serializedAdditionalRawData); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyData.cs index be1a40984448..b3a57c447850 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyData.cs @@ -53,14 +53,13 @@ public partial class NetworkFabricRoutePolicyData : TrackedResourceData /// Initializes a new instance of . /// The location. - /// Arm Resource ID of Network Fabric. - /// is null. - public NetworkFabricRoutePolicyData(AzureLocation location, ResourceIdentifier networkFabricId) : base(location) + /// The RoutePolicy properties. + /// is null. + public NetworkFabricRoutePolicyData(AzureLocation location, RoutePolicyProperties properties) : base(location) { - Argument.AssertNotNull(networkFabricId, nameof(networkFabricId)); + Argument.AssertNotNull(properties, nameof(properties)); - Statements = new ChangeTrackingList(); - NetworkFabricId = networkFabricId; + Properties = properties; } /// Initializes a new instance of . @@ -70,25 +69,11 @@ public NetworkFabricRoutePolicyData(AzureLocation location, ResourceIdentifier n /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. - /// Route Policy statements. - /// Arm Resource ID of Network Fabric. - /// AddressFamilyType. This parameter decides whether the given ipv4 or ipv6 route policy. - /// Configuration state of the resource. - /// Provisioning state of the resource. - /// Administrative state of the resource. + /// The RoutePolicy properties. /// Keeps track of any properties unknown to the library. - internal NetworkFabricRoutePolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, CommunityActionType? defaultAction, IList statements, ResourceIdentifier networkFabricId, AddressFamilyType? addressFamilyType, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NetworkFabricRoutePolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, RoutePolicyProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - Annotation = annotation; - DefaultAction = defaultAction; - Statements = statements; - NetworkFabricId = networkFabricId; - AddressFamilyType = addressFamilyType; - ConfigurationState = configurationState; - ProvisioningState = provisioningState; - AdministrativeState = administrativeState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -97,21 +82,7 @@ internal NetworkFabricRoutePolicyData() { } - /// Switch configuration description. - public string Annotation { get; set; } - /// Default action that needs to be applied when no condition is matched. Example: Permit | Deny. - public CommunityActionType? DefaultAction { get; set; } - /// Route Policy statements. - public IList Statements { get; } - /// Arm Resource ID of Network Fabric. - public ResourceIdentifier NetworkFabricId { get; set; } - /// AddressFamilyType. This parameter decides whether the given ipv4 or ipv6 route policy. - public AddressFamilyType? AddressFamilyType { get; set; } - /// Configuration state of the resource. - public NetworkFabricConfigurationState? ConfigurationState { get; } - /// Provisioning state of the resource. - public NetworkFabricProvisioningState? ProvisioningState { get; } - /// Administrative state of the resource. - public NetworkFabricAdministrativeState? AdministrativeState { get; } + /// The RoutePolicy properties. + public RoutePolicyProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyResource.cs index 4f77c893f1e4..6762bcc7094e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricRoutePolicyResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -347,19 +347,19 @@ public virtual ArmOperation Update(WaitUntil w } /// - /// Updated the admin state for this Route Policy. + /// Commits the configuration of the given resources. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/updateAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/commitConfiguration /// /// /// Operation Id - /// RoutePolicies_UpdateAdministrativeState + /// RoutePolicies_CommitConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -368,19 +368,15 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Request payload. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual async Task> CommitConfigurationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _networkFabricRoutePolicyRoutePoliciesClientDiagnostics.CreateScope("NetworkFabricRoutePolicyResource.UpdateAdministrativeState"); + using var scope = _networkFabricRoutePolicyRoutePoliciesClientDiagnostics.CreateScope("NetworkFabricRoutePolicyResource.CommitConfiguration"); scope.Start(); try { - var response = await _networkFabricRoutePolicyRoutePoliciesRestClient.UpdateAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricRoutePolicyRoutePoliciesClientDiagnostics, Pipeline, _networkFabricRoutePolicyRoutePoliciesRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricRoutePolicyRoutePoliciesRestClient.CommitConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricRoutePolicyRoutePoliciesClientDiagnostics, Pipeline, _networkFabricRoutePolicyRoutePoliciesRestClient.CreateCommitConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -393,19 +389,19 @@ public virtual async Task> Upda } /// - /// Updated the admin state for this Route Policy. + /// Commits the configuration of the given resources. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/updateAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/commitConfiguration /// /// /// Operation Id - /// RoutePolicies_UpdateAdministrativeState + /// RoutePolicies_CommitConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -414,19 +410,15 @@ public virtual async Task> Upda /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Request payload. /// The cancellation token to use. - /// is null. - public virtual ArmOperation UpdateAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation CommitConfiguration(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _networkFabricRoutePolicyRoutePoliciesClientDiagnostics.CreateScope("NetworkFabricRoutePolicyResource.UpdateAdministrativeState"); + using var scope = _networkFabricRoutePolicyRoutePoliciesClientDiagnostics.CreateScope("NetworkFabricRoutePolicyResource.CommitConfiguration"); scope.Start(); try { - var response = _networkFabricRoutePolicyRoutePoliciesRestClient.UpdateAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricRoutePolicyRoutePoliciesClientDiagnostics, Pipeline, _networkFabricRoutePolicyRoutePoliciesRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricRoutePolicyRoutePoliciesRestClient.CommitConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricRoutePolicyRoutePoliciesClientDiagnostics, Pipeline, _networkFabricRoutePolicyRoutePoliciesRestClient.CreateCommitConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -439,19 +431,19 @@ public virtual ArmOperation UpdateAdministra } /// - /// Validates the configuration of the resources. + /// Updated the admin state for this Route Policy. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/validateConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/updateAdministrativeState /// /// /// Operation Id - /// RoutePolicies_ValidateConfiguration + /// RoutePolicies_UpdateAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -460,15 +452,19 @@ public virtual ArmOperation UpdateAdministra /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. /// The cancellation token to use. - public virtual async Task> ValidateConfigurationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { - using var scope = _networkFabricRoutePolicyRoutePoliciesClientDiagnostics.CreateScope("NetworkFabricRoutePolicyResource.ValidateConfiguration"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkFabricRoutePolicyRoutePoliciesClientDiagnostics.CreateScope("NetworkFabricRoutePolicyResource.UpdateAdministrativeState"); scope.Start(); try { - var response = await _networkFabricRoutePolicyRoutePoliciesRestClient.ValidateConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricRoutePolicyRoutePoliciesClientDiagnostics, Pipeline, _networkFabricRoutePolicyRoutePoliciesRestClient.CreateValidateConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricRoutePolicyRoutePoliciesRestClient.UpdateAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricRoutePolicyRoutePoliciesClientDiagnostics, Pipeline, _networkFabricRoutePolicyRoutePoliciesRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -481,19 +477,19 @@ public virtual async Task> ValidateCon } /// - /// Validates the configuration of the resources. + /// Updated the admin state for this Route Policy. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/validateConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/updateAdministrativeState /// /// /// Operation Id - /// RoutePolicies_ValidateConfiguration + /// RoutePolicies_UpdateAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -502,15 +498,19 @@ public virtual async Task> ValidateCon /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. /// The cancellation token to use. - public virtual ArmOperation ValidateConfiguration(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation UpdateAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { - using var scope = _networkFabricRoutePolicyRoutePoliciesClientDiagnostics.CreateScope("NetworkFabricRoutePolicyResource.ValidateConfiguration"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkFabricRoutePolicyRoutePoliciesClientDiagnostics.CreateScope("NetworkFabricRoutePolicyResource.UpdateAdministrativeState"); scope.Start(); try { - var response = _networkFabricRoutePolicyRoutePoliciesRestClient.ValidateConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricRoutePolicyRoutePoliciesClientDiagnostics, Pipeline, _networkFabricRoutePolicyRoutePoliciesRestClient.CreateValidateConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricRoutePolicyRoutePoliciesRestClient.UpdateAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkFabricRoutePolicyRoutePoliciesClientDiagnostics, Pipeline, _networkFabricRoutePolicyRoutePoliciesRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -523,19 +523,19 @@ public virtual ArmOperation ValidateConfiguration(W } /// - /// Commits the configuration of the given resources. + /// Validates the configuration of the resources. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/commitConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/validateConfiguration /// /// /// Operation Id - /// RoutePolicies_CommitConfiguration + /// RoutePolicies_ValidateConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -545,14 +545,14 @@ public virtual ArmOperation ValidateConfiguration(W /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - public virtual async Task> CommitConfigurationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual async Task> ValidateConfigurationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _networkFabricRoutePolicyRoutePoliciesClientDiagnostics.CreateScope("NetworkFabricRoutePolicyResource.CommitConfiguration"); + using var scope = _networkFabricRoutePolicyRoutePoliciesClientDiagnostics.CreateScope("NetworkFabricRoutePolicyResource.ValidateConfiguration"); scope.Start(); try { - var response = await _networkFabricRoutePolicyRoutePoliciesRestClient.CommitConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricRoutePolicyRoutePoliciesClientDiagnostics, Pipeline, _networkFabricRoutePolicyRoutePoliciesRestClient.CreateCommitConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _networkFabricRoutePolicyRoutePoliciesRestClient.ValidateConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricRoutePolicyRoutePoliciesClientDiagnostics, Pipeline, _networkFabricRoutePolicyRoutePoliciesRestClient.CreateValidateConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -565,19 +565,19 @@ public virtual async Task> Commi } /// - /// Commits the configuration of the given resources. + /// Validates the configuration of the resources. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/commitConfiguration + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/validateConfiguration /// /// /// Operation Id - /// RoutePolicies_CommitConfiguration + /// RoutePolicies_ValidateConfiguration /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -587,14 +587,14 @@ public virtual async Task> Commi /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - public virtual ArmOperation CommitConfiguration(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual ArmOperation ValidateConfiguration(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _networkFabricRoutePolicyRoutePoliciesClientDiagnostics.CreateScope("NetworkFabricRoutePolicyResource.CommitConfiguration"); + using var scope = _networkFabricRoutePolicyRoutePoliciesClientDiagnostics.CreateScope("NetworkFabricRoutePolicyResource.ValidateConfiguration"); scope.Start(); try { - var response = _networkFabricRoutePolicyRoutePoliciesRestClient.CommitConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkFabricRoutePolicyRoutePoliciesClientDiagnostics, Pipeline, _networkFabricRoutePolicyRoutePoliciesRestClient.CreateCommitConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _networkFabricRoutePolicyRoutePoliciesRestClient.ValidateConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new ValidateConfigurationResultOperationSource(), _networkFabricRoutePolicyRoutePoliciesClientDiagnostics, Pipeline, _networkFabricRoutePolicyRoutePoliciesRestClient.CreateValidateConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -619,7 +619,7 @@ public virtual ArmOperation CommitConfigurati /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -681,7 +681,7 @@ public virtual async Task> AddTagAsyn /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -743,7 +743,7 @@ public virtual Response AddTag(string key, str /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -800,7 +800,7 @@ public virtual async Task> SetTagsAsy /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -857,7 +857,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -917,7 +917,7 @@ public virtual async Task> RemoveTagA /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricSkuCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricSkuCollection.cs index 2a9941651931..3174482319e0 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricSkuCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricSkuCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -110,7 +110,7 @@ public virtual async Task> GetAsync(string ne /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -155,7 +155,7 @@ public virtual Response Get(string networkFabricSkuNam /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -185,7 +185,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -215,7 +215,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -258,7 +258,7 @@ public virtual async Task> ExistsAsync(string networkFabricSkuNam /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -301,7 +301,7 @@ public virtual Response Exists(string networkFabricSkuName, CancellationTo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -346,7 +346,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricSkuData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricSkuData.Serialization.cs index f250baf9823f..da0606cd46af 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricSkuData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricSkuData.Serialization.cs @@ -39,43 +39,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(TypePropertiesType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(TypePropertiesType.Value.ToString()); - } - if (Optional.IsDefined(MaxComputeRacks)) - { - writer.WritePropertyName("maxComputeRacks"u8); - writer.WriteNumberValue(MaxComputeRacks.Value); - } - if (Optional.IsDefined(MaximumServerCount)) - { - writer.WritePropertyName("maximumServerCount"u8); - writer.WriteNumberValue(MaximumServerCount.Value); - } - if (options.Format != "W" && Optional.IsCollectionDefined(SupportedVersions)) - { - writer.WritePropertyName("supportedVersions"u8); - writer.WriteStartArray(); - foreach (var item in SupportedVersions) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(Details)) - { - writer.WritePropertyName("details"u8); - writer.WriteStringValue(Details); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - writer.WriteEndObject(); + writer.WriteObjectValue(Properties, options); } NetworkFabricSkuData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -98,20 +62,20 @@ internal static NetworkFabricSkuData DeserializeNetworkFabricSkuData(JsonElement { return null; } + NetworkFabricSkuProperties properties = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - NetworkFabricSkuType? type0 = default; - int? maxComputeRacks = default; - int? maximumServerCount = default; - IReadOnlyList supportedVersions = default; - string details = default; - NetworkFabricProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + properties = NetworkFabricSkuProperties.DeserializeNetworkFabricSkuProperties(property.Value, options); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -136,73 +100,6 @@ internal static NetworkFabricSkuData DeserializeNetworkFabricSkuData(JsonElement systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerManagedNetworkFabricContext.Default); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("type"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - type0 = new NetworkFabricSkuType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("maxComputeRacks"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxComputeRacks = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("maximumServerCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maximumServerCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("supportedVersions"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - supportedVersions = array; - continue; - } - if (property0.NameEquals("details"u8)) - { - details = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkFabricProvisioningState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -214,12 +111,7 @@ internal static NetworkFabricSkuData DeserializeNetworkFabricSkuData(JsonElement name, type, systemData, - type0, - maxComputeRacks, - maximumServerCount, - supportedVersions ?? new ChangeTrackingList(), - details, - provisioningState, + properties, serializedAdditionalRawData); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricSkuData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricSkuData.cs index 409a4a51eab0..ad8755cd4193 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricSkuData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricSkuData.cs @@ -52,9 +52,13 @@ public partial class NetworkFabricSkuData : ResourceData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - public NetworkFabricSkuData() + /// The Network Fabric Sku properties. + /// is null. + public NetworkFabricSkuData(NetworkFabricSkuProperties properties) { - SupportedVersions = new ChangeTrackingList(); + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; } /// Initializes a new instance of . @@ -62,35 +66,20 @@ public NetworkFabricSkuData() /// The name. /// The resourceType. /// The systemData. - /// Type of Network Fabric SKU. - /// Maximum number of compute racks available for this Network Fabric SKU. The value of max count racks is 4 for 4 rack SKU and 8 for 8 rack SKU. - /// Maximum number of servers available for this Network Fabric SKU. - /// List of supported Network Fabric SKU versions. - /// URL providing detailed configuration of the fabric SKU. - /// Provisioning state of the resource. + /// The Network Fabric Sku properties. /// Keeps track of any properties unknown to the library. - internal NetworkFabricSkuData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NetworkFabricSkuType? typePropertiesType, int? maxComputeRacks, int? maximumServerCount, IReadOnlyList supportedVersions, string details, NetworkFabricProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal NetworkFabricSkuData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NetworkFabricSkuProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { - TypePropertiesType = typePropertiesType; - MaxComputeRacks = maxComputeRacks; - MaximumServerCount = maximumServerCount; - SupportedVersions = supportedVersions; - Details = details; - ProvisioningState = provisioningState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Type of Network Fabric SKU. - public NetworkFabricSkuType? TypePropertiesType { get; } - /// Maximum number of compute racks available for this Network Fabric SKU. The value of max count racks is 4 for 4 rack SKU and 8 for 8 rack SKU. - public int? MaxComputeRacks { get; set; } - /// Maximum number of servers available for this Network Fabric SKU. - public int? MaximumServerCount { get; set; } - /// List of supported Network Fabric SKU versions. - public IReadOnlyList SupportedVersions { get; } - /// URL providing detailed configuration of the fabric SKU. - public string Details { get; } - /// Provisioning state of the resource. - public NetworkFabricProvisioningState? ProvisioningState { get; } + /// Initializes a new instance of for deserialization. + internal NetworkFabricSkuData() + { + } + + /// The Network Fabric Sku properties. + public NetworkFabricSkuProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricSkuResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricSkuResource.cs index 2a739ac68dab..691bb2162355 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricSkuResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricSkuResource.cs @@ -100,7 +100,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -140,7 +140,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkMonitorCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkMonitorCollection.cs new file mode 100644 index 000000000000..4743b160af32 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkMonitorCollection.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ManagedNetworkFabric +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetNetworkMonitors method from an instance of . + /// + public partial class NetworkMonitorCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _networkMonitorClientDiagnostics; + private readonly NetworkMonitorsRestOperations _networkMonitorRestClient; + + /// Initializes a new instance of the class for mocking. + protected NetworkMonitorCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal NetworkMonitorCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _networkMonitorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ManagedNetworkFabric", NetworkMonitorResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(NetworkMonitorResource.ResourceType, out string networkMonitorApiVersion); + _networkMonitorRestClient = new NetworkMonitorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, networkMonitorApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Creates NetworkMonitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Create + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the Network Monitor. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string networkMonitorName, NetworkMonitorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(networkMonitorName, nameof(networkMonitorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _networkMonitorRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, networkMonitorName, data, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new NetworkMonitorOperationSource(Client), _networkMonitorClientDiagnostics, Pipeline, _networkMonitorRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, networkMonitorName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates NetworkMonitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Create + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the Network Monitor. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string networkMonitorName, NetworkMonitorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(networkMonitorName, nameof(networkMonitorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _networkMonitorRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, networkMonitorName, data, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new NetworkMonitorOperationSource(Client), _networkMonitorClientDiagnostics, Pipeline, _networkMonitorRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, networkMonitorName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Implements NetworkMonitor GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Network Monitor. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string networkMonitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(networkMonitorName, nameof(networkMonitorName)); + + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorCollection.Get"); + scope.Start(); + try + { + var response = await _networkMonitorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, networkMonitorName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NetworkMonitorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Implements NetworkMonitor GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Network Monitor. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string networkMonitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(networkMonitorName, nameof(networkMonitorName)); + + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorCollection.Get"); + scope.Start(); + try + { + var response = _networkMonitorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, networkMonitorName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NetworkMonitorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Displays NetworkMonitors list by resource group GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors + /// + /// + /// Operation Id + /// NetworkMonitors_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _networkMonitorRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _networkMonitorRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkMonitorResource(Client, NetworkMonitorData.DeserializeNetworkMonitorData(e)), _networkMonitorClientDiagnostics, Pipeline, "NetworkMonitorCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Displays NetworkMonitors list by resource group GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors + /// + /// + /// Operation Id + /// NetworkMonitors_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _networkMonitorRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _networkMonitorRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkMonitorResource(Client, NetworkMonitorData.DeserializeNetworkMonitorData(e)), _networkMonitorClientDiagnostics, Pipeline, "NetworkMonitorCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Network Monitor. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string networkMonitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(networkMonitorName, nameof(networkMonitorName)); + + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorCollection.Exists"); + scope.Start(); + try + { + var response = await _networkMonitorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, networkMonitorName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Network Monitor. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string networkMonitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(networkMonitorName, nameof(networkMonitorName)); + + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorCollection.Exists"); + scope.Start(); + try + { + var response = _networkMonitorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, networkMonitorName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Network Monitor. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string networkMonitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(networkMonitorName, nameof(networkMonitorName)); + + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _networkMonitorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, networkMonitorName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NetworkMonitorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Network Monitor. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string networkMonitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(networkMonitorName, nameof(networkMonitorName)); + + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorCollection.GetIfExists"); + scope.Start(); + try + { + var response = _networkMonitorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, networkMonitorName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NetworkMonitorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkMonitorData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkMonitorData.Serialization.cs new file mode 100644 index 000000000000..2c1cd4e8dc8d --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkMonitorData.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ManagedNetworkFabric.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ManagedNetworkFabric +{ + public partial class NetworkMonitorData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkMonitorData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + + NetworkMonitorData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkMonitorData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkMonitorData(document.RootElement, options); + } + + internal static NetworkMonitorData DeserializeNetworkMonitorData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NetworkMonitorProperties properties = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = NetworkMonitorProperties.DeserializeNetworkMonitorProperties(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerManagedNetworkFabricContext.Default); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkMonitorData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerManagedNetworkFabricContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkMonitorData)} does not support writing '{options.Format}' format."); + } + } + + NetworkMonitorData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkMonitorData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkMonitorData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkMonitorData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkMonitorData.cs new file mode 100644 index 000000000000..c77053048724 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkMonitorData.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ManagedNetworkFabric.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ManagedNetworkFabric +{ + /// + /// A class representing the NetworkMonitor data model. + /// The NetworkMonitor resource definition. + /// + public partial class NetworkMonitorData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + /// The NetworkFabric Properties. + /// is null. + public NetworkMonitorData(AzureLocation location, NetworkMonitorProperties properties) : base(location) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The NetworkFabric Properties. + /// Keeps track of any properties unknown to the library. + internal NetworkMonitorData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, NetworkMonitorProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkMonitorData() + { + } + + /// The NetworkFabric Properties. + public NetworkMonitorProperties Properties { get; set; } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkMonitorResource.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkMonitorResource.Serialization.cs new file mode 100644 index 000000000000..793c7aeb8557 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkMonitorResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ManagedNetworkFabric +{ + public partial class NetworkMonitorResource : IJsonModel + { + private static NetworkMonitorData s_dataDeserializationInstance; + private static NetworkMonitorData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + NetworkMonitorData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerManagedNetworkFabricContext.Default); + + NetworkMonitorData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerManagedNetworkFabricContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkMonitorResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkMonitorResource.cs new file mode 100644 index 000000000000..88a1be35322f --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkMonitorResource.cs @@ -0,0 +1,799 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ManagedNetworkFabric.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ManagedNetworkFabric +{ + /// + /// A Class representing a NetworkMonitor along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetNetworkMonitorResource method. + /// Otherwise you can get one from its parent resource using the GetNetworkMonitor method. + /// + public partial class NetworkMonitorResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The networkMonitorName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string networkMonitorName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _networkMonitorClientDiagnostics; + private readonly NetworkMonitorsRestOperations _networkMonitorRestClient; + private readonly NetworkMonitorData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ManagedNetworkFabric/networkMonitors"; + + /// Initializes a new instance of the class for mocking. + protected NetworkMonitorResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal NetworkMonitorResource(ArmClient client, NetworkMonitorData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal NetworkMonitorResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _networkMonitorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ManagedNetworkFabric", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string networkMonitorApiVersion); + _networkMonitorRestClient = new NetworkMonitorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, networkMonitorApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual NetworkMonitorData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Implements NetworkMonitor GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorResource.Get"); + scope.Start(); + try + { + var response = await _networkMonitorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NetworkMonitorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Implements NetworkMonitor GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorResource.Get"); + scope.Start(); + try + { + var response = _networkMonitorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NetworkMonitorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes layer 2 connectivity between compute nodes by managed by named NetworkMonitor name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Delete + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorResource.Delete"); + scope.Start(); + try + { + var response = await _networkMonitorRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(_networkMonitorClientDiagnostics, Pipeline, _networkMonitorRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes layer 2 connectivity between compute nodes by managed by named NetworkMonitor name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Delete + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorResource.Delete"); + scope.Start(); + try + { + var response = _networkMonitorRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(_networkMonitorClientDiagnostics, Pipeline, _networkMonitorRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// API to update certain properties of the NetworkMonitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Update + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NetworkMonitorPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorResource.Update"); + scope.Start(); + try + { + var response = await _networkMonitorRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new NetworkMonitorOperationSource(Client), _networkMonitorClientDiagnostics, Pipeline, _networkMonitorRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// API to update certain properties of the NetworkMonitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Update + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, NetworkMonitorPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorResource.Update"); + scope.Start(); + try + { + var response = _networkMonitorRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new NetworkMonitorOperationSource(Client), _networkMonitorClientDiagnostics, Pipeline, _networkMonitorRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Enables isolation domain across the fabric or on specified racks. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName}/updateAdministrativeState + /// + /// + /// Operation Id + /// NetworkMonitors_UpdateAdministrativeState + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorResource.UpdateAdministrativeState"); + scope.Start(); + try + { + var response = await _networkMonitorRestClient.UpdateAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkMonitorClientDiagnostics, Pipeline, _networkMonitorRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Enables isolation domain across the fabric or on specified racks. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName}/updateAdministrativeState + /// + /// + /// Operation Id + /// NetworkMonitors_UpdateAdministrativeState + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation UpdateAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorResource.UpdateAdministrativeState"); + scope.Start(); + try + { + var response = _networkMonitorRestClient.UpdateAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkMonitorClientDiagnostics, Pipeline, _networkMonitorRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _networkMonitorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new NetworkMonitorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new NetworkMonitorPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _networkMonitorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new NetworkMonitorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new NetworkMonitorPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _networkMonitorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new NetworkMonitorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new NetworkMonitorPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _networkMonitorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new NetworkMonitorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new NetworkMonitorPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _networkMonitorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new NetworkMonitorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new NetworkMonitorPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName} + /// + /// + /// Operation Id + /// NetworkMonitors_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _networkMonitorClientDiagnostics.CreateScope("NetworkMonitorResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _networkMonitorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new NetworkMonitorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new NetworkMonitorPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkPacketBrokerCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkPacketBrokerCollection.cs index b608a0b6141b..9cc1f5ce5417 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkPacketBrokerCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkPacketBrokerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpd /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string networkPacketBro /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string networkPacketBroker /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string networkPacketBrokerName, Cancellatio /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkPacketBrokerData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkPacketBrokerData.Serialization.cs index c792b184a881..fa878e603373 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkPacketBrokerData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkPacketBrokerData.Serialization.cs @@ -39,75 +39,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("networkFabricId"u8); - writer.WriteStringValue(NetworkFabricId); - if (options.Format != "W" && Optional.IsCollectionDefined(NetworkDeviceIds)) - { - writer.WritePropertyName("networkDeviceIds"u8); - writer.WriteStartArray(); - foreach (var item in NetworkDeviceIds) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsCollectionDefined(SourceInterfaceIds)) - { - writer.WritePropertyName("sourceInterfaceIds"u8); - writer.WriteStartArray(); - foreach (var item in SourceInterfaceIds) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsCollectionDefined(NetworkTapIds)) - { - writer.WritePropertyName("networkTapIds"u8); - writer.WriteStartArray(); - foreach (var item in NetworkTapIds) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsCollectionDefined(NeighborGroupIds)) - { - writer.WritePropertyName("neighborGroupIds"u8); - writer.WriteStartArray(); - foreach (var item in NeighborGroupIds) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - writer.WriteEndObject(); + writer.WriteObjectValue(Properties, options); } NetworkPacketBrokerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -130,22 +62,22 @@ internal static NetworkPacketBrokerData DeserializeNetworkPacketBrokerData(JsonE { return null; } + NetworkPacketBrokerProperties properties = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - ResourceIdentifier networkFabricId = default; - IReadOnlyList networkDeviceIds = default; - IReadOnlyList sourceInterfaceIds = default; - IReadOnlyList networkTapIds = default; - IReadOnlyList neighborGroupIds = default; - NetworkFabricProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + properties = NetworkPacketBrokerProperties.DeserializeNetworkPacketBrokerProperties(property.Value, options); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -189,116 +121,6 @@ internal static NetworkPacketBrokerData DeserializeNetworkPacketBrokerData(JsonE systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerManagedNetworkFabricContext.Default); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("networkFabricId"u8)) - { - networkFabricId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("networkDeviceIds"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } - } - networkDeviceIds = array; - continue; - } - if (property0.NameEquals("sourceInterfaceIds"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } - } - sourceInterfaceIds = array; - continue; - } - if (property0.NameEquals("networkTapIds"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } - } - networkTapIds = array; - continue; - } - if (property0.NameEquals("neighborGroupIds"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } - } - neighborGroupIds = array; - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkFabricProvisioningState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -312,12 +134,7 @@ internal static NetworkPacketBrokerData DeserializeNetworkPacketBrokerData(JsonE systemData, tags ?? new ChangeTrackingDictionary(), location, - networkFabricId, - networkDeviceIds ?? new ChangeTrackingList(), - sourceInterfaceIds ?? new ChangeTrackingList(), - networkTapIds ?? new ChangeTrackingList(), - neighborGroupIds ?? new ChangeTrackingList(), - provisioningState, + properties, serializedAdditionalRawData); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkPacketBrokerData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkPacketBrokerData.cs index 6070e2611a37..bf0961c2f089 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkPacketBrokerData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkPacketBrokerData.cs @@ -53,17 +53,13 @@ public partial class NetworkPacketBrokerData : TrackedResourceData /// Initializes a new instance of . /// The location. - /// ARM resource ID of the Network Fabric. - /// is null. - public NetworkPacketBrokerData(AzureLocation location, ResourceIdentifier networkFabricId) : base(location) + /// The NetworkPacketBroker properties. + /// is null. + public NetworkPacketBrokerData(AzureLocation location, NetworkPacketBrokerProperties properties) : base(location) { - Argument.AssertNotNull(networkFabricId, nameof(networkFabricId)); + Argument.AssertNotNull(properties, nameof(properties)); - NetworkFabricId = networkFabricId; - NetworkDeviceIds = new ChangeTrackingList(); - SourceInterfaceIds = new ChangeTrackingList(); - NetworkTapIds = new ChangeTrackingList(); - NeighborGroupIds = new ChangeTrackingList(); + Properties = properties; } /// Initializes a new instance of . @@ -73,21 +69,11 @@ public NetworkPacketBrokerData(AzureLocation location, ResourceIdentifier networ /// The systemData. /// The tags. /// The location. - /// ARM resource ID of the Network Fabric. - /// List of ARM resource IDs of Network Devices [NPB]. - /// List of network interfaces across NPB devices that are used to mirror source traffic. - /// List of network Tap IDs configured on NPB. - /// List of neighbor group IDs configured on NPB. - /// Provisioning state of the resource. + /// The NetworkPacketBroker properties. /// Keeps track of any properties unknown to the library. - internal NetworkPacketBrokerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ResourceIdentifier networkFabricId, IReadOnlyList networkDeviceIds, IReadOnlyList sourceInterfaceIds, IReadOnlyList networkTapIds, IReadOnlyList neighborGroupIds, NetworkFabricProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NetworkPacketBrokerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, NetworkPacketBrokerProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - NetworkFabricId = networkFabricId; - NetworkDeviceIds = networkDeviceIds; - SourceInterfaceIds = sourceInterfaceIds; - NetworkTapIds = networkTapIds; - NeighborGroupIds = neighborGroupIds; - ProvisioningState = provisioningState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -96,17 +82,7 @@ internal NetworkPacketBrokerData() { } - /// ARM resource ID of the Network Fabric. - public ResourceIdentifier NetworkFabricId { get; set; } - /// List of ARM resource IDs of Network Devices [NPB]. - public IReadOnlyList NetworkDeviceIds { get; } - /// List of network interfaces across NPB devices that are used to mirror source traffic. - public IReadOnlyList SourceInterfaceIds { get; } - /// List of network Tap IDs configured on NPB. - public IReadOnlyList NetworkTapIds { get; } - /// List of neighbor group IDs configured on NPB. - public IReadOnlyList NeighborGroupIds { get; } - /// Provisioning state of the resource. - public NetworkFabricProvisioningState? ProvisioningState { get; } + /// The NetworkPacketBroker properties. + public NetworkPacketBrokerProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkPacketBrokerResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkPacketBrokerResource.cs index 26d873c70983..dc32d147b0c2 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkPacketBrokerResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkPacketBrokerResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cance /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUntil waitUn /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -421,7 +421,7 @@ public virtual async Task> AddTagAsync(str /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -483,7 +483,7 @@ public virtual Response AddTag(string key, string v /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -540,7 +540,7 @@ public virtual async Task> SetTagsAsync(ID /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -597,7 +597,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task> RemoveTagAsync( /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkRackCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkRackCollection.cs index a9d1204d41a5..62cebf6f6124 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkRackCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkRackCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsync /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUn /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string network /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string networkRackName, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancellati /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string networkRackName, Ca /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string networkRackName, CancellationToken c /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsAsyn /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkRackData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkRackData.Serialization.cs index 359ac0d12ea9..09610947a604 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkRackData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkRackData.Serialization.cs @@ -39,40 +39,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) - { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); - } - if (Optional.IsDefined(NetworkRackType)) - { - writer.WritePropertyName("networkRackType"u8); - writer.WriteStringValue(NetworkRackType.Value.ToString()); - } - writer.WritePropertyName("networkFabricId"u8); - writer.WriteStringValue(NetworkFabricId); - if (options.Format != "W" && Optional.IsCollectionDefined(NetworkDevices)) - { - writer.WritePropertyName("networkDevices"u8); - writer.WriteStartArray(); - foreach (var item in NetworkDevices) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - writer.WriteEndObject(); + writer.WriteObjectValue(Properties, options); } NetworkRackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -95,21 +62,22 @@ internal static NetworkRackData DeserializeNetworkRackData(JsonElement element, { return null; } + NetworkRackProperties properties = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - string annotation = default; - NetworkRackType? networkRackType = default; - ResourceIdentifier networkFabricId = default; - IReadOnlyList networkDevices = default; - NetworkFabricProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + properties = NetworkRackProperties.DeserializeNetworkRackProperties(property.Value, options); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -153,67 +121,6 @@ internal static NetworkRackData DeserializeNetworkRackData(JsonElement element, systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerManagedNetworkFabricContext.Default); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("networkRackType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkRackType = new NetworkRackType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("networkFabricId"u8)) - { - networkFabricId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("networkDevices"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } - } - networkDevices = array; - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkFabricProvisioningState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -227,11 +134,7 @@ internal static NetworkRackData DeserializeNetworkRackData(JsonElement element, systemData, tags ?? new ChangeTrackingDictionary(), location, - annotation, - networkRackType, - networkFabricId, - networkDevices ?? new ChangeTrackingList(), - provisioningState, + properties, serializedAdditionalRawData); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkRackData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkRackData.cs index 737a4fe32575..9f0a6fe76c49 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkRackData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkRackData.cs @@ -53,14 +53,13 @@ public partial class NetworkRackData : TrackedResourceData /// Initializes a new instance of . /// The location. - /// ARM resource ID of the Network Fabric. - /// is null. - public NetworkRackData(AzureLocation location, ResourceIdentifier networkFabricId) : base(location) + /// The NetworkRack properties. + /// is null. + public NetworkRackData(AzureLocation location, NetworkRackProperties properties) : base(location) { - Argument.AssertNotNull(networkFabricId, nameof(networkFabricId)); + Argument.AssertNotNull(properties, nameof(properties)); - NetworkFabricId = networkFabricId; - NetworkDevices = new ChangeTrackingList(); + Properties = properties; } /// Initializes a new instance of . @@ -70,19 +69,11 @@ public NetworkRackData(AzureLocation location, ResourceIdentifier networkFabricI /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// Network Rack SKU name. - /// ARM resource ID of the Network Fabric. - /// List of network device ARM resource IDs. - /// Provisioning state of the resource. + /// The NetworkRack properties. /// Keeps track of any properties unknown to the library. - internal NetworkRackData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, NetworkRackType? networkRackType, ResourceIdentifier networkFabricId, IReadOnlyList networkDevices, NetworkFabricProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NetworkRackData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, NetworkRackProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - Annotation = annotation; - NetworkRackType = networkRackType; - NetworkFabricId = networkFabricId; - NetworkDevices = networkDevices; - ProvisioningState = provisioningState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -91,15 +82,7 @@ internal NetworkRackData() { } - /// Switch configuration description. - public string Annotation { get; set; } - /// Network Rack SKU name. - public NetworkRackType? NetworkRackType { get; set; } - /// ARM resource ID of the Network Fabric. - public ResourceIdentifier NetworkFabricId { get; set; } - /// List of network device ARM resource IDs. - public IReadOnlyList NetworkDevices { get; } - /// Provisioning state of the resource. - public NetworkFabricProvisioningState? ProvisioningState { get; } + /// The NetworkRack properties. + public NetworkRackProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkRackResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkRackResource.cs index b9bbabc07733..ff3f9e418c5d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkRackResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkRackResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(CancellationTo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellationT /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync(WaitUnt /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Net /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -421,7 +421,7 @@ public virtual async Task> AddTagAsync(string key, /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -483,7 +483,7 @@ public virtual Response AddTag(string key, string value, Ca /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -540,7 +540,7 @@ public virtual async Task> SetTagsAsync(IDictionar /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -597,7 +597,7 @@ public virtual Response SetTags(IDictionary /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task> RemoveTagAsync(string k /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapCollection.cs index 119ef4fdf8c8..45ceb0027b13 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsync( /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUnt /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string networkT /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string networkTapName, Cancellat /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken c /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancellatio /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string networkTapName, Can /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string networkTapName, CancellationToken ca /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsAsync /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapData.Serialization.cs index feab63991cdf..6f59ffecfadb 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapData.Serialization.cs @@ -39,47 +39,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) - { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); - } - writer.WritePropertyName("networkPacketBrokerId"u8); - writer.WriteStringValue(NetworkPacketBrokerId); - if (options.Format != "W" && Optional.IsDefined(SourceTapRuleId)) - { - writer.WritePropertyName("sourceTapRuleId"u8); - writer.WriteStringValue(SourceTapRuleId); - } - writer.WritePropertyName("destinations"u8); - writer.WriteStartArray(); - foreach (var item in Destinations) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (Optional.IsDefined(PollingType)) - { - writer.WritePropertyName("pollingType"u8); - writer.WriteStringValue(PollingType.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) - { - writer.WritePropertyName("configurationState"u8); - writer.WriteStringValue(ConfigurationState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) - { - writer.WritePropertyName("administrativeState"u8); - writer.WriteStringValue(AdministrativeState.Value.ToString()); - } - writer.WriteEndObject(); + writer.WriteObjectValue(Properties, options); } NetworkTapData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -102,24 +62,22 @@ internal static NetworkTapData DeserializeNetworkTapData(JsonElement element, Mo { return null; } + NetworkTapProperties properties = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - string annotation = default; - ResourceIdentifier networkPacketBrokerId = default; - ResourceIdentifier sourceTapRuleId = default; - IList destinations = default; - NetworkTapPollingType? pollingType = default; - NetworkFabricConfigurationState? configurationState = default; - NetworkFabricProvisioningState? provisioningState = default; - NetworkFabricAdministrativeState? administrativeState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + properties = NetworkTapProperties.DeserializeNetworkTapProperties(property.Value, options); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -163,83 +121,6 @@ internal static NetworkTapData DeserializeNetworkTapData(JsonElement element, Mo systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerManagedNetworkFabricContext.Default); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("networkPacketBrokerId"u8)) - { - networkPacketBrokerId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("sourceTapRuleId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - sourceTapRuleId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("destinations"u8)) - { - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(NetworkTapPropertiesDestinationsItem.DeserializeNetworkTapPropertiesDestinationsItem(item, options)); - } - destinations = array; - continue; - } - if (property0.NameEquals("pollingType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - pollingType = new NetworkTapPollingType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("configurationState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - configurationState = new NetworkFabricConfigurationState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkFabricProvisioningState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("administrativeState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - administrativeState = new NetworkFabricAdministrativeState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -253,14 +134,7 @@ internal static NetworkTapData DeserializeNetworkTapData(JsonElement element, Mo systemData, tags ?? new ChangeTrackingDictionary(), location, - annotation, - networkPacketBrokerId, - sourceTapRuleId, - destinations, - pollingType, - configurationState, - provisioningState, - administrativeState, + properties, serializedAdditionalRawData); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapData.cs index 3800fcbe4810..6b8b8b649deb 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapData.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using System.Linq; using Azure.Core; using Azure.ResourceManager.ManagedNetworkFabric.Models; using Azure.ResourceManager.Models; @@ -54,16 +53,13 @@ public partial class NetworkTapData : TrackedResourceData /// Initializes a new instance of . /// The location. - /// ARM resource ID of the Network Packet Broker. - /// List of destinations to send the filter traffic. - /// or is null. - public NetworkTapData(AzureLocation location, ResourceIdentifier networkPacketBrokerId, IEnumerable destinations) : base(location) + /// The NetworkTap Properties. + /// is null. + public NetworkTapData(AzureLocation location, NetworkTapProperties properties) : base(location) { - Argument.AssertNotNull(networkPacketBrokerId, nameof(networkPacketBrokerId)); - Argument.AssertNotNull(destinations, nameof(destinations)); + Argument.AssertNotNull(properties, nameof(properties)); - NetworkPacketBrokerId = networkPacketBrokerId; - Destinations = destinations.ToList(); + Properties = properties; } /// Initializes a new instance of . @@ -73,25 +69,11 @@ public NetworkTapData(AzureLocation location, ResourceIdentifier networkPacketBr /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// ARM resource ID of the Network Packet Broker. - /// Source Tap Rule Id. ARM Resource ID of the Network Tap Rule. - /// List of destinations to send the filter traffic. - /// Polling type. - /// Gets the configurations state of the resource. - /// Provides you the latest status of the NFC service, whether it is Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on the status of Network Tap provisioning. - /// Administrative state of the resource. Example -Enabled/Disabled. + /// The NetworkTap Properties. /// Keeps track of any properties unknown to the library. - internal NetworkTapData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, ResourceIdentifier networkPacketBrokerId, ResourceIdentifier sourceTapRuleId, IList destinations, NetworkTapPollingType? pollingType, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NetworkTapData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, NetworkTapProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - Annotation = annotation; - NetworkPacketBrokerId = networkPacketBrokerId; - SourceTapRuleId = sourceTapRuleId; - Destinations = destinations; - PollingType = pollingType; - ConfigurationState = configurationState; - ProvisioningState = provisioningState; - AdministrativeState = administrativeState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -100,21 +82,7 @@ internal NetworkTapData() { } - /// Switch configuration description. - public string Annotation { get; set; } - /// ARM resource ID of the Network Packet Broker. - public ResourceIdentifier NetworkPacketBrokerId { get; set; } - /// Source Tap Rule Id. ARM Resource ID of the Network Tap Rule. - public ResourceIdentifier SourceTapRuleId { get; } - /// List of destinations to send the filter traffic. - public IList Destinations { get; } - /// Polling type. - public NetworkTapPollingType? PollingType { get; set; } - /// Gets the configurations state of the resource. - public NetworkFabricConfigurationState? ConfigurationState { get; } - /// Provides you the latest status of the NFC service, whether it is Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on the status of Network Tap provisioning. - public NetworkFabricProvisioningState? ProvisioningState { get; } - /// Administrative state of the resource. Example -Enabled/Disabled. - public NetworkFabricAdministrativeState? AdministrativeState { get; } + /// The NetworkTap Properties. + public NetworkTapProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapResource.cs index f6f34eb14dcf..18fed9c8008c 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(CancellationTok /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellationTo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync(WaitUnti /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -351,15 +351,15 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Netw /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/updateAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/resync /// /// /// Operation Id - /// NetworkTaps_UpdateAdministrativeState + /// NetworkTaps_Resync /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -368,19 +368,15 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Netw /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Request payload. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual async Task> ResyncAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _networkTapClientDiagnostics.CreateScope("NetworkTapResource.UpdateAdministrativeState"); + using var scope = _networkTapClientDiagnostics.CreateScope("NetworkTapResource.Resync"); scope.Start(); try { - var response = await _networkTapRestClient.UpdateAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkTapClientDiagnostics, Pipeline, _networkTapRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _networkTapRestClient.ResyncAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkTapClientDiagnostics, Pipeline, _networkTapRestClient.CreateResyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -397,15 +393,15 @@ public virtual async Task> Upda /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/updateAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/resync /// /// /// Operation Id - /// NetworkTaps_UpdateAdministrativeState + /// NetworkTaps_Resync /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -414,19 +410,15 @@ public virtual async Task> Upda /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Request payload. /// The cancellation token to use. - /// is null. - public virtual ArmOperation UpdateAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation Resync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _networkTapClientDiagnostics.CreateScope("NetworkTapResource.UpdateAdministrativeState"); + using var scope = _networkTapClientDiagnostics.CreateScope("NetworkTapResource.Resync"); scope.Start(); try { - var response = _networkTapRestClient.UpdateAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkTapClientDiagnostics, Pipeline, _networkTapRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _networkTapRestClient.Resync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkTapClientDiagnostics, Pipeline, _networkTapRestClient.CreateResyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -443,15 +435,15 @@ public virtual ArmOperation UpdateAdministra /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/resync + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/updateAdministrativeState /// /// /// Operation Id - /// NetworkTaps_Resync + /// NetworkTaps_UpdateAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -460,15 +452,19 @@ public virtual ArmOperation UpdateAdministra /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. /// The cancellation token to use. - public virtual async Task> ResyncAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { - using var scope = _networkTapClientDiagnostics.CreateScope("NetworkTapResource.Resync"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkTapClientDiagnostics.CreateScope("NetworkTapResource.UpdateAdministrativeState"); scope.Start(); try { - var response = await _networkTapRestClient.ResyncAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkTapClientDiagnostics, Pipeline, _networkTapRestClient.CreateResyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _networkTapRestClient.UpdateAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkTapClientDiagnostics, Pipeline, _networkTapRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -485,15 +481,15 @@ public virtual async Task> Resyn /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/resync + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/updateAdministrativeState /// /// /// Operation Id - /// NetworkTaps_Resync + /// NetworkTaps_UpdateAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -502,15 +498,19 @@ public virtual async Task> Resyn /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. /// The cancellation token to use. - public virtual ArmOperation Resync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation UpdateAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { - using var scope = _networkTapClientDiagnostics.CreateScope("NetworkTapResource.Resync"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkTapClientDiagnostics.CreateScope("NetworkTapResource.UpdateAdministrativeState"); scope.Start(); try { - var response = _networkTapRestClient.Resync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkTapClientDiagnostics, Pipeline, _networkTapRestClient.CreateResyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _networkTapRestClient.UpdateAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new DeviceUpdateCommonPostActionResultOperationSource(), _networkTapClientDiagnostics, Pipeline, _networkTapRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -535,7 +535,7 @@ public virtual ArmOperation Resync(WaitUntil /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -597,7 +597,7 @@ public virtual async Task> AddTagAsync(string key, /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -659,7 +659,7 @@ public virtual Response AddTag(string key, string value, Can /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -716,7 +716,7 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -773,7 +773,7 @@ public virtual Response SetTags(IDictionary /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -833,7 +833,7 @@ public virtual async Task> RemoveTagAsync(string ke /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapRuleCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapRuleCollection.cs index 818cbf451c43..77e39ec14ce9 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapRuleCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapRuleCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAs /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wai /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string netw /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string networkTapRuleName, C /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTok /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string networkTapRuleName, /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string networkTapRuleName, CancellationToke /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsA /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapRuleData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapRuleData.Serialization.cs index 225bf9a8478f..ffc655c5b8e0 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapRuleData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapRuleData.Serialization.cs @@ -39,73 +39,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Annotation)) - { - writer.WritePropertyName("annotation"u8); - writer.WriteStringValue(Annotation); - } - if (Optional.IsDefined(ConfigurationType)) - { - writer.WritePropertyName("configurationType"u8); - writer.WriteStringValue(ConfigurationType.Value.ToString()); - } - if (Optional.IsDefined(TapRulesUri)) - { - writer.WritePropertyName("tapRulesUrl"u8); - writer.WriteStringValue(TapRulesUri.AbsoluteUri); - } - if (Optional.IsCollectionDefined(MatchConfigurations)) - { - writer.WritePropertyName("matchConfigurations"u8); - writer.WriteStartArray(); - foreach (var item in MatchConfigurations) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(DynamicMatchConfigurations)) - { - writer.WritePropertyName("dynamicMatchConfigurations"u8); - writer.WriteStartArray(); - foreach (var item in DynamicMatchConfigurations) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NetworkTapId)) - { - writer.WritePropertyName("networkTapId"u8); - writer.WriteStringValue(NetworkTapId); - } - if (Optional.IsDefined(PollingIntervalInSeconds)) - { - writer.WritePropertyName("pollingIntervalInSeconds"u8); - writer.WriteNumberValue(PollingIntervalInSeconds.Value.ToSerialInt32()); - } - if (options.Format != "W" && Optional.IsDefined(LastSyncedOn)) - { - writer.WritePropertyName("lastSyncedTime"u8); - writer.WriteStringValue(LastSyncedOn.Value, "O"); - } - if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) - { - writer.WritePropertyName("configurationState"u8); - writer.WriteStringValue(ConfigurationState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) - { - writer.WritePropertyName("administrativeState"u8); - writer.WriteStringValue(AdministrativeState.Value.ToString()); - } - writer.WriteEndObject(); + writer.WriteObjectValue(Properties, options); } NetworkTapRuleData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -128,27 +62,22 @@ internal static NetworkTapRuleData DeserializeNetworkTapRuleData(JsonElement ele { return null; } + NetworkTapRuleProperties properties = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - string annotation = default; - NetworkFabricConfigurationType? configurationType = default; - Uri tapRulesUrl = default; - IList matchConfigurations = default; - IList dynamicMatchConfigurations = default; - ResourceIdentifier networkTapId = default; - PollingIntervalInSecond? pollingIntervalInSeconds = default; - DateTimeOffset? lastSyncedTime = default; - NetworkFabricConfigurationState? configurationState = default; - NetworkFabricProvisioningState? provisioningState = default; - NetworkFabricAdministrativeState? administrativeState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + properties = NetworkTapRuleProperties.DeserializeNetworkTapRuleProperties(property.Value, options); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -192,123 +121,6 @@ internal static NetworkTapRuleData DeserializeNetworkTapRuleData(JsonElement ele systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerManagedNetworkFabricContext.Default); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("annotation"u8)) - { - annotation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("configurationType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - configurationType = new NetworkFabricConfigurationType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("tapRulesUrl"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - tapRulesUrl = new Uri(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("matchConfigurations"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(NetworkTapRuleMatchConfiguration.DeserializeNetworkTapRuleMatchConfiguration(item, options)); - } - matchConfigurations = array; - continue; - } - if (property0.NameEquals("dynamicMatchConfigurations"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(CommonDynamicMatchConfiguration.DeserializeCommonDynamicMatchConfiguration(item, options)); - } - dynamicMatchConfigurations = array; - continue; - } - if (property0.NameEquals("networkTapId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkTapId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("pollingIntervalInSeconds"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - pollingIntervalInSeconds = new PollingIntervalInSecond(property0.Value.GetInt32()); - continue; - } - if (property0.NameEquals("lastSyncedTime"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - lastSyncedTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("configurationState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - configurationState = new NetworkFabricConfigurationState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkFabricProvisioningState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("administrativeState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - administrativeState = new NetworkFabricAdministrativeState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -322,17 +134,7 @@ internal static NetworkTapRuleData DeserializeNetworkTapRuleData(JsonElement ele systemData, tags ?? new ChangeTrackingDictionary(), location, - annotation, - configurationType, - tapRulesUrl, - matchConfigurations ?? new ChangeTrackingList(), - dynamicMatchConfigurations ?? new ChangeTrackingList(), - networkTapId, - pollingIntervalInSeconds, - lastSyncedTime, - configurationState, - provisioningState, - administrativeState, + properties, serializedAdditionalRawData); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapRuleData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapRuleData.cs index f12a71eca246..85d3240afd64 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapRuleData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapRuleData.cs @@ -53,10 +53,13 @@ public partial class NetworkTapRuleData : TrackedResourceData /// Initializes a new instance of . /// The location. - public NetworkTapRuleData(AzureLocation location) : base(location) + /// The NetworkTapRule Properties. + /// is null. + public NetworkTapRuleData(AzureLocation location, NetworkTapRuleProperties properties) : base(location) { - MatchConfigurations = new ChangeTrackingList(); - DynamicMatchConfigurations = new ChangeTrackingList(); + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; } /// Initializes a new instance of . @@ -66,31 +69,11 @@ public NetworkTapRuleData(AzureLocation location) : base(location) /// The systemData. /// The tags. /// The location. - /// Switch configuration description. - /// Input method to configure Network Tap Rule. - /// Network Tap Rules file URL. - /// List of match configurations. - /// List of dynamic match configurations. - /// The ARM resource Id of the NetworkTap. - /// Polling interval in seconds. - /// The last sync timestamp. - /// Configuration state of the resource. - /// Provisioning state of the resource. - /// Administrative state of the resource. + /// The NetworkTapRule Properties. /// Keeps track of any properties unknown to the library. - internal NetworkTapRuleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, NetworkFabricConfigurationType? configurationType, Uri tapRulesUri, IList matchConfigurations, IList dynamicMatchConfigurations, ResourceIdentifier networkTapId, PollingIntervalInSecond? pollingIntervalInSeconds, DateTimeOffset? lastSyncedOn, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NetworkTapRuleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, NetworkTapRuleProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - Annotation = annotation; - ConfigurationType = configurationType; - TapRulesUri = tapRulesUri; - MatchConfigurations = matchConfigurations; - DynamicMatchConfigurations = dynamicMatchConfigurations; - NetworkTapId = networkTapId; - PollingIntervalInSeconds = pollingIntervalInSeconds; - LastSyncedOn = lastSyncedOn; - ConfigurationState = configurationState; - ProvisioningState = provisioningState; - AdministrativeState = administrativeState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -99,27 +82,7 @@ internal NetworkTapRuleData() { } - /// Switch configuration description. - public string Annotation { get; set; } - /// Input method to configure Network Tap Rule. - public NetworkFabricConfigurationType? ConfigurationType { get; set; } - /// Network Tap Rules file URL. - public Uri TapRulesUri { get; set; } - /// List of match configurations. - public IList MatchConfigurations { get; } - /// List of dynamic match configurations. - public IList DynamicMatchConfigurations { get; } - /// The ARM resource Id of the NetworkTap. - public ResourceIdentifier NetworkTapId { get; } - /// Polling interval in seconds. - public PollingIntervalInSecond? PollingIntervalInSeconds { get; set; } - /// The last sync timestamp. - public DateTimeOffset? LastSyncedOn { get; } - /// Configuration state of the resource. - public NetworkFabricConfigurationState? ConfigurationState { get; } - /// Provisioning state of the resource. - public NetworkFabricProvisioningState? ProvisioningState { get; } - /// Administrative state of the resource. - public NetworkFabricAdministrativeState? AdministrativeState { get; } + /// The NetworkTapRule Properties. + public NetworkTapRuleProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapRuleResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapRuleResource.cs index 6cdf327475b2..b33a6f68ef09 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapRuleResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkTapRuleResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Cancellatio /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellati /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync(Wait /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -351,15 +351,15 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/updateAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/resync /// /// /// Operation Id - /// NetworkTapRules_UpdateAdministrativeState + /// NetworkTapRules_Resync /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -368,19 +368,15 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Request payload. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual async Task> ResyncAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _networkTapRuleClientDiagnostics.CreateScope("NetworkTapRuleResource.UpdateAdministrativeState"); + using var scope = _networkTapRuleClientDiagnostics.CreateScope("NetworkTapRuleResource.Resync"); scope.Start(); try { - var response = await _networkTapRuleRestClient.UpdateAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkTapRuleClientDiagnostics, Pipeline, _networkTapRuleRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _networkTapRuleRestClient.ResyncAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkTapRuleClientDiagnostics, Pipeline, _networkTapRuleRestClient.CreateResyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -397,15 +393,15 @@ public virtual async Task> Updat /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/updateAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/resync /// /// /// Operation Id - /// NetworkTapRules_UpdateAdministrativeState + /// NetworkTapRules_Resync /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -414,19 +410,15 @@ public virtual async Task> Updat /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Request payload. /// The cancellation token to use. - /// is null. - public virtual ArmOperation UpdateAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation Resync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _networkTapRuleClientDiagnostics.CreateScope("NetworkTapRuleResource.UpdateAdministrativeState"); + using var scope = _networkTapRuleClientDiagnostics.CreateScope("NetworkTapRuleResource.Resync"); scope.Start(); try { - var response = _networkTapRuleRestClient.UpdateAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkTapRuleClientDiagnostics, Pipeline, _networkTapRuleRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _networkTapRuleRestClient.Resync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkTapRuleClientDiagnostics, Pipeline, _networkTapRuleRestClient.CreateResyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -443,15 +435,15 @@ public virtual ArmOperation UpdateAdministrat /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/resync + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/updateAdministrativeState /// /// /// Operation Id - /// NetworkTapRules_Resync + /// NetworkTapRules_UpdateAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -460,15 +452,19 @@ public virtual ArmOperation UpdateAdministrat /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. /// The cancellation token to use. - public virtual async Task> ResyncAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { - using var scope = _networkTapRuleClientDiagnostics.CreateScope("NetworkTapRuleResource.Resync"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkTapRuleClientDiagnostics.CreateScope("NetworkTapRuleResource.UpdateAdministrativeState"); scope.Start(); try { - var response = await _networkTapRuleRestClient.ResyncAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkTapRuleClientDiagnostics, Pipeline, _networkTapRuleRestClient.CreateResyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _networkTapRuleRestClient.UpdateAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkTapRuleClientDiagnostics, Pipeline, _networkTapRuleRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -485,15 +481,15 @@ public virtual async Task> Resyn /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/resync + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/updateAdministrativeState /// /// /// Operation Id - /// NetworkTapRules_Resync + /// NetworkTapRules_UpdateAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -502,15 +498,19 @@ public virtual async Task> Resyn /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request payload. /// The cancellation token to use. - public virtual ArmOperation Resync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation UpdateAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { - using var scope = _networkTapRuleClientDiagnostics.CreateScope("NetworkTapRuleResource.Resync"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _networkTapRuleClientDiagnostics.CreateScope("NetworkTapRuleResource.UpdateAdministrativeState"); scope.Start(); try { - var response = _networkTapRuleRestClient.Resync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkTapRuleClientDiagnostics, Pipeline, _networkTapRuleRestClient.CreateResyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _networkTapRuleRestClient.UpdateAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkTapRuleClientDiagnostics, Pipeline, _networkTapRuleRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -535,7 +535,7 @@ public virtual ArmOperation Resync(WaitUntil /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -577,7 +577,7 @@ public virtual async Task> ValidateCon /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -619,7 +619,7 @@ public virtual ArmOperation ValidateConfiguration(W /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -681,7 +681,7 @@ public virtual async Task> AddTagAsync(string k /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -743,7 +743,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -800,7 +800,7 @@ public virtual async Task> SetTagsAsync(IDictio /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -857,7 +857,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -917,7 +917,7 @@ public virtual async Task> RemoveTagAsync(strin /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkToNetworkInterconnectCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkToNetworkInterconnectCollection.cs index a09aa3b29d39..755d4d5f823b 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkToNetworkInterconnectCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkToNetworkInterconnectCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string network /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string networkToNetworkInt /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string networkToNetworkInterconnectName, Ca /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkToNetworkInterconnectData.Serialization.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkToNetworkInterconnectData.Serialization.cs index add9b82f79fe..cd45c38dc9ba 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkToNetworkInterconnectData.Serialization.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkToNetworkInterconnectData.Serialization.cs @@ -39,70 +39,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(NniType)) - { - writer.WritePropertyName("nniType"u8); - writer.WriteStringValue(NniType.Value.ToString()); - } - if (Optional.IsDefined(IsManagementType)) - { - writer.WritePropertyName("isManagementType"u8); - writer.WriteStringValue(IsManagementType.Value.ToString()); - } - writer.WritePropertyName("useOptionB"u8); - writer.WriteStringValue(UseOptionB.ToString()); - if (Optional.IsDefined(Layer2Configuration)) - { - writer.WritePropertyName("layer2Configuration"u8); - writer.WriteObjectValue(Layer2Configuration, options); - } - if (Optional.IsDefined(OptionBLayer3Configuration)) - { - writer.WritePropertyName("optionBLayer3Configuration"u8); - writer.WriteObjectValue(OptionBLayer3Configuration, options); - } - if (Optional.IsDefined(NpbStaticRouteConfiguration)) - { - writer.WritePropertyName("npbStaticRouteConfiguration"u8); - writer.WriteObjectValue(NpbStaticRouteConfiguration, options); - } - if (Optional.IsDefined(ImportRoutePolicy)) - { - writer.WritePropertyName("importRoutePolicy"u8); - writer.WriteObjectValue(ImportRoutePolicy, options); - } - if (Optional.IsDefined(ExportRoutePolicy)) - { - writer.WritePropertyName("exportRoutePolicy"u8); - writer.WriteObjectValue(ExportRoutePolicy, options); - } - if (Optional.IsDefined(EgressAclId)) - { - writer.WritePropertyName("egressAclId"u8); - writer.WriteStringValue(EgressAclId); - } - if (Optional.IsDefined(IngressAclId)) - { - writer.WritePropertyName("ingressAclId"u8); - writer.WriteStringValue(IngressAclId); - } - if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) - { - writer.WritePropertyName("configurationState"u8); - writer.WriteStringValue(ConfigurationState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(AdministrativeState)) - { - writer.WritePropertyName("administrativeState"u8); - writer.WriteStringValue(AdministrativeState.Value.ToString()); - } - writer.WriteEndObject(); + writer.WriteObjectValue(Properties, options); } NetworkToNetworkInterconnectData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -125,27 +62,20 @@ internal static NetworkToNetworkInterconnectData DeserializeNetworkToNetworkInte { return null; } + NetworkToNetworkInterconnectProperties properties = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - NniType? nniType = default; - IsManagementType? isManagementType = default; - NetworkFabricBooleanValue useOptionB = default; - Layer2Configuration layer2Configuration = default; - NetworkToNetworkInterconnectOptionBLayer3Configuration optionBLayer3Configuration = default; - NpbStaticRouteConfiguration npbStaticRouteConfiguration = default; - ImportRoutePolicyInformation importRoutePolicy = default; - ExportRoutePolicyInformation exportRoutePolicy = default; - ResourceIdentifier egressAclId = default; - ResourceIdentifier ingressAclId = default; - NetworkFabricConfigurationState? configurationState = default; - NetworkFabricProvisioningState? provisioningState = default; - NetworkFabricAdministrativeState? administrativeState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + properties = NetworkToNetworkInterconnectProperties.DeserializeNetworkToNetworkInterconnectProperties(property.Value, options); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -170,131 +100,6 @@ internal static NetworkToNetworkInterconnectData DeserializeNetworkToNetworkInte systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerManagedNetworkFabricContext.Default); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("nniType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - nniType = new NniType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("isManagementType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isManagementType = new IsManagementType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("useOptionB"u8)) - { - useOptionB = new NetworkFabricBooleanValue(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("layer2Configuration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - layer2Configuration = Layer2Configuration.DeserializeLayer2Configuration(property0.Value, options); - continue; - } - if (property0.NameEquals("optionBLayer3Configuration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - optionBLayer3Configuration = NetworkToNetworkInterconnectOptionBLayer3Configuration.DeserializeNetworkToNetworkInterconnectOptionBLayer3Configuration(property0.Value, options); - continue; - } - if (property0.NameEquals("npbStaticRouteConfiguration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - npbStaticRouteConfiguration = NpbStaticRouteConfiguration.DeserializeNpbStaticRouteConfiguration(property0.Value, options); - continue; - } - if (property0.NameEquals("importRoutePolicy"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - importRoutePolicy = ImportRoutePolicyInformation.DeserializeImportRoutePolicyInformation(property0.Value, options); - continue; - } - if (property0.NameEquals("exportRoutePolicy"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - exportRoutePolicy = ExportRoutePolicyInformation.DeserializeExportRoutePolicyInformation(property0.Value, options); - continue; - } - if (property0.NameEquals("egressAclId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - egressAclId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("ingressAclId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - ingressAclId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("configurationState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - configurationState = new NetworkFabricConfigurationState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkFabricProvisioningState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("administrativeState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - administrativeState = new NetworkFabricAdministrativeState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -306,19 +111,7 @@ internal static NetworkToNetworkInterconnectData DeserializeNetworkToNetworkInte name, type, systemData, - nniType, - isManagementType, - useOptionB, - layer2Configuration, - optionBLayer3Configuration, - npbStaticRouteConfiguration, - importRoutePolicy, - exportRoutePolicy, - egressAclId, - ingressAclId, - configurationState, - provisioningState, - administrativeState, + properties, serializedAdditionalRawData); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkToNetworkInterconnectData.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkToNetworkInterconnectData.cs index 80473c6cac16..dc6f43957a61 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkToNetworkInterconnectData.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkToNetworkInterconnectData.cs @@ -52,10 +52,13 @@ public partial class NetworkToNetworkInterconnectData : ResourceData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Based on this option layer3 parameters are mandatory. Example: True/False. - public NetworkToNetworkInterconnectData(NetworkFabricBooleanValue useOptionB) + /// The NetworkToNetworkInterconnect Properties. + /// is null. + public NetworkToNetworkInterconnectData(NetworkToNetworkInterconnectProperties properties) { - UseOptionB = useOptionB; + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; } /// Initializes a new instance of . @@ -63,35 +66,11 @@ public NetworkToNetworkInterconnectData(NetworkFabricBooleanValue useOptionB) /// The name. /// The resourceType. /// The systemData. - /// Type of NNI used. Example: CE | NPB. - /// Configuration to use NNI for Infrastructure Management. Example: True/False. - /// Based on this option layer3 parameters are mandatory. Example: True/False. - /// Common properties for Layer2 Configuration. - /// Common properties for Layer3Configuration. - /// NPB Static Route Configuration properties. - /// Import Route Policy configuration. - /// Export Route Policy configuration. - /// Egress Acl. ARM resource ID of Access Control Lists. - /// Ingress Acl. ARM resource ID of Access Control Lists. - /// Configuration state of the resource. - /// Provisioning state of the resource. - /// Administrative state of the resource. + /// The NetworkToNetworkInterconnect Properties. /// Keeps track of any properties unknown to the library. - internal NetworkToNetworkInterconnectData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NniType? nniType, IsManagementType? isManagementType, NetworkFabricBooleanValue useOptionB, Layer2Configuration layer2Configuration, NetworkToNetworkInterconnectOptionBLayer3Configuration optionBLayer3Configuration, NpbStaticRouteConfiguration npbStaticRouteConfiguration, ImportRoutePolicyInformation importRoutePolicy, ExportRoutePolicyInformation exportRoutePolicy, ResourceIdentifier egressAclId, ResourceIdentifier ingressAclId, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal NetworkToNetworkInterconnectData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NetworkToNetworkInterconnectProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { - NniType = nniType; - IsManagementType = isManagementType; - UseOptionB = useOptionB; - Layer2Configuration = layer2Configuration; - OptionBLayer3Configuration = optionBLayer3Configuration; - NpbStaticRouteConfiguration = npbStaticRouteConfiguration; - ImportRoutePolicy = importRoutePolicy; - ExportRoutePolicy = exportRoutePolicy; - EgressAclId = egressAclId; - IngressAclId = ingressAclId; - ConfigurationState = configurationState; - ProvisioningState = provisioningState; - AdministrativeState = administrativeState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -100,31 +79,7 @@ internal NetworkToNetworkInterconnectData() { } - /// Type of NNI used. Example: CE | NPB. - public NniType? NniType { get; set; } - /// Configuration to use NNI for Infrastructure Management. Example: True/False. - public IsManagementType? IsManagementType { get; set; } - /// Based on this option layer3 parameters are mandatory. Example: True/False. - public NetworkFabricBooleanValue UseOptionB { get; set; } - /// Common properties for Layer2 Configuration. - public Layer2Configuration Layer2Configuration { get; set; } - /// Common properties for Layer3Configuration. - public NetworkToNetworkInterconnectOptionBLayer3Configuration OptionBLayer3Configuration { get; set; } - /// NPB Static Route Configuration properties. - public NpbStaticRouteConfiguration NpbStaticRouteConfiguration { get; set; } - /// Import Route Policy configuration. - public ImportRoutePolicyInformation ImportRoutePolicy { get; set; } - /// Export Route Policy configuration. - public ExportRoutePolicyInformation ExportRoutePolicy { get; set; } - /// Egress Acl. ARM resource ID of Access Control Lists. - public ResourceIdentifier EgressAclId { get; set; } - /// Ingress Acl. ARM resource ID of Access Control Lists. - public ResourceIdentifier IngressAclId { get; set; } - /// Configuration state of the resource. - public NetworkFabricConfigurationState? ConfigurationState { get; } - /// Provisioning state of the resource. - public NetworkFabricProvisioningState? ProvisioningState { get; } - /// Administrative state of the resource. - public NetworkFabricAdministrativeState? AdministrativeState { get; } + /// The NetworkToNetworkInterconnect Properties. + public NetworkToNetworkInterconnectProperties Properties { get; set; } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkToNetworkInterconnectResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkToNetworkInterconnectResource.cs index 37c57ef59d63..592739a5c405 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkToNetworkInterconnectResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkToNetworkInterconnectResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> Up /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -346,19 +346,19 @@ public virtual ArmOperation Update(WaitUnt } /// - /// Updates the NPB Static Route BFD Administrative State. + /// Updates the Admin State. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateNpbStaticRouteBfdAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateAdministrativeState /// /// /// Operation Id - /// NetworkToNetworkInterconnects_UpdateNpbStaticRouteBfdAdministrativeState + /// NetworkToNetworkInterconnects_UpdateAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -370,16 +370,16 @@ public virtual ArmOperation Update(WaitUnt /// Request payload. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateNpbStaticRouteBfdAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _networkToNetworkInterconnectClientDiagnostics.CreateScope("NetworkToNetworkInterconnectResource.UpdateNpbStaticRouteBfdAdministrativeState"); + using var scope = _networkToNetworkInterconnectClientDiagnostics.CreateScope("NetworkToNetworkInterconnectResource.UpdateAdministrativeState"); scope.Start(); try { - var response = await _networkToNetworkInterconnectRestClient.UpdateNpbStaticRouteBfdAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkToNetworkInterconnectClientDiagnostics, Pipeline, _networkToNetworkInterconnectRestClient.CreateUpdateNpbStaticRouteBfdAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _networkToNetworkInterconnectRestClient.UpdateAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkToNetworkInterconnectClientDiagnostics, Pipeline, _networkToNetworkInterconnectRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -392,19 +392,19 @@ public virtual async Task> Updat } /// - /// Updates the NPB Static Route BFD Administrative State. + /// Updates the Admin State. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateNpbStaticRouteBfdAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateAdministrativeState /// /// /// Operation Id - /// NetworkToNetworkInterconnects_UpdateNpbStaticRouteBfdAdministrativeState + /// NetworkToNetworkInterconnects_UpdateAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -416,16 +416,16 @@ public virtual async Task> Updat /// Request payload. /// The cancellation token to use. /// is null. - public virtual ArmOperation UpdateNpbStaticRouteBfdAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation UpdateAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _networkToNetworkInterconnectClientDiagnostics.CreateScope("NetworkToNetworkInterconnectResource.UpdateNpbStaticRouteBfdAdministrativeState"); + using var scope = _networkToNetworkInterconnectClientDiagnostics.CreateScope("NetworkToNetworkInterconnectResource.UpdateAdministrativeState"); scope.Start(); try { - var response = _networkToNetworkInterconnectRestClient.UpdateNpbStaticRouteBfdAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkToNetworkInterconnectClientDiagnostics, Pipeline, _networkToNetworkInterconnectRestClient.CreateUpdateNpbStaticRouteBfdAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _networkToNetworkInterconnectRestClient.UpdateAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkToNetworkInterconnectClientDiagnostics, Pipeline, _networkToNetworkInterconnectRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -442,15 +442,15 @@ public virtual ArmOperation UpdateNpbStaticRo /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateBfdAdministrativeState /// /// /// Operation Id - /// NetworkToNetworkInterconnects_UpdateAdministrativeState + /// NetworkToNetworkInterconnects_UpdateBfdAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -462,16 +462,16 @@ public virtual ArmOperation UpdateNpbStaticRo /// Request payload. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAdministrativeStateAsync(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual async Task> UpdateBfdAdministrativeStateAsync(WaitUntil waitUntil, NniBfdAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _networkToNetworkInterconnectClientDiagnostics.CreateScope("NetworkToNetworkInterconnectResource.UpdateAdministrativeState"); + using var scope = _networkToNetworkInterconnectClientDiagnostics.CreateScope("NetworkToNetworkInterconnectResource.UpdateBfdAdministrativeState"); scope.Start(); try { - var response = await _networkToNetworkInterconnectRestClient.UpdateAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkToNetworkInterconnectClientDiagnostics, Pipeline, _networkToNetworkInterconnectRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _networkToNetworkInterconnectRestClient.UpdateBfdAdministrativeStateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ManagedNetworkFabricArmOperation(new NniBfdAdministrativeStateResultOperationSource(), _networkToNetworkInterconnectClientDiagnostics, Pipeline, _networkToNetworkInterconnectRestClient.CreateUpdateBfdAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -488,15 +488,15 @@ public virtual async Task> Updat /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateAdministrativeState + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateBfdAdministrativeState /// /// /// Operation Id - /// NetworkToNetworkInterconnects_UpdateAdministrativeState + /// NetworkToNetworkInterconnects_UpdateBfdAdministrativeState /// /// /// Default Api Version - /// 2023-06-15 + /// 2024-06-15-preview /// /// /// Resource @@ -508,16 +508,16 @@ public virtual async Task> Updat /// Request payload. /// The cancellation token to use. /// is null. - public virtual ArmOperation UpdateAdministrativeState(WaitUntil waitUntil, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation UpdateBfdAdministrativeState(WaitUntil waitUntil, NniBfdAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _networkToNetworkInterconnectClientDiagnostics.CreateScope("NetworkToNetworkInterconnectResource.UpdateAdministrativeState"); + using var scope = _networkToNetworkInterconnectClientDiagnostics.CreateScope("NetworkToNetworkInterconnectResource.UpdateBfdAdministrativeState"); scope.Start(); try { - var response = _networkToNetworkInterconnectRestClient.UpdateAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new ManagedNetworkFabricArmOperation(new StateUpdateCommonPostActionResultOperationSource(), _networkToNetworkInterconnectClientDiagnostics, Pipeline, _networkToNetworkInterconnectRestClient.CreateUpdateAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _networkToNetworkInterconnectRestClient.UpdateBfdAdministrativeState(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new ManagedNetworkFabricArmOperation(new NniBfdAdministrativeStateResultOperationSource(), _networkToNetworkInterconnectClientDiagnostics, Pipeline, _networkToNetworkInterconnectRestClient.CreateUpdateBfdAdministrativeStateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/AccessControlListsRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/AccessControlListsRestOperations.cs index 4e3aae70dc7f..6f62e722d7dc 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/AccessControlListsRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/AccessControlListsRestOperations.cs @@ -32,103 +32,89 @@ public AccessControlListsRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string accessControlListName, NetworkFabricAccessControlListData data) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists/", false); - uri.AppendPath(accessControlListName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string accessControlListName, NetworkFabricAccessControlListData data) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists/", false); - uri.AppendPath(accessControlListName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Implements Access Control List PUT method. + /// Implements AccessControlLists list by subscription GET method. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Name of the Access Control List. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string accessControlListName, NetworkFabricAccessControlListData data, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accessControlListName, nameof(accessControlListName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accessControlListName, data); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + AccessControlListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AccessControlListResult.DeserializeAccessControlListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Implements Access Control List PUT method. + /// Implements AccessControlLists list by subscription GET method. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Name of the Access Control List. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string accessControlListName, NetworkFabricAccessControlListData data, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accessControlListName, nameof(accessControlListName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accessControlListName, data); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + AccessControlListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AccessControlListResult.DeserializeAccessControlListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string accessControlListName) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -136,13 +122,12 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists/", false); - uri.AppendPath(accessControlListName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string accessControlListName) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -153,8 +138,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists/", false); - uri.AppendPath(accessControlListName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -162,69 +146,61 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Implements Access Control List GET method. + /// Implements AccessControlLists list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Access Control List. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string accessControlListName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accessControlListName, nameof(accessControlListName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, accessControlListName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkFabricAccessControlListData value = default; + AccessControlListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkFabricAccessControlListData.DeserializeNetworkFabricAccessControlListData(document.RootElement); + value = AccessControlListResult.DeserializeAccessControlListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((NetworkFabricAccessControlListData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Implements Access Control List GET method. + /// Implements AccessControlLists list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Access Control List. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string accessControlListName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accessControlListName, nameof(accessControlListName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, accessControlListName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkFabricAccessControlListData value = default; + AccessControlListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkFabricAccessControlListData.DeserializeNetworkFabricAccessControlListData(document.RootElement); + value = AccessControlListResult.DeserializeAccessControlListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((NetworkFabricAccessControlListData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string accessControlListName, NetworkFabricAccessControlListPatch patch) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string accessControlListName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -238,11 +214,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string accessControlListName, NetworkFabricAccessControlListPatch patch) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string accessControlListName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -254,69 +230,73 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// API to update certain properties of the Access Control List resource. + /// Implements Access Control List GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Access Control List. - /// Access Control List properties to update. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string accessControlListName, NetworkFabricAccessControlListPatch patch, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string accessControlListName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accessControlListName, nameof(accessControlListName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, accessControlListName, patch); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, accessControlListName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + NetworkFabricAccessControlListData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkFabricAccessControlListData.DeserializeNetworkFabricAccessControlListData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkFabricAccessControlListData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// API to update certain properties of the Access Control List resource. + /// Implements Access Control List GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Access Control List. - /// Access Control List properties to update. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string accessControlListName, NetworkFabricAccessControlListPatch patch, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string accessControlListName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accessControlListName, nameof(accessControlListName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, accessControlListName, patch); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, accessControlListName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + NetworkFabricAccessControlListData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkFabricAccessControlListData.DeserializeNetworkFabricAccessControlListData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkFabricAccessControlListData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string accessControlListName) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string accessControlListName, NetworkFabricAccessControlListData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -330,11 +310,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string accessControlListName) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string accessControlListName, NetworkFabricAccessControlListData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -346,61 +326,69 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Implements Access Control List DELETE method. + /// Implements Access Control List PUT method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Access Control List. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string accessControlListName, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string accessControlListName, NetworkFabricAccessControlListData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accessControlListName, nameof(accessControlListName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, accessControlListName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accessControlListName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 202: - case 204: + case 200: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements Access Control List DELETE method. + /// Implements Access Control List PUT method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Access Control List. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string accessControlListName, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string accessControlListName, NetworkFabricAccessControlListData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accessControlListName, nameof(accessControlListName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, accessControlListName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accessControlListName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 202: - case 204: + case 200: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string accessControlListName, NetworkFabricAccessControlListPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -408,105 +396,117 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists/", false); + uri.AppendPath(accessControlListName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string accessControlListName, NetworkFabricAccessControlListPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists/", false); + uri.AppendPath(accessControlListName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Implements AccessControlLists list by resource group GET method. + /// API to update certain properties of the Access Control List resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Access Control List. + /// Access Control List properties to update. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string accessControlListName, NetworkFabricAccessControlListPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accessControlListName, nameof(accessControlListName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, accessControlListName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - AccessControlListsResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = AccessControlListsResult.DeserializeAccessControlListsResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements AccessControlLists list by resource group GET method. + /// API to update certain properties of the Access Control List resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Access Control List. + /// Access Control List properties to update. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string accessControlListName, NetworkFabricAccessControlListPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accessControlListName, nameof(accessControlListName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, accessControlListName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - AccessControlListsResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = AccessControlListsResult.DeserializeAccessControlListsResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string accessControlListName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists/", false); + uri.AppendPath(accessControlListName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string accessControlListName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists/", false); + uri.AppendPath(accessControlListName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -514,57 +514,57 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) return message; } - /// Implements AccessControlLists list by subscription GET method. + /// Implements Access Control List DELETE method. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Access Control List. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string accessControlListName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accessControlListName, nameof(accessControlListName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, accessControlListName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - AccessControlListsResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = AccessControlListsResult.DeserializeAccessControlListsResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements AccessControlLists list by subscription GET method. + /// Implements Access Control List DELETE method. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Access Control List. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string accessControlListName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accessControlListName, nameof(accessControlListName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, accessControlListName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - AccessControlListsResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = AccessControlListsResult.DeserializeAccessControlListsResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string accessControlListName, UpdateAdministrativeStateContent content) + internal RequestUriBuilder CreateResyncRequestUri(string subscriptionId, string resourceGroupName, string accessControlListName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -574,12 +574,12 @@ internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subs uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists/", false); uri.AppendPath(accessControlListName, true); - uri.AppendPath("/updateAdministrativeState", false); + uri.AppendPath("/resync", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string accessControlListName, UpdateAdministrativeStateContent content) + internal HttpMessage CreateResyncRequest(string subscriptionId, string resourceGroupName, string accessControlListName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -592,14 +592,10 @@ internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionI uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists/", false); uri.AppendPath(accessControlListName, true); - uri.AppendPath("/updateAdministrativeState", false); + uri.AppendPath("/resync", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; _userAgent.Apply(message); return message; } @@ -608,18 +604,16 @@ internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionI /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Access Control List. - /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string accessControlListName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public async Task ResyncAsync(string subscriptionId, string resourceGroupName, string accessControlListName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accessControlListName, nameof(accessControlListName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, accessControlListName, content); + using var message = CreateResyncRequest(subscriptionId, resourceGroupName, accessControlListName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -635,18 +629,16 @@ public async Task UpdateAdministrativeStateAsync(string subscriptionId /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Access Control List. - /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response UpdateAdministrativeState(string subscriptionId, string resourceGroupName, string accessControlListName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public Response Resync(string subscriptionId, string resourceGroupName, string accessControlListName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accessControlListName, nameof(accessControlListName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, accessControlListName, content); + using var message = CreateResyncRequest(subscriptionId, resourceGroupName, accessControlListName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -658,7 +650,7 @@ public Response UpdateAdministrativeState(string subscriptionId, string resource } } - internal RequestUriBuilder CreateResyncRequestUri(string subscriptionId, string resourceGroupName, string accessControlListName) + internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string accessControlListName, UpdateAdministrativeStateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -668,12 +660,12 @@ internal RequestUriBuilder CreateResyncRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists/", false); uri.AppendPath(accessControlListName, true); - uri.AppendPath("/resync", false); + uri.AppendPath("/updateAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateResyncRequest(string subscriptionId, string resourceGroupName, string accessControlListName) + internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string accessControlListName, UpdateAdministrativeStateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -686,10 +678,14 @@ internal HttpMessage CreateResyncRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/accessControlLists/", false); uri.AppendPath(accessControlListName, true); - uri.AppendPath("/resync", false); + uri.AppendPath("/updateAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } @@ -698,16 +694,18 @@ internal HttpMessage CreateResyncRequest(string subscriptionId, string resourceG /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Access Control List. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task ResyncAsync(string subscriptionId, string resourceGroupName, string accessControlListName, CancellationToken cancellationToken = default) + public async Task UpdateAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string accessControlListName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accessControlListName, nameof(accessControlListName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateResyncRequest(subscriptionId, resourceGroupName, accessControlListName); + using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, accessControlListName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -723,16 +721,18 @@ public async Task ResyncAsync(string subscriptionId, string resourceGr /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Access Control List. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Resync(string subscriptionId, string resourceGroupName, string accessControlListName, CancellationToken cancellationToken = default) + public Response UpdateAdministrativeState(string subscriptionId, string resourceGroupName, string accessControlListName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accessControlListName, nameof(accessControlListName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateResyncRequest(subscriptionId, resourceGroupName, accessControlListName); + using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, accessControlListName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -830,7 +830,7 @@ public Response ValidateConfiguration(string subscriptionId, string resourceGrou } } - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -838,7 +838,7 @@ internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string ne return uri; } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -852,28 +852,26 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// Implements AccessControlLists list by resource group GET method. + /// Implements AccessControlLists list by subscription GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AccessControlListsResult value = default; + AccessControlListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = AccessControlListsResult.DeserializeAccessControlListsResult(document.RootElement); + value = AccessControlListResult.DeserializeAccessControlListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -881,28 +879,26 @@ public async Task> ListByResourceGroupNextPag } } - /// Implements AccessControlLists list by resource group GET method. + /// Implements AccessControlLists list by subscription GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AccessControlListsResult value = default; + AccessControlListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = AccessControlListsResult.DeserializeAccessControlListsResult(document.RootElement); + value = AccessControlListResult.DeserializeAccessControlListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -910,7 +906,7 @@ public Response ListByResourceGroupNextPage(string nex } } - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -918,7 +914,7 @@ internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nex return uri; } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -932,26 +928,28 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st return message; } - /// Implements AccessControlLists list by subscription GET method. + /// Implements AccessControlLists list by resource group GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AccessControlListsResult value = default; + AccessControlListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = AccessControlListsResult.DeserializeAccessControlListsResult(document.RootElement); + value = AccessControlListResult.DeserializeAccessControlListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -959,26 +957,28 @@ public async Task> ListBySubscriptionNextPage } } - /// Implements AccessControlLists list by subscription GET method. + /// Implements AccessControlLists list by resource group GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AccessControlListsResult value = default; + AccessControlListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = AccessControlListsResult.DeserializeAccessControlListsResult(document.RootElement); + value = AccessControlListResult.DeserializeAccessControlListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/ExternalNetworksRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/ExternalNetworksRestOperations.cs index ab31fbae55b2..42847158a32b 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/ExternalNetworksRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/ExternalNetworksRestOperations.cs @@ -32,11 +32,11 @@ public ExternalNetworksRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, NetworkFabricExternalNetworkData data) + internal RequestUriBuilder CreateListByL3IsolationDomainRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -46,17 +46,16 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); uri.AppendPath(l3IsolationDomainName, true); - uri.AppendPath("/externalNetworks/", false); - uri.AppendPath(externalNetworkName, true); + uri.AppendPath("/externalNetworks", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, NetworkFabricExternalNetworkData data) + internal HttpMessage CreateListByL3IsolationDomainRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -65,72 +64,67 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); uri.AppendPath(l3IsolationDomainName, true); - uri.AppendPath("/externalNetworks/", false); - uri.AppendPath(externalNetworkName, true); + uri.AppendPath("/externalNetworks", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Creates ExternalNetwork PUT method. + /// Implements External Networks list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. - /// Name of the External Network. - /// Request payload. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, NetworkFabricExternalNetworkData data, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByL3IsolationDomainAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); - Argument.AssertNotNullOrEmpty(externalNetworkName, nameof(externalNetworkName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName, data); + using var message = CreateListByL3IsolationDomainRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + ExternalNetworkListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExternalNetworkListResult.DeserializeExternalNetworkListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Creates ExternalNetwork PUT method. + /// Implements External Networks list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. - /// Name of the External Network. - /// Request payload. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, NetworkFabricExternalNetworkData data, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByL3IsolationDomain(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); - Argument.AssertNotNullOrEmpty(externalNetworkName, nameof(externalNetworkName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName, data); + using var message = CreateListByL3IsolationDomainRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + ExternalNetworkListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExternalNetworkListResult.DeserializeExternalNetworkListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -240,7 +234,7 @@ public Response Get(string subscriptionId, str } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, NetworkFabricExternalNetworkPatch patch) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, NetworkFabricExternalNetworkData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -256,11 +250,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, NetworkFabricExternalNetworkPatch patch) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, NetworkFabricExternalNetworkData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -276,71 +270,71 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; } - /// API to update certain properties of the ExternalNetworks resource. + /// Creates ExternalNetwork PUT method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. /// Name of the External Network. - /// ExternalNetwork properties to update. Only annotations are supported. + /// Request payload. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, NetworkFabricExternalNetworkPatch patch, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, NetworkFabricExternalNetworkData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); Argument.AssertNotNullOrEmpty(externalNetworkName, nameof(externalNetworkName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// API to update certain properties of the ExternalNetworks resource. + /// Creates ExternalNetwork PUT method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. /// Name of the External Network. - /// ExternalNetwork properties to update. Only annotations are supported. + /// Request payload. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, NetworkFabricExternalNetworkPatch patch, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, NetworkFabricExternalNetworkData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); Argument.AssertNotNullOrEmpty(externalNetworkName, nameof(externalNetworkName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, NetworkFabricExternalNetworkPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -356,11 +350,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, NetworkFabricExternalNetworkPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -374,65 +368,73 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Implements ExternalNetworks DELETE method. + /// API to update certain properties of the ExternalNetworks resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. /// Name of the External Network. + /// ExternalNetwork properties to update. Only annotations are supported. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, NetworkFabricExternalNetworkPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); Argument.AssertNotNullOrEmpty(externalNetworkName, nameof(externalNetworkName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements ExternalNetworks DELETE method. + /// API to update certain properties of the ExternalNetworks resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. /// Name of the External Network. + /// ExternalNetwork properties to update. Only annotations are supported. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, NetworkFabricExternalNetworkPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); Argument.AssertNotNullOrEmpty(externalNetworkName, nameof(externalNetworkName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByL3IsolationDomainRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -442,16 +444,17 @@ internal RequestUriBuilder CreateListByL3IsolationDomainRequestUri(string subscr uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); uri.AppendPath(l3IsolationDomainName, true); - uri.AppendPath("/externalNetworks", false); + uri.AppendPath("/externalNetworks/", false); + uri.AppendPath(externalNetworkName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByL3IsolationDomainRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -460,7 +463,8 @@ internal HttpMessage CreateListByL3IsolationDomainRequest(string subscriptionId, uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); uri.AppendPath(l3IsolationDomainName, true); - uri.AppendPath("/externalNetworks", false); + uri.AppendPath("/externalNetworks/", false); + uri.AppendPath(externalNetworkName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -468,59 +472,55 @@ internal HttpMessage CreateListByL3IsolationDomainRequest(string subscriptionId, return message; } - /// Implements External Networks list by resource group GET method. + /// Implements ExternalNetworks DELETE method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. + /// Name of the External Network. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByL3IsolationDomainAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); + Argument.AssertNotNullOrEmpty(externalNetworkName, nameof(externalNetworkName)); - using var message = CreateListByL3IsolationDomainRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - ExternalNetworksList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ExternalNetworksList.DeserializeExternalNetworksList(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements External Networks list by resource group GET method. + /// Implements ExternalNetworks DELETE method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. + /// Name of the External Network. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByL3IsolationDomain(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); + Argument.AssertNotNullOrEmpty(externalNetworkName, nameof(externalNetworkName)); - using var message = CreateListByL3IsolationDomainRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - ExternalNetworksList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ExternalNetworksList.DeserializeExternalNetworksList(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -628,7 +628,7 @@ public Response UpdateAdministrativeState(string subscriptionId, string resource } } - internal RequestUriBuilder CreateUpdateStaticRouteBfdAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, UpdateAdministrativeStateContent content) + internal RequestUriBuilder CreateUpdateBfdAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, ExternalNetworkBfdAdministrativeStateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -640,12 +640,12 @@ internal RequestUriBuilder CreateUpdateStaticRouteBfdAdministrativeStateRequestU uri.AppendPath(l3IsolationDomainName, true); uri.AppendPath("/externalNetworks/", false); uri.AppendPath(externalNetworkName, true); - uri.AppendPath("/updateStaticRouteBfdAdministrativeState", false); + uri.AppendPath("/updateBfdAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateStaticRouteBfdAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, UpdateAdministrativeStateContent content) + internal HttpMessage CreateUpdateBfdAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, ExternalNetworkBfdAdministrativeStateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -660,7 +660,7 @@ internal HttpMessage CreateUpdateStaticRouteBfdAdministrativeStateRequest(string uri.AppendPath(l3IsolationDomainName, true); uri.AppendPath("/externalNetworks/", false); uri.AppendPath(externalNetworkName, true); - uri.AppendPath("/updateStaticRouteBfdAdministrativeState", false); + uri.AppendPath("/updateBfdAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -672,7 +672,7 @@ internal HttpMessage CreateUpdateStaticRouteBfdAdministrativeStateRequest(string return message; } - /// Update Static Route BFD for external Network. + /// BFD administrative state for either static or bgp for internalNetwork. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. @@ -681,7 +681,7 @@ internal HttpMessage CreateUpdateStaticRouteBfdAdministrativeStateRequest(string /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateStaticRouteBfdAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public async Task UpdateBfdAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, ExternalNetworkBfdAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -689,7 +689,7 @@ public async Task UpdateStaticRouteBfdAdministrativeStateAsync(string Argument.AssertNotNullOrEmpty(externalNetworkName, nameof(externalNetworkName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateStaticRouteBfdAdministrativeStateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName, content); + using var message = CreateUpdateBfdAdministrativeStateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -701,7 +701,7 @@ public async Task UpdateStaticRouteBfdAdministrativeStateAsync(string } } - /// Update Static Route BFD for external Network. + /// BFD administrative state for either static or bgp for internalNetwork. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. @@ -710,7 +710,7 @@ public async Task UpdateStaticRouteBfdAdministrativeStateAsync(string /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response UpdateStaticRouteBfdAdministrativeState(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public Response UpdateBfdAdministrativeState(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string externalNetworkName, ExternalNetworkBfdAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -718,7 +718,7 @@ public Response UpdateStaticRouteBfdAdministrativeState(string subscriptionId, s Argument.AssertNotNullOrEmpty(externalNetworkName, nameof(externalNetworkName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateStaticRouteBfdAdministrativeStateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName, content); + using var message = CreateUpdateBfdAdministrativeStateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -760,7 +760,7 @@ internal HttpMessage CreateListByL3IsolationDomainNextPageRequest(string nextLin /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByL3IsolationDomainNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) + public async Task> ListByL3IsolationDomainNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -773,9 +773,9 @@ public async Task> ListByL3IsolationDomainNextPag { case 200: { - ExternalNetworksList value = default; + ExternalNetworkListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ExternalNetworksList.DeserializeExternalNetworksList(document.RootElement); + value = ExternalNetworkListResult.DeserializeExternalNetworkListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -791,7 +791,7 @@ public async Task> ListByL3IsolationDomainNextPag /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListByL3IsolationDomainNextPage(string nextLink, string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) + public Response ListByL3IsolationDomainNextPage(string nextLink, string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -804,9 +804,9 @@ public Response ListByL3IsolationDomainNextPage(string nex { case 200: { - ExternalNetworksList value = default; + ExternalNetworkListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ExternalNetworksList.DeserializeExternalNetworksList(document.RootElement); + value = ExternalNetworkListResult.DeserializeExternalNetworkListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/InternalNetworksRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/InternalNetworksRestOperations.cs index 84fc60715d6d..31feecf1a816 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/InternalNetworksRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/InternalNetworksRestOperations.cs @@ -32,11 +32,11 @@ public InternalNetworksRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, NetworkFabricInternalNetworkData data) + internal RequestUriBuilder CreateListByL3IsolationDomainRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -46,17 +46,16 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); uri.AppendPath(l3IsolationDomainName, true); - uri.AppendPath("/internalNetworks/", false); - uri.AppendPath(internalNetworkName, true); + uri.AppendPath("/internalNetworks", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, NetworkFabricInternalNetworkData data) + internal HttpMessage CreateListByL3IsolationDomainRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -65,72 +64,67 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); uri.AppendPath(l3IsolationDomainName, true); - uri.AppendPath("/internalNetworks/", false); - uri.AppendPath(internalNetworkName, true); + uri.AppendPath("/internalNetworks", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Creates InternalNetwork PUT method. + /// Displays InternalNetworks list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. - /// Name of the Internal Network. - /// Request payload. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, NetworkFabricInternalNetworkData data, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByL3IsolationDomainAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); - Argument.AssertNotNullOrEmpty(internalNetworkName, nameof(internalNetworkName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName, data); + using var message = CreateListByL3IsolationDomainRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + InternalNetworkListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = InternalNetworkListResult.DeserializeInternalNetworkListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Creates InternalNetwork PUT method. + /// Displays InternalNetworks list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. - /// Name of the Internal Network. - /// Request payload. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, NetworkFabricInternalNetworkData data, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByL3IsolationDomain(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); - Argument.AssertNotNullOrEmpty(internalNetworkName, nameof(internalNetworkName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName, data); + using var message = CreateListByL3IsolationDomainRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + InternalNetworkListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = InternalNetworkListResult.DeserializeInternalNetworkListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -240,7 +234,7 @@ public Response Get(string subscriptionId, str } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, NetworkFabricInternalNetworkPatch patch) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, NetworkFabricInternalNetworkData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -256,11 +250,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, NetworkFabricInternalNetworkPatch patch) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, NetworkFabricInternalNetworkData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -276,71 +270,71 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; } - /// Updates a InternalNetworks. + /// Creates InternalNetwork PUT method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. /// Name of the Internal Network. - /// InternalNetwork properties to update. Only annotations are supported. + /// Request payload. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, NetworkFabricInternalNetworkPatch patch, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, NetworkFabricInternalNetworkData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); Argument.AssertNotNullOrEmpty(internalNetworkName, nameof(internalNetworkName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Updates a InternalNetworks. + /// Creates InternalNetwork PUT method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. /// Name of the Internal Network. - /// InternalNetwork properties to update. Only annotations are supported. + /// Request payload. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, NetworkFabricInternalNetworkPatch patch, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, NetworkFabricInternalNetworkData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); Argument.AssertNotNullOrEmpty(internalNetworkName, nameof(internalNetworkName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, NetworkFabricInternalNetworkPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -356,11 +350,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, NetworkFabricInternalNetworkPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -374,65 +368,73 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Implements InternalNetworks DELETE method. + /// Updates a InternalNetworks. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. /// Name of the Internal Network. + /// InternalNetwork properties to update. Only annotations are supported. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, NetworkFabricInternalNetworkPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); Argument.AssertNotNullOrEmpty(internalNetworkName, nameof(internalNetworkName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements InternalNetworks DELETE method. + /// Updates a InternalNetworks. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. /// Name of the Internal Network. + /// InternalNetwork properties to update. Only annotations are supported. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, NetworkFabricInternalNetworkPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); Argument.AssertNotNullOrEmpty(internalNetworkName, nameof(internalNetworkName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByL3IsolationDomainRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -442,16 +444,17 @@ internal RequestUriBuilder CreateListByL3IsolationDomainRequestUri(string subscr uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); uri.AppendPath(l3IsolationDomainName, true); - uri.AppendPath("/internalNetworks", false); + uri.AppendPath("/internalNetworks/", false); + uri.AppendPath(internalNetworkName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByL3IsolationDomainRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -460,7 +463,8 @@ internal HttpMessage CreateListByL3IsolationDomainRequest(string subscriptionId, uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); uri.AppendPath(l3IsolationDomainName, true); - uri.AppendPath("/internalNetworks", false); + uri.AppendPath("/internalNetworks/", false); + uri.AppendPath(internalNetworkName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -468,59 +472,55 @@ internal HttpMessage CreateListByL3IsolationDomainRequest(string subscriptionId, return message; } - /// Displays InternalNetworks list by resource group GET method. + /// Implements InternalNetworks DELETE method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. + /// Name of the Internal Network. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByL3IsolationDomainAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); + Argument.AssertNotNullOrEmpty(internalNetworkName, nameof(internalNetworkName)); - using var message = CreateListByL3IsolationDomainRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - InternalNetworksList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = InternalNetworksList.DeserializeInternalNetworksList(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Displays InternalNetworks list by resource group GET method. + /// Implements InternalNetworks DELETE method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. + /// Name of the Internal Network. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByL3IsolationDomain(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); + Argument.AssertNotNullOrEmpty(internalNetworkName, nameof(internalNetworkName)); - using var message = CreateListByL3IsolationDomainRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - InternalNetworksList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = InternalNetworksList.DeserializeInternalNetworksList(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -628,7 +628,7 @@ public Response UpdateAdministrativeState(string subscriptionId, string resource } } - internal RequestUriBuilder CreateUpdateBgpAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, UpdateAdministrativeStateContent content) + internal RequestUriBuilder CreateUpdateBfdAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, InternalNetworkBfdAdministrativeStateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -640,12 +640,12 @@ internal RequestUriBuilder CreateUpdateBgpAdministrativeStateRequestUri(string s uri.AppendPath(l3IsolationDomainName, true); uri.AppendPath("/internalNetworks/", false); uri.AppendPath(internalNetworkName, true); - uri.AppendPath("/updateBgpAdministrativeState", false); + uri.AppendPath("/updateBfdAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateBgpAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, UpdateAdministrativeStateContent content) + internal HttpMessage CreateUpdateBfdAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, InternalNetworkBfdAdministrativeStateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -660,7 +660,7 @@ internal HttpMessage CreateUpdateBgpAdministrativeStateRequest(string subscripti uri.AppendPath(l3IsolationDomainName, true); uri.AppendPath("/internalNetworks/", false); uri.AppendPath(internalNetworkName, true); - uri.AppendPath("/updateBgpAdministrativeState", false); + uri.AppendPath("/updateBfdAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -672,7 +672,7 @@ internal HttpMessage CreateUpdateBgpAdministrativeStateRequest(string subscripti return message; } - /// Update BGP state for internalNetwork. Allowed only on edge devices. + /// BFD administrative state for either static or bgp for internalNetwork. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. @@ -681,7 +681,7 @@ internal HttpMessage CreateUpdateBgpAdministrativeStateRequest(string subscripti /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateBgpAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public async Task UpdateBfdAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, InternalNetworkBfdAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -689,7 +689,7 @@ public async Task UpdateBgpAdministrativeStateAsync(string subscriptio Argument.AssertNotNullOrEmpty(internalNetworkName, nameof(internalNetworkName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateBgpAdministrativeStateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName, content); + using var message = CreateUpdateBfdAdministrativeStateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -701,7 +701,7 @@ public async Task UpdateBgpAdministrativeStateAsync(string subscriptio } } - /// Update BGP state for internalNetwork. Allowed only on edge devices. + /// BFD administrative state for either static or bgp for internalNetwork. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. @@ -710,7 +710,7 @@ public async Task UpdateBgpAdministrativeStateAsync(string subscriptio /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response UpdateBgpAdministrativeState(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public Response UpdateBfdAdministrativeState(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, InternalNetworkBfdAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -718,7 +718,7 @@ public Response UpdateBgpAdministrativeState(string subscriptionId, string resou Argument.AssertNotNullOrEmpty(internalNetworkName, nameof(internalNetworkName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateBgpAdministrativeStateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName, content); + using var message = CreateUpdateBfdAdministrativeStateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -730,7 +730,7 @@ public Response UpdateBgpAdministrativeState(string subscriptionId, string resou } } - internal RequestUriBuilder CreateUpdateStaticRouteBfdAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, UpdateAdministrativeStateContent content) + internal RequestUriBuilder CreateUpdateBgpAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, InternalNetworkBgpAdministrativeStateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -742,12 +742,12 @@ internal RequestUriBuilder CreateUpdateStaticRouteBfdAdministrativeStateRequestU uri.AppendPath(l3IsolationDomainName, true); uri.AppendPath("/internalNetworks/", false); uri.AppendPath(internalNetworkName, true); - uri.AppendPath("/updateStaticRouteBfdAdministrativeState", false); + uri.AppendPath("/updateBgpAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateStaticRouteBfdAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, UpdateAdministrativeStateContent content) + internal HttpMessage CreateUpdateBgpAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, InternalNetworkBgpAdministrativeStateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -762,7 +762,7 @@ internal HttpMessage CreateUpdateStaticRouteBfdAdministrativeStateRequest(string uri.AppendPath(l3IsolationDomainName, true); uri.AppendPath("/internalNetworks/", false); uri.AppendPath(internalNetworkName, true); - uri.AppendPath("/updateStaticRouteBfdAdministrativeState", false); + uri.AppendPath("/updateBgpAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -774,7 +774,7 @@ internal HttpMessage CreateUpdateStaticRouteBfdAdministrativeStateRequest(string return message; } - /// Update Static Route BFD administrative state for internalNetwork. + /// Update BGP state for internalNetwork. Allowed only on edge devices. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. @@ -783,7 +783,7 @@ internal HttpMessage CreateUpdateStaticRouteBfdAdministrativeStateRequest(string /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateStaticRouteBfdAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public async Task UpdateBgpAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, InternalNetworkBgpAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -791,7 +791,7 @@ public async Task UpdateStaticRouteBfdAdministrativeStateAsync(string Argument.AssertNotNullOrEmpty(internalNetworkName, nameof(internalNetworkName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateStaticRouteBfdAdministrativeStateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName, content); + using var message = CreateUpdateBgpAdministrativeStateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -803,7 +803,7 @@ public async Task UpdateStaticRouteBfdAdministrativeStateAsync(string } } - /// Update Static Route BFD administrative state for internalNetwork. + /// Update BGP state for internalNetwork. Allowed only on edge devices. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. @@ -812,7 +812,7 @@ public async Task UpdateStaticRouteBfdAdministrativeStateAsync(string /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response UpdateStaticRouteBfdAdministrativeState(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public Response UpdateBgpAdministrativeState(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, string internalNetworkName, InternalNetworkBgpAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -820,7 +820,7 @@ public Response UpdateStaticRouteBfdAdministrativeState(string subscriptionId, s Argument.AssertNotNullOrEmpty(internalNetworkName, nameof(internalNetworkName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateStaticRouteBfdAdministrativeStateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName, content); + using var message = CreateUpdateBgpAdministrativeStateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -862,7 +862,7 @@ internal HttpMessage CreateListByL3IsolationDomainNextPageRequest(string nextLin /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByL3IsolationDomainNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) + public async Task> ListByL3IsolationDomainNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -875,9 +875,9 @@ public async Task> ListByL3IsolationDomainNextPag { case 200: { - InternalNetworksList value = default; + InternalNetworkListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = InternalNetworksList.DeserializeInternalNetworksList(document.RootElement); + value = InternalNetworkListResult.DeserializeInternalNetworkListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -893,7 +893,7 @@ public async Task> ListByL3IsolationDomainNextPag /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListByL3IsolationDomainNextPage(string nextLink, string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) + public Response ListByL3IsolationDomainNextPage(string nextLink, string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -906,9 +906,9 @@ public Response ListByL3IsolationDomainNextPage(string nex { case 200: { - InternalNetworksList value = default; + InternalNetworkListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = InternalNetworksList.DeserializeInternalNetworksList(document.RootElement); + value = InternalNetworkListResult.DeserializeInternalNetworkListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/InternetGatewayRulesRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/InternetGatewayRulesRestOperations.cs index 5504c5ecd555..59b397d95e36 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/InternetGatewayRulesRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/InternetGatewayRulesRestOperations.cs @@ -32,11 +32,89 @@ public InternetGatewayRulesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, NetworkFabricInternetGatewayRuleData data) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all Internet Gateway rules in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + InternetGatewayRuleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = InternetGatewayRuleListResult.DeserializeInternetGatewayRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all Internet Gateway rules in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + InternetGatewayRuleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = InternetGatewayRuleListResult.DeserializeInternetGatewayRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -44,85 +122,79 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/", false); - uri.AppendPath(internetGatewayRuleName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, NetworkFabricInternetGatewayRuleData data) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/", false); - uri.AppendPath(internetGatewayRuleName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Creates an Internet Gateway rule resource. + /// Implements Internet Gateway Rules list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Internet Gateway rule. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, NetworkFabricInternetGatewayRuleData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(internetGatewayRuleName, nameof(internetGatewayRuleName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, internetGatewayRuleName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + InternetGatewayRuleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = InternetGatewayRuleListResult.DeserializeInternetGatewayRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Creates an Internet Gateway rule resource. + /// Implements Internet Gateway Rules list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Internet Gateway rule. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, NetworkFabricInternetGatewayRuleData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(internetGatewayRuleName, nameof(internetGatewayRuleName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, internetGatewayRuleName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + InternetGatewayRuleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = InternetGatewayRuleListResult.DeserializeInternetGatewayRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -224,7 +296,7 @@ public Response Get(string subscriptionId, } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, NetworkFabricInternetGatewayRulePatch patch) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, NetworkFabricInternetGatewayRuleData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -238,11 +310,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, NetworkFabricInternetGatewayRulePatch patch) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, NetworkFabricInternetGatewayRuleData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -256,67 +328,67 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; } - /// API to update certain properties of the Internet Gateway Rule resource. + /// Creates an Internet Gateway rule resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Internet Gateway rule. - /// Internet Gateway Rule properties to update. + /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, NetworkFabricInternetGatewayRulePatch patch, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, NetworkFabricInternetGatewayRuleData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(internetGatewayRuleName, nameof(internetGatewayRuleName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, internetGatewayRuleName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, internetGatewayRuleName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// API to update certain properties of the Internet Gateway Rule resource. + /// Creates an Internet Gateway rule resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Internet Gateway rule. - /// Internet Gateway Rule properties to update. + /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, NetworkFabricInternetGatewayRulePatch patch, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, NetworkFabricInternetGatewayRuleData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(internetGatewayRuleName, nameof(internetGatewayRuleName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, internetGatewayRuleName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, internetGatewayRuleName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string internetGatewayRuleName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, NetworkFabricInternetGatewayRulePatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -330,11 +402,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string internetGatewayRuleName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, NetworkFabricInternetGatewayRulePatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -346,61 +418,69 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Implements Internet Gateway Rules DELETE method. + /// API to update certain properties of the Internet Gateway Rule resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Internet Gateway rule. + /// Internet Gateway Rule properties to update. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, NetworkFabricInternetGatewayRulePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(internetGatewayRuleName, nameof(internetGatewayRuleName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, internetGatewayRuleName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, internetGatewayRuleName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements Internet Gateway Rules DELETE method. + /// API to update certain properties of the Internet Gateway Rule resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Internet Gateway rule. + /// Internet Gateway Rule properties to update. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, NetworkFabricInternetGatewayRulePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(internetGatewayRuleName, nameof(internetGatewayRuleName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, internetGatewayRuleName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, internetGatewayRuleName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string internetGatewayRuleName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -408,23 +488,25 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/", false); + uri.AppendPath(internetGatewayRuleName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string internetGatewayRuleName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/", false); + uri.AppendPath(internetGatewayRuleName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -432,82 +514,72 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str return message; } - /// Implements Internet Gateway Rules list by resource group GET method. + /// Implements Internet Gateway Rules DELETE method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Internet Gateway rule. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(internetGatewayRuleName, nameof(internetGatewayRuleName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, internetGatewayRuleName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - InternetGatewayRulesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = InternetGatewayRulesListResult.DeserializeInternetGatewayRulesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements Internet Gateway Rules list by resource group GET method. + /// Implements Internet Gateway Rules DELETE method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Internet Gateway rule. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string internetGatewayRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(internetGatewayRuleName, nameof(internetGatewayRuleName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, internetGatewayRuleName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - InternetGatewayRulesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = InternetGatewayRulesListResult.DeserializeInternetGatewayRulesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules", false); - uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendRawNextLink(nextLink, false); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules", false); - uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendRawNextLink(nextLink, false); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -515,23 +587,25 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// List all Internet Gateway rules in the given subscription. + /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - InternetGatewayRulesListResult value = default; + InternetGatewayRuleListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = InternetGatewayRulesListResult.DeserializeInternetGatewayRulesListResult(document.RootElement); + value = InternetGatewayRuleListResult.DeserializeInternetGatewayRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -540,23 +614,25 @@ public async Task> ListBySubscriptionAs } /// List all Internet Gateway rules in the given subscription. + /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - InternetGatewayRulesListResult value = default; + InternetGatewayRuleListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = InternetGatewayRulesListResult.DeserializeInternetGatewayRulesListResult(document.RootElement); + value = InternetGatewayRuleListResult.DeserializeInternetGatewayRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -593,7 +669,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -605,9 +681,9 @@ public async Task> ListByResourceGroupN { case 200: { - InternetGatewayRulesListResult value = default; + InternetGatewayRuleListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = InternetGatewayRulesListResult.DeserializeInternetGatewayRulesListResult(document.RootElement); + value = InternetGatewayRuleListResult.DeserializeInternetGatewayRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -622,7 +698,7 @@ public async Task> ListByResourceGroupN /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -634,85 +710,9 @@ public Response ListByResourceGroupNextPage(stri { case 200: { - InternetGatewayRulesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = InternetGatewayRulesListResult.DeserializeInternetGatewayRulesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all Internet Gateway rules in the given subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - InternetGatewayRulesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = InternetGatewayRulesListResult.DeserializeInternetGatewayRulesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all Internet Gateway rules in the given subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - InternetGatewayRulesListResult value = default; + InternetGatewayRuleListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = InternetGatewayRulesListResult.DeserializeInternetGatewayRulesListResult(document.RootElement); + value = InternetGatewayRuleListResult.DeserializeInternetGatewayRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/InternetGatewaysRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/InternetGatewaysRestOperations.cs index fe4e418701e2..ba2d4cf05a26 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/InternetGatewaysRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/InternetGatewaysRestOperations.cs @@ -32,25 +32,22 @@ public InternetGatewaysRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string internetGatewayName) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGateways/", false); - uri.AppendPath(internetGatewayName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGateways", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string internetGatewayName) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -59,10 +56,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGateways/", false); - uri.AppendPath(internetGatewayName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGateways", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -70,69 +64,57 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Implements Gateway GET method. + /// Displays Internet Gateways list by subscription GET method. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Name of the Internet Gateway. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string internetGatewayName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(internetGatewayName, nameof(internetGatewayName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, internetGatewayName); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkFabricInternetGatewayData value = default; + InternetGatewayListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkFabricInternetGatewayData.DeserializeNetworkFabricInternetGatewayData(document.RootElement); + value = InternetGatewayListResult.DeserializeInternetGatewayListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((NetworkFabricInternetGatewayData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Implements Gateway GET method. + /// Displays Internet Gateways list by subscription GET method. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Name of the Internet Gateway. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string internetGatewayName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(internetGatewayName, nameof(internetGatewayName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, internetGatewayName); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkFabricInternetGatewayData value = default; + InternetGatewayListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkFabricInternetGatewayData.DeserializeNetworkFabricInternetGatewayData(document.RootElement); + value = InternetGatewayListResult.DeserializeInternetGatewayListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((NetworkFabricInternetGatewayData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string internetGatewayName, NetworkFabricInternetGatewayPatch patch) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -140,91 +122,85 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGateways/", false); - uri.AppendPath(internetGatewayName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGateways", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string internetGatewayName, NetworkFabricInternetGatewayPatch patch) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGateways/", false); - uri.AppendPath(internetGatewayName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGateways", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Execute patch on Network Fabric Service Internet Gateway. + /// Displays Internet Gateways list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Internet Gateway. - /// API to update certain properties of the L2 Isolation Domain resource.. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string internetGatewayName, NetworkFabricInternetGatewayPatch patch, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(internetGatewayName, nameof(internetGatewayName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, internetGatewayName, patch); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + InternetGatewayListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = InternetGatewayListResult.DeserializeInternetGatewayListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Execute patch on Network Fabric Service Internet Gateway. + /// Displays Internet Gateways list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Internet Gateway. - /// API to update certain properties of the L2 Isolation Domain resource.. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string internetGatewayName, NetworkFabricInternetGatewayPatch patch, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(internetGatewayName, nameof(internetGatewayName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, internetGatewayName, patch); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + InternetGatewayListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = InternetGatewayListResult.DeserializeInternetGatewayListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string internetGatewayName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -232,12 +208,13 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGateways", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGateways/", false); + uri.AppendPath(internetGatewayName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string internetGatewayName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -248,7 +225,8 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGateways", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGateways/", false); + uri.AppendPath(internetGatewayName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -256,139 +234,161 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str return message; } - /// Displays Internet Gateways list by resource group GET method. + /// Implements Gateway GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Internet Gateway. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string internetGatewayName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(internetGatewayName, nameof(internetGatewayName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, internetGatewayName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - InternetGatewaysListResult value = default; + NetworkFabricInternetGatewayData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = InternetGatewaysListResult.DeserializeInternetGatewaysListResult(document.RootElement); + value = NetworkFabricInternetGatewayData.DeserializeNetworkFabricInternetGatewayData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((NetworkFabricInternetGatewayData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Displays Internet Gateways list by resource group GET method. + /// Implements Gateway GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Internet Gateway. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string internetGatewayName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(internetGatewayName, nameof(internetGatewayName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, internetGatewayName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - InternetGatewaysListResult value = default; + NetworkFabricInternetGatewayData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = InternetGatewaysListResult.DeserializeInternetGatewaysListResult(document.RootElement); + value = NetworkFabricInternetGatewayData.DeserializeNetworkFabricInternetGatewayData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((NetworkFabricInternetGatewayData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string internetGatewayName, NetworkFabricInternetGatewayPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGateways", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGateways/", false); + uri.AppendPath(internetGatewayName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string internetGatewayName, NetworkFabricInternetGatewayPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGateways", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/internetGateways/", false); + uri.AppendPath(internetGatewayName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Displays Internet Gateways list by subscription GET method. + /// Execute patch on Network Fabric Service Internet Gateway. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Internet Gateway. + /// API to update certain properties of the InternetGateway resource.. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string internetGatewayName, NetworkFabricInternetGatewayPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(internetGatewayName, nameof(internetGatewayName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, internetGatewayName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - InternetGatewaysListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = InternetGatewaysListResult.DeserializeInternetGatewaysListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Displays Internet Gateways list by subscription GET method. + /// Execute patch on Network Fabric Service Internet Gateway. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Internet Gateway. + /// API to update certain properties of the InternetGateway resource.. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string internetGatewayName, NetworkFabricInternetGatewayPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(internetGatewayName, nameof(internetGatewayName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, internetGatewayName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - InternetGatewaysListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = InternetGatewaysListResult.DeserializeInternetGatewaysListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -396,7 +396,7 @@ internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string ne return uri; } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -410,28 +410,26 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// Displays Internet Gateways list by resource group GET method. + /// Displays Internet Gateways list by subscription GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - InternetGatewaysListResult value = default; + InternetGatewayListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = InternetGatewaysListResult.DeserializeInternetGatewaysListResult(document.RootElement); + value = InternetGatewayListResult.DeserializeInternetGatewayListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -439,28 +437,26 @@ public async Task> ListByResourceGroupNextP } } - /// Displays Internet Gateways list by resource group GET method. + /// Displays Internet Gateways list by subscription GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - InternetGatewaysListResult value = default; + InternetGatewayListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = InternetGatewaysListResult.DeserializeInternetGatewaysListResult(document.RootElement); + value = InternetGatewayListResult.DeserializeInternetGatewayListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -468,7 +464,7 @@ public Response ListByResourceGroupNextPage(string n } } - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -476,7 +472,7 @@ internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nex return uri; } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -490,26 +486,28 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st return message; } - /// Displays Internet Gateways list by subscription GET method. + /// Displays Internet Gateways list by resource group GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - InternetGatewaysListResult value = default; + InternetGatewayListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = InternetGatewaysListResult.DeserializeInternetGatewaysListResult(document.RootElement); + value = InternetGatewayListResult.DeserializeInternetGatewayListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -517,26 +515,28 @@ public async Task> ListBySubscriptionNextPa } } - /// Displays Internet Gateways list by subscription GET method. + /// Displays Internet Gateways list by resource group GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - InternetGatewaysListResult value = default; + InternetGatewayListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = InternetGatewaysListResult.DeserializeInternetGatewaysListResult(document.RootElement); + value = InternetGatewayListResult.DeserializeInternetGatewayListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/IpCommunitiesRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/IpCommunitiesRestOperations.cs index c038d010eb86..b16599f19923 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/IpCommunitiesRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/IpCommunitiesRestOperations.cs @@ -32,11 +32,89 @@ public IpCommunitiesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string ipCommunityName, NetworkFabricIPCommunityData data) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipCommunities", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipCommunities", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Implements IP Communities list by subscription GET method. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IPCommunityListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = IPCommunityListResult.DeserializeIPCommunityListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Implements IP Communities list by subscription GET method. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IPCommunityListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = IPCommunityListResult.DeserializeIPCommunityListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -44,85 +122,79 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipCommunities/", false); - uri.AppendPath(ipCommunityName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipCommunities", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string ipCommunityName, NetworkFabricIPCommunityData data) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipCommunities/", false); - uri.AppendPath(ipCommunityName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipCommunities", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Implements an IP Community PUT method. + /// Implements IP Communities list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the IP Community. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string ipCommunityName, NetworkFabricIPCommunityData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(ipCommunityName, nameof(ipCommunityName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, ipCommunityName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + IPCommunityListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = IPCommunityListResult.DeserializeIPCommunityListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Implements an IP Community PUT method. + /// Implements IP Communities list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the IP Community. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string ipCommunityName, NetworkFabricIPCommunityData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(ipCommunityName, nameof(ipCommunityName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, ipCommunityName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + IPCommunityListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = IPCommunityListResult.DeserializeIPCommunityListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -224,7 +296,7 @@ public Response Get(string subscriptionId, string } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string ipCommunityName, NetworkFabricIPCommunityPatch patch) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string ipCommunityName, NetworkFabricIPCommunityData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -238,11 +310,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string ipCommunityName, NetworkFabricIPCommunityPatch patch) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string ipCommunityName, NetworkFabricIPCommunityData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -256,67 +328,67 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; } - /// API to update certain properties of the IP Community resource. + /// Implements an IP Community PUT method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the IP Community. - /// IP Community properties to update. + /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string ipCommunityName, NetworkFabricIPCommunityPatch patch, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string ipCommunityName, NetworkFabricIPCommunityData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(ipCommunityName, nameof(ipCommunityName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, ipCommunityName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, ipCommunityName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// API to update certain properties of the IP Community resource. + /// Implements an IP Community PUT method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the IP Community. - /// IP Community properties to update. + /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string ipCommunityName, NetworkFabricIPCommunityPatch patch, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string ipCommunityName, NetworkFabricIPCommunityData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(ipCommunityName, nameof(ipCommunityName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, ipCommunityName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, ipCommunityName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string ipCommunityName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string ipCommunityName, NetworkFabricIPCommunityPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -330,11 +402,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string ipCommunityName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string ipCommunityName, NetworkFabricIPCommunityPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -346,61 +418,69 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Implements IP Community DELETE method. + /// API to update certain properties of the IP Community resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the IP Community. + /// IP Community properties to update. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string ipCommunityName, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string ipCommunityName, NetworkFabricIPCommunityPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(ipCommunityName, nameof(ipCommunityName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, ipCommunityName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, ipCommunityName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements IP Community DELETE method. + /// API to update certain properties of the IP Community resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the IP Community. + /// IP Community properties to update. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string ipCommunityName, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string ipCommunityName, NetworkFabricIPCommunityPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(ipCommunityName, nameof(ipCommunityName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, ipCommunityName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, ipCommunityName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string ipCommunityName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -408,23 +488,25 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipCommunities", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipCommunities/", false); + uri.AppendPath(ipCommunityName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string ipCommunityName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipCommunities", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipCommunities/", false); + uri.AppendPath(ipCommunityName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -432,82 +514,72 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str return message; } - /// Implements IP Communities list by resource group GET method. + /// Implements IP Community DELETE method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the IP Community. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string ipCommunityName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(ipCommunityName, nameof(ipCommunityName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, ipCommunityName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - IPCommunitiesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = IPCommunitiesListResult.DeserializeIPCommunitiesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements IP Communities list by resource group GET method. + /// Implements IP Community DELETE method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the IP Community. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string ipCommunityName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(ipCommunityName, nameof(ipCommunityName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, ipCommunityName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - IPCommunitiesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = IPCommunitiesListResult.DeserializeIPCommunitiesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipCommunities", false); - uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendRawNextLink(nextLink, false); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipCommunities", false); - uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendRawNextLink(nextLink, false); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -515,23 +587,25 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// Implements IP Communities list by subscription GET method. + /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - IPCommunitiesListResult value = default; + IPCommunityListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = IPCommunitiesListResult.DeserializeIPCommunitiesListResult(document.RootElement); + value = IPCommunityListResult.DeserializeIPCommunityListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -540,23 +614,25 @@ public async Task> ListBySubscriptionAsync(str } /// Implements IP Communities list by subscription GET method. + /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - IPCommunitiesListResult value = default; + IPCommunityListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = IPCommunitiesListResult.DeserializeIPCommunitiesListResult(document.RootElement); + value = IPCommunityListResult.DeserializeIPCommunityListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -593,7 +669,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -605,9 +681,9 @@ public async Task> ListByResourceGroupNextPage { case 200: { - IPCommunitiesListResult value = default; + IPCommunityListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = IPCommunitiesListResult.DeserializeIPCommunitiesListResult(document.RootElement); + value = IPCommunityListResult.DeserializeIPCommunityListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -622,7 +698,7 @@ public async Task> ListByResourceGroupNextPage /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -634,85 +710,9 @@ public Response ListByResourceGroupNextPage(string next { case 200: { - IPCommunitiesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = IPCommunitiesListResult.DeserializeIPCommunitiesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Implements IP Communities list by subscription GET method. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IPCommunitiesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = IPCommunitiesListResult.DeserializeIPCommunitiesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Implements IP Communities list by subscription GET method. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IPCommunitiesListResult value = default; + IPCommunityListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = IPCommunitiesListResult.DeserializeIPCommunitiesListResult(document.RootElement); + value = IPCommunityListResult.DeserializeIPCommunityListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/IpExtendedCommunitiesRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/IpExtendedCommunitiesRestOperations.cs index c718dbe6e986..cc1e3b9caa84 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/IpExtendedCommunitiesRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/IpExtendedCommunitiesRestOperations.cs @@ -32,11 +32,89 @@ public IpExtendedCommunitiesRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, NetworkFabricIPExtendedCommunityData data) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Implements IpExtendedCommunities list by subscription GET method. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IPExtendedCommunityListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = IPExtendedCommunityListResult.DeserializeIPExtendedCommunityListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Implements IpExtendedCommunities list by subscription GET method. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IPExtendedCommunityListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = IPExtendedCommunityListResult.DeserializeIPExtendedCommunityListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -44,85 +122,79 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/", false); - uri.AppendPath(ipExtendedCommunityName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, NetworkFabricIPExtendedCommunityData data) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/", false); - uri.AppendPath(ipExtendedCommunityName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Implements IP Extended Community PUT method. + /// Implements IpExtendedCommunities list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the IP Extended Community. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, NetworkFabricIPExtendedCommunityData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(ipExtendedCommunityName, nameof(ipExtendedCommunityName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, ipExtendedCommunityName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + IPExtendedCommunityListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = IPExtendedCommunityListResult.DeserializeIPExtendedCommunityListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Implements IP Extended Community PUT method. + /// Implements IpExtendedCommunities list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the IP Extended Community. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, NetworkFabricIPExtendedCommunityData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(ipExtendedCommunityName, nameof(ipExtendedCommunityName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, ipExtendedCommunityName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + IPExtendedCommunityListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = IPExtendedCommunityListResult.DeserializeIPExtendedCommunityListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -224,7 +296,7 @@ public Response Get(string subscriptionId, } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, NetworkFabricIPExtendedCommunityPatch patch) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, NetworkFabricIPExtendedCommunityData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -238,11 +310,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, NetworkFabricIPExtendedCommunityPatch patch) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, NetworkFabricIPExtendedCommunityData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -256,67 +328,67 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; } - /// API to update certain properties of the IP Extended Community resource. + /// Implements IP Extended Community PUT method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the IP Extended Community. - /// IP Extended Community properties to update. + /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, NetworkFabricIPExtendedCommunityPatch patch, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, NetworkFabricIPExtendedCommunityData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(ipExtendedCommunityName, nameof(ipExtendedCommunityName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, ipExtendedCommunityName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, ipExtendedCommunityName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// API to update certain properties of the IP Extended Community resource. + /// Implements IP Extended Community PUT method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the IP Extended Community. - /// IP Extended Community properties to update. + /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, NetworkFabricIPExtendedCommunityPatch patch, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, NetworkFabricIPExtendedCommunityData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(ipExtendedCommunityName, nameof(ipExtendedCommunityName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, ipExtendedCommunityName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, ipExtendedCommunityName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, NetworkFabricIPExtendedCommunityPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -330,11 +402,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, NetworkFabricIPExtendedCommunityPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -346,61 +418,69 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Implements IP Extended Community DELETE method. + /// API to update certain properties of the IP Extended Community resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the IP Extended Community. + /// IP Extended Community properties to update. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, NetworkFabricIPExtendedCommunityPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(ipExtendedCommunityName, nameof(ipExtendedCommunityName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, ipExtendedCommunityName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, ipExtendedCommunityName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements IP Extended Community DELETE method. + /// API to update certain properties of the IP Extended Community resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the IP Extended Community. + /// IP Extended Community properties to update. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, NetworkFabricIPExtendedCommunityPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(ipExtendedCommunityName, nameof(ipExtendedCommunityName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, ipExtendedCommunityName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, ipExtendedCommunityName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -408,23 +488,25 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/", false); + uri.AppendPath(ipExtendedCommunityName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/", false); + uri.AppendPath(ipExtendedCommunityName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -432,82 +514,72 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str return message; } - /// Implements IpExtendedCommunities list by resource group GET method. + /// Implements IP Extended Community DELETE method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the IP Extended Community. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(ipExtendedCommunityName, nameof(ipExtendedCommunityName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, ipExtendedCommunityName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - IPExtendedCommunityListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = IPExtendedCommunityListResult.DeserializeIPExtendedCommunityListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements IpExtendedCommunities list by resource group GET method. + /// Implements IP Extended Community DELETE method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the IP Extended Community. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string ipExtendedCommunityName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(ipExtendedCommunityName, nameof(ipExtendedCommunityName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, ipExtendedCommunityName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - IPExtendedCommunityListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = IPExtendedCommunityListResult.DeserializeIPExtendedCommunityListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities", false); - uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendRawNextLink(nextLink, false); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities", false); - uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendRawNextLink(nextLink, false); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -515,15 +587,17 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// Implements IpExtendedCommunities list by subscription GET method. + /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -540,15 +614,17 @@ public async Task> ListBySubscriptionAsy } /// Implements IpExtendedCommunities list by subscription GET method. + /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -643,81 +719,5 @@ public Response ListByResourceGroupNextPage(strin throw new RequestFailedException(message.Response); } } - - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Implements IpExtendedCommunities list by subscription GET method. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IPExtendedCommunityListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = IPExtendedCommunityListResult.DeserializeIPExtendedCommunityListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Implements IpExtendedCommunities list by subscription GET method. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IPExtendedCommunityListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = IPExtendedCommunityListResult.DeserializeIPExtendedCommunityListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/IpPrefixesRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/IpPrefixesRestOperations.cs index f175c491c492..f2c214672a79 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/IpPrefixesRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/IpPrefixesRestOperations.cs @@ -32,11 +32,89 @@ public IpPrefixesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string ipPrefixName, NetworkFabricIPPrefixData data) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipPrefixes", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipPrefixes", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Implements IpPrefixes list by subscription GET method. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IPPrefixListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = IPPrefixListResult.DeserializeIPPrefixListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Implements IpPrefixes list by subscription GET method. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IPPrefixListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = IPPrefixListResult.DeserializeIPPrefixListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -44,85 +122,79 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/", false); - uri.AppendPath(ipPrefixName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipPrefixes", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string ipPrefixName, NetworkFabricIPPrefixData data) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/", false); - uri.AppendPath(ipPrefixName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipPrefixes", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Implements IP Prefix PUT method. + /// Implements IpPrefixes list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the IP Prefix. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string ipPrefixName, NetworkFabricIPPrefixData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(ipPrefixName, nameof(ipPrefixName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, ipPrefixName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + IPPrefixListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = IPPrefixListResult.DeserializeIPPrefixListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Implements IP Prefix PUT method. + /// Implements IpPrefixes list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the IP Prefix. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string ipPrefixName, NetworkFabricIPPrefixData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(ipPrefixName, nameof(ipPrefixName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, ipPrefixName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + IPPrefixListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = IPPrefixListResult.DeserializeIPPrefixListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -224,7 +296,7 @@ public Response Get(string subscriptionId, string res } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string ipPrefixName, NetworkFabricIPPrefixPatch patch) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string ipPrefixName, NetworkFabricIPPrefixData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -238,11 +310,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string ipPrefixName, NetworkFabricIPPrefixPatch patch) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string ipPrefixName, NetworkFabricIPPrefixData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -256,67 +328,67 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; } - /// API to update certain properties of the IP Prefix resource. + /// Implements IP Prefix PUT method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the IP Prefix. - /// IP Prefix properties to update. + /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string ipPrefixName, NetworkFabricIPPrefixPatch patch, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string ipPrefixName, NetworkFabricIPPrefixData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(ipPrefixName, nameof(ipPrefixName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, ipPrefixName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, ipPrefixName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// API to update certain properties of the IP Prefix resource. + /// Implements IP Prefix PUT method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the IP Prefix. - /// IP Prefix properties to update. + /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string ipPrefixName, NetworkFabricIPPrefixPatch patch, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string ipPrefixName, NetworkFabricIPPrefixData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(ipPrefixName, nameof(ipPrefixName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, ipPrefixName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, ipPrefixName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string ipPrefixName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string ipPrefixName, NetworkFabricIPPrefixPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -330,11 +402,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string ipPrefixName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string ipPrefixName, NetworkFabricIPPrefixPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -346,61 +418,69 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Implements IP Prefix DELETE method. + /// API to update certain properties of the IP Prefix resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the IP Prefix. + /// IP Prefix properties to update. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string ipPrefixName, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string ipPrefixName, NetworkFabricIPPrefixPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(ipPrefixName, nameof(ipPrefixName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, ipPrefixName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, ipPrefixName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements IP Prefix DELETE method. + /// API to update certain properties of the IP Prefix resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the IP Prefix. + /// IP Prefix properties to update. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string ipPrefixName, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string ipPrefixName, NetworkFabricIPPrefixPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(ipPrefixName, nameof(ipPrefixName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, ipPrefixName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, ipPrefixName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string ipPrefixName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -408,23 +488,25 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipPrefixes", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/", false); + uri.AppendPath(ipPrefixName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string ipPrefixName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipPrefixes", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/", false); + uri.AppendPath(ipPrefixName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -432,82 +514,72 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str return message; } - /// Implements IpPrefixes list by resource group GET method. + /// Implements IP Prefix DELETE method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the IP Prefix. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string ipPrefixName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(ipPrefixName, nameof(ipPrefixName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, ipPrefixName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - IPPrefixesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = IPPrefixesListResult.DeserializeIPPrefixesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements IpPrefixes list by resource group GET method. + /// Implements IP Prefix DELETE method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the IP Prefix. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string ipPrefixName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(ipPrefixName, nameof(ipPrefixName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, ipPrefixName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - IPPrefixesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = IPPrefixesListResult.DeserializeIPPrefixesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipPrefixes", false); - uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendRawNextLink(nextLink, false); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/ipPrefixes", false); - uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendRawNextLink(nextLink, false); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -515,23 +587,25 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// Implements IpPrefixes list by subscription GET method. + /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - IPPrefixesListResult value = default; + IPPrefixListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = IPPrefixesListResult.DeserializeIPPrefixesListResult(document.RootElement); + value = IPPrefixListResult.DeserializeIPPrefixListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -540,23 +614,25 @@ public async Task> ListBySubscriptionAsync(string } /// Implements IpPrefixes list by subscription GET method. + /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - IPPrefixesListResult value = default; + IPPrefixListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = IPPrefixesListResult.DeserializeIPPrefixesListResult(document.RootElement); + value = IPPrefixListResult.DeserializeIPPrefixListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -593,7 +669,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -605,9 +681,9 @@ public async Task> ListByResourceGroupNextPageAsy { case 200: { - IPPrefixesListResult value = default; + IPPrefixListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = IPPrefixesListResult.DeserializeIPPrefixesListResult(document.RootElement); + value = IPPrefixListResult.DeserializeIPPrefixListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -622,7 +698,7 @@ public async Task> ListByResourceGroupNextPageAsy /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -634,85 +710,9 @@ public Response ListByResourceGroupNextPage(string nextLin { case 200: { - IPPrefixesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = IPPrefixesListResult.DeserializeIPPrefixesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Implements IpPrefixes list by subscription GET method. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IPPrefixesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = IPPrefixesListResult.DeserializeIPPrefixesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Implements IpPrefixes list by subscription GET method. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IPPrefixesListResult value = default; + IPPrefixListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = IPPrefixesListResult.DeserializeIPPrefixesListResult(document.RootElement); + value = IPPrefixListResult.DeserializeIPPrefixListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/L2IsolationDomainsRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/L2IsolationDomainsRestOperations.cs index e7697d274393..0bd032310543 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/L2IsolationDomainsRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/L2IsolationDomainsRestOperations.cs @@ -32,103 +32,89 @@ public L2IsolationDomainsRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, NetworkFabricL2IsolationDomainData data) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/", false); - uri.AppendPath(l2IsolationDomainName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, NetworkFabricL2IsolationDomainData data) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/", false); - uri.AppendPath(l2IsolationDomainName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Creates layer 2 network connectivity between compute nodes within a rack and across racks.The configuration is applied on the devices only after the isolation domain is enabled. + /// Displays L2IsolationDomains list by subscription GET method. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Name of the L2 Isolation Domain. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, NetworkFabricL2IsolationDomainData data, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(l2IsolationDomainName, nameof(l2IsolationDomainName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, l2IsolationDomainName, data); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + L2IsolationDomainListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = L2IsolationDomainListResult.DeserializeL2IsolationDomainListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Creates layer 2 network connectivity between compute nodes within a rack and across racks.The configuration is applied on the devices only after the isolation domain is enabled. + /// Displays L2IsolationDomains list by subscription GET method. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Name of the L2 Isolation Domain. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, NetworkFabricL2IsolationDomainData data, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(l2IsolationDomainName, nameof(l2IsolationDomainName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, l2IsolationDomainName, data); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + L2IsolationDomainListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = L2IsolationDomainListResult.DeserializeL2IsolationDomainListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string l2IsolationDomainName) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -136,13 +122,12 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/", false); - uri.AppendPath(l2IsolationDomainName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string l2IsolationDomainName) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -153,8 +138,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/", false); - uri.AppendPath(l2IsolationDomainName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -162,69 +146,61 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Implements L2 Isolation Domain GET method. + /// Displays L2IsolationDomains list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the L2 Isolation Domain. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(l2IsolationDomainName, nameof(l2IsolationDomainName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, l2IsolationDomainName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkFabricL2IsolationDomainData value = default; + L2IsolationDomainListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkFabricL2IsolationDomainData.DeserializeNetworkFabricL2IsolationDomainData(document.RootElement); + value = L2IsolationDomainListResult.DeserializeL2IsolationDomainListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((NetworkFabricL2IsolationDomainData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Implements L2 Isolation Domain GET method. + /// Displays L2IsolationDomains list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the L2 Isolation Domain. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(l2IsolationDomainName, nameof(l2IsolationDomainName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, l2IsolationDomainName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkFabricL2IsolationDomainData value = default; + L2IsolationDomainListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkFabricL2IsolationDomainData.DeserializeNetworkFabricL2IsolationDomainData(document.RootElement); + value = L2IsolationDomainListResult.DeserializeL2IsolationDomainListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((NetworkFabricL2IsolationDomainData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, NetworkFabricL2IsolationDomainPatch patch) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string l2IsolationDomainName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -238,11 +214,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, NetworkFabricL2IsolationDomainPatch patch) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string l2IsolationDomainName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -254,69 +230,73 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// API to update certain properties of the L2 Isolation Domain resource. + /// Implements L2 Isolation Domain GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L2 Isolation Domain. - /// API to update certain properties of the L2 Isolation Domain resource.. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, NetworkFabricL2IsolationDomainPatch patch, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l2IsolationDomainName, nameof(l2IsolationDomainName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, l2IsolationDomainName, patch); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, l2IsolationDomainName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + NetworkFabricL2IsolationDomainData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkFabricL2IsolationDomainData.DeserializeNetworkFabricL2IsolationDomainData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkFabricL2IsolationDomainData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// API to update certain properties of the L2 Isolation Domain resource. + /// Implements L2 Isolation Domain GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L2 Isolation Domain. - /// API to update certain properties of the L2 Isolation Domain resource.. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, NetworkFabricL2IsolationDomainPatch patch, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l2IsolationDomainName, nameof(l2IsolationDomainName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, l2IsolationDomainName, patch); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, l2IsolationDomainName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + NetworkFabricL2IsolationDomainData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkFabricL2IsolationDomainData.DeserializeNetworkFabricL2IsolationDomainData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkFabricL2IsolationDomainData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string l2IsolationDomainName) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, NetworkFabricL2IsolationDomainData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -330,11 +310,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string l2IsolationDomainName) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, NetworkFabricL2IsolationDomainData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -346,61 +326,69 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + /// Creates layer 2 network connectivity between compute nodes within a rack and across racks.The configuration is applied on the devices only after the isolation domain is enabled. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L2 Isolation Domain. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, NetworkFabricL2IsolationDomainData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l2IsolationDomainName, nameof(l2IsolationDomainName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, l2IsolationDomainName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, l2IsolationDomainName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 202: - case 204: + case 200: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + /// Creates layer 2 network connectivity between compute nodes within a rack and across racks.The configuration is applied on the devices only after the isolation domain is enabled. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L2 Isolation Domain. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, NetworkFabricL2IsolationDomainData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l2IsolationDomainName, nameof(l2IsolationDomainName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, l2IsolationDomainName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, l2IsolationDomainName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 202: - case 204: + case 200: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, UpdateAdministrativeStateContent content) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, NetworkFabricL2IsolationDomainPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -410,16 +398,15 @@ internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subs uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/", false); uri.AppendPath(l2IsolationDomainName, true); - uri.AppendPath("/updateAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, UpdateAdministrativeStateContent content) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, NetworkFabricL2IsolationDomainPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -428,34 +415,33 @@ internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionI uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/", false); uri.AppendPath(l2IsolationDomainName, true); - uri.AppendPath("/updateAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Enables isolation domain across the fabric or on specified racks. + /// API to update certain properties of the L2 Isolation Domain resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L2 Isolation Domain. - /// Request payload. + /// API to update certain properties of the L2 Isolation Domain resource.. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, NetworkFabricL2IsolationDomainPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l2IsolationDomainName, nameof(l2IsolationDomainName)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, l2IsolationDomainName, content); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, l2IsolationDomainName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -467,22 +453,22 @@ public async Task UpdateAdministrativeStateAsync(string subscriptionId } } - /// Enables isolation domain across the fabric or on specified racks. + /// API to update certain properties of the L2 Isolation Domain resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L2 Isolation Domain. - /// Request payload. + /// API to update certain properties of the L2 Isolation Domain resource.. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response UpdateAdministrativeState(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, NetworkFabricL2IsolationDomainPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l2IsolationDomainName, nameof(l2IsolationDomainName)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, l2IsolationDomainName, content); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, l2IsolationDomainName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -494,7 +480,7 @@ public Response UpdateAdministrativeState(string subscriptionId, string resource } } - internal RequestUriBuilder CreateValidateConfigurationRequestUri(string subscriptionId, string resourceGroupName, string l2IsolationDomainName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string l2IsolationDomainName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -504,16 +490,15 @@ internal RequestUriBuilder CreateValidateConfigurationRequestUri(string subscrip uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/", false); uri.AppendPath(l2IsolationDomainName, true); - uri.AppendPath("/validateConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateValidateConfigurationRequest(string subscriptionId, string resourceGroupName, string l2IsolationDomainName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string l2IsolationDomainName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -522,7 +507,6 @@ internal HttpMessage CreateValidateConfigurationRequest(string subscriptionId, s uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/", false); uri.AppendPath(l2IsolationDomainName, true); - uri.AppendPath("/validateConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -530,50 +514,50 @@ internal HttpMessage CreateValidateConfigurationRequest(string subscriptionId, s return message; } - /// Validates the configuration of the resources. + /// Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L2 Isolation Domain. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task ValidateConfigurationAsync(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l2IsolationDomainName, nameof(l2IsolationDomainName)); - using var message = CreateValidateConfigurationRequest(subscriptionId, resourceGroupName, l2IsolationDomainName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, l2IsolationDomainName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Validates the configuration of the resources. + /// Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L2 Isolation Domain. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ValidateConfiguration(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l2IsolationDomainName, nameof(l2IsolationDomainName)); - using var message = CreateValidateConfigurationRequest(subscriptionId, resourceGroupName, l2IsolationDomainName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, l2IsolationDomainName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); @@ -666,7 +650,7 @@ public Response CommitConfiguration(string subscriptionId, string resourceGroupN } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, UpdateAdministrativeStateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -674,105 +658,121 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/", false); + uri.AppendPath(l2IsolationDomainName, true); + uri.AppendPath("/updateAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, UpdateAdministrativeStateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/", false); + uri.AppendPath(l2IsolationDomainName, true); + uri.AppendPath("/updateAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Displays L2IsolationDomains list by resource group GET method. + /// Enables isolation domain across the fabric or on specified racks. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the L2 Isolation Domain. + /// Request payload. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(l2IsolationDomainName, nameof(l2IsolationDomainName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, l2IsolationDomainName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - L2IsolationDomainsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = L2IsolationDomainsListResult.DeserializeL2IsolationDomainsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Displays L2IsolationDomains list by resource group GET method. + /// Enables isolation domain across the fabric or on specified racks. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the L2 Isolation Domain. + /// Request payload. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response UpdateAdministrativeState(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(l2IsolationDomainName, nameof(l2IsolationDomainName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, l2IsolationDomainName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - L2IsolationDomainsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = L2IsolationDomainsListResult.DeserializeL2IsolationDomainsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateValidateConfigurationRequestUri(string subscriptionId, string resourceGroupName, string l2IsolationDomainName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/", false); + uri.AppendPath(l2IsolationDomainName, true); + uri.AppendPath("/validateConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateValidateConfigurationRequest(string subscriptionId, string resourceGroupName, string l2IsolationDomainName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/", false); + uri.AppendPath(l2IsolationDomainName, true); + uri.AppendPath("/validateConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -780,57 +780,57 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) return message; } - /// Displays L2IsolationDomains list by subscription GET method. + /// Validates the configuration of the resources. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the L2 Isolation Domain. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task ValidateConfigurationAsync(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(l2IsolationDomainName, nameof(l2IsolationDomainName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateValidateConfigurationRequest(subscriptionId, resourceGroupName, l2IsolationDomainName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - L2IsolationDomainsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = L2IsolationDomainsListResult.DeserializeL2IsolationDomainsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Displays L2IsolationDomains list by subscription GET method. + /// Validates the configuration of the resources. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the L2 Isolation Domain. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ValidateConfiguration(string subscriptionId, string resourceGroupName, string l2IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(l2IsolationDomainName, nameof(l2IsolationDomainName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateValidateConfigurationRequest(subscriptionId, resourceGroupName, l2IsolationDomainName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - L2IsolationDomainsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = L2IsolationDomainsListResult.DeserializeL2IsolationDomainsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -838,7 +838,7 @@ internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string ne return uri; } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -852,28 +852,26 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// Displays L2IsolationDomains list by resource group GET method. + /// Displays L2IsolationDomains list by subscription GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - L2IsolationDomainsListResult value = default; + L2IsolationDomainListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = L2IsolationDomainsListResult.DeserializeL2IsolationDomainsListResult(document.RootElement); + value = L2IsolationDomainListResult.DeserializeL2IsolationDomainListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -881,28 +879,26 @@ public async Task> ListByResourceGroupNex } } - /// Displays L2IsolationDomains list by resource group GET method. + /// Displays L2IsolationDomains list by subscription GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - L2IsolationDomainsListResult value = default; + L2IsolationDomainListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = L2IsolationDomainsListResult.DeserializeL2IsolationDomainsListResult(document.RootElement); + value = L2IsolationDomainListResult.DeserializeL2IsolationDomainListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -910,7 +906,7 @@ public Response ListByResourceGroupNextPage(string } } - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -918,7 +914,7 @@ internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nex return uri; } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -932,26 +928,28 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st return message; } - /// Displays L2IsolationDomains list by subscription GET method. + /// Displays L2IsolationDomains list by resource group GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - L2IsolationDomainsListResult value = default; + L2IsolationDomainListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = L2IsolationDomainsListResult.DeserializeL2IsolationDomainsListResult(document.RootElement); + value = L2IsolationDomainListResult.DeserializeL2IsolationDomainListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -959,26 +957,28 @@ public async Task> ListBySubscriptionNext } } - /// Displays L2IsolationDomains list by subscription GET method. + /// Displays L2IsolationDomains list by resource group GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - L2IsolationDomainsListResult value = default; + L2IsolationDomainListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = L2IsolationDomainsListResult.DeserializeL2IsolationDomainsListResult(document.RootElement); + value = L2IsolationDomainListResult.DeserializeL2IsolationDomainListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/L3IsolationDomainsRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/L3IsolationDomainsRestOperations.cs index f5ce49588c06..cbe2a9740943 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/L3IsolationDomainsRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/L3IsolationDomainsRestOperations.cs @@ -32,103 +32,89 @@ public L3IsolationDomainsRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, NetworkFabricL3IsolationDomainData data) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); - uri.AppendPath(l3IsolationDomainName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, NetworkFabricL3IsolationDomainData data) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); - uri.AppendPath(l3IsolationDomainName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with external services .This configuration is applied on the devices only after the creation of networks is completed and isolation domain is enabled. + /// Displays L3IsolationDomains list by subscription GET method. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Name of the L3 Isolation Domain. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, NetworkFabricL3IsolationDomainData data, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, data); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + L3IsolationDomainListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = L3IsolationDomainListResult.DeserializeL3IsolationDomainListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with external services .This configuration is applied on the devices only after the creation of networks is completed and isolation domain is enabled. + /// Displays L3IsolationDomains list by subscription GET method. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Name of the L3 Isolation Domain. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, NetworkFabricL3IsolationDomainData data, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, data); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + L3IsolationDomainListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = L3IsolationDomainListResult.DeserializeL3IsolationDomainListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -136,13 +122,12 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); - uri.AppendPath(l3IsolationDomainName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -153,8 +138,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); - uri.AppendPath(l3IsolationDomainName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -162,69 +146,61 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Retrieves details of this L3 Isolation Domain. + /// Displays L3IsolationDomains list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the L3 Isolation Domain. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkFabricL3IsolationDomainData value = default; + L3IsolationDomainListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkFabricL3IsolationDomainData.DeserializeNetworkFabricL3IsolationDomainData(document.RootElement); + value = L3IsolationDomainListResult.DeserializeL3IsolationDomainListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((NetworkFabricL3IsolationDomainData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Retrieves details of this L3 Isolation Domain. + /// Displays L3IsolationDomains list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the L3 Isolation Domain. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkFabricL3IsolationDomainData value = default; + L3IsolationDomainListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkFabricL3IsolationDomainData.DeserializeNetworkFabricL3IsolationDomainData(document.RootElement); + value = L3IsolationDomainListResult.DeserializeL3IsolationDomainListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((NetworkFabricL3IsolationDomainData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, NetworkFabricL3IsolationDomainPatch patch) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -238,11 +214,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, NetworkFabricL3IsolationDomainPatch patch) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -254,69 +230,73 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// API to update certain properties of the L3 Isolation Domain resource. + /// Retrieves details of this L3 Isolation Domain. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. - /// API to update certain properties of the L3 Isolation Domain resource. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, NetworkFabricL3IsolationDomainPatch patch, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, patch); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + NetworkFabricL3IsolationDomainData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkFabricL3IsolationDomainData.DeserializeNetworkFabricL3IsolationDomainData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkFabricL3IsolationDomainData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// API to update certain properties of the L3 Isolation Domain resource. + /// Retrieves details of this L3 Isolation Domain. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. - /// API to update certain properties of the L3 Isolation Domain resource. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, NetworkFabricL3IsolationDomainPatch patch, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, patch); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + NetworkFabricL3IsolationDomainData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkFabricL3IsolationDomainData.DeserializeNetworkFabricL3IsolationDomainData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkFabricL3IsolationDomainData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, NetworkFabricL3IsolationDomainData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -330,11 +310,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, NetworkFabricL3IsolationDomainData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -346,61 +326,69 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + /// Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with external services .This configuration is applied on the devices only after the creation of networks is completed and isolation domain is enabled. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, NetworkFabricL3IsolationDomainData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 202: - case 204: + case 200: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + /// Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with external services .This configuration is applied on the devices only after the creation of networks is completed and isolation domain is enabled. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, NetworkFabricL3IsolationDomainData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 202: - case 204: + case 200: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, NetworkFabricL3IsolationDomainPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -408,105 +396,117 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); + uri.AppendPath(l3IsolationDomainName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, NetworkFabricL3IsolationDomainPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); + uri.AppendPath(l3IsolationDomainName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Displays L3IsolationDomains list by resource group GET method. + /// API to update certain properties of the L3 Isolation Domain resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the L3 Isolation Domain. + /// API to update certain properties of the L3 Isolation Domain resource. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, NetworkFabricL3IsolationDomainPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - L3IsolationDomainsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = L3IsolationDomainsListResult.DeserializeL3IsolationDomainsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Displays L3IsolationDomains list by resource group GET method. + /// API to update certain properties of the L3 Isolation Domain resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the L3 Isolation Domain. + /// API to update certain properties of the L3 Isolation Domain resource. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, NetworkFabricL3IsolationDomainPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - L3IsolationDomainsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = L3IsolationDomainsListResult.DeserializeL3IsolationDomainsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); + uri.AppendPath(l3IsolationDomainName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); + uri.AppendPath(l3IsolationDomainName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -514,57 +514,57 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) return message; } - /// Displays L3IsolationDomains list by subscription GET method. + /// Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the L3 Isolation Domain. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - L3IsolationDomainsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = L3IsolationDomainsListResult.DeserializeL3IsolationDomainsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Displays L3IsolationDomains list by subscription GET method. + /// Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the L3 Isolation Domain. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - L3IsolationDomainsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = L3IsolationDomainsListResult.DeserializeL3IsolationDomainsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, UpdateAdministrativeStateContent content) + internal RequestUriBuilder CreateCommitConfigurationRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -574,12 +574,12 @@ internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subs uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); uri.AppendPath(l3IsolationDomainName, true); - uri.AppendPath("/updateAdministrativeState", false); + uri.AppendPath("/commitConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, UpdateAdministrativeStateContent content) + internal HttpMessage CreateCommitConfigurationRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -592,34 +592,28 @@ internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionI uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); uri.AppendPath(l3IsolationDomainName, true); - uri.AppendPath("/updateAdministrativeState", false); + uri.AppendPath("/commitConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; _userAgent.Apply(message); return message; } - /// Enables racks for this Isolation Domain. + /// Commits the configuration of the given resources. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. - /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public async Task CommitConfigurationAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, content); + using var message = CreateCommitConfigurationRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -631,22 +625,20 @@ public async Task UpdateAdministrativeStateAsync(string subscriptionId } } - /// Enables racks for this Isolation Domain. + /// Commits the configuration of the given resources. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. - /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response UpdateAdministrativeState(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public Response CommitConfiguration(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, content); + using var message = CreateCommitConfigurationRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -658,7 +650,7 @@ public Response UpdateAdministrativeState(string subscriptionId, string resource } } - internal RequestUriBuilder CreateValidateConfigurationRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) + internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, UpdateAdministrativeStateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -668,12 +660,12 @@ internal RequestUriBuilder CreateValidateConfigurationRequestUri(string subscrip uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); uri.AppendPath(l3IsolationDomainName, true); - uri.AppendPath("/validateConfiguration", false); + uri.AppendPath("/updateAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateValidateConfigurationRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) + internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, UpdateAdministrativeStateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -686,28 +678,34 @@ internal HttpMessage CreateValidateConfigurationRequest(string subscriptionId, s uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); uri.AppendPath(l3IsolationDomainName, true); - uri.AppendPath("/validateConfiguration", false); + uri.AppendPath("/updateAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Validates the configuration of the resources. + /// Enables racks for this Isolation Domain. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task ValidateConfigurationAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) + public async Task UpdateAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateValidateConfigurationRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); + using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -719,20 +717,22 @@ public async Task ValidateConfigurationAsync(string subscriptionId, st } } - /// Validates the configuration of the resources. + /// Enables racks for this Isolation Domain. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ValidateConfiguration(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) + public Response UpdateAdministrativeState(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateValidateConfigurationRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); + using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, l3IsolationDomainName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -744,7 +744,7 @@ public Response ValidateConfiguration(string subscriptionId, string resourceGrou } } - internal RequestUriBuilder CreateCommitConfigurationRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) + internal RequestUriBuilder CreateValidateConfigurationRequestUri(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -754,12 +754,12 @@ internal RequestUriBuilder CreateCommitConfigurationRequestUri(string subscripti uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); uri.AppendPath(l3IsolationDomainName, true); - uri.AppendPath("/commitConfiguration", false); + uri.AppendPath("/validateConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCommitConfigurationRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) + internal HttpMessage CreateValidateConfigurationRequest(string subscriptionId, string resourceGroupName, string l3IsolationDomainName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -772,7 +772,7 @@ internal HttpMessage CreateCommitConfigurationRequest(string subscriptionId, str uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/", false); uri.AppendPath(l3IsolationDomainName, true); - uri.AppendPath("/commitConfiguration", false); + uri.AppendPath("/validateConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -780,20 +780,20 @@ internal HttpMessage CreateCommitConfigurationRequest(string subscriptionId, str return message; } - /// Commits the configuration of the given resources. + /// Validates the configuration of the resources. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task CommitConfigurationAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) + public async Task ValidateConfigurationAsync(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); - using var message = CreateCommitConfigurationRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); + using var message = CreateValidateConfigurationRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -805,20 +805,20 @@ public async Task CommitConfigurationAsync(string subscriptionId, stri } } - /// Commits the configuration of the given resources. + /// Validates the configuration of the resources. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the L3 Isolation Domain. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response CommitConfiguration(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) + public Response ValidateConfiguration(string subscriptionId, string resourceGroupName, string l3IsolationDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(l3IsolationDomainName, nameof(l3IsolationDomainName)); - using var message = CreateCommitConfigurationRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); + using var message = CreateValidateConfigurationRequest(subscriptionId, resourceGroupName, l3IsolationDomainName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -830,7 +830,7 @@ public Response CommitConfiguration(string subscriptionId, string resourceGroupN } } - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -838,7 +838,7 @@ internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string ne return uri; } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -852,28 +852,26 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// Displays L3IsolationDomains list by resource group GET method. + /// Displays L3IsolationDomains list by subscription GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - L3IsolationDomainsListResult value = default; + L3IsolationDomainListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = L3IsolationDomainsListResult.DeserializeL3IsolationDomainsListResult(document.RootElement); + value = L3IsolationDomainListResult.DeserializeL3IsolationDomainListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -881,28 +879,26 @@ public async Task> ListByResourceGroupNex } } - /// Displays L3IsolationDomains list by resource group GET method. + /// Displays L3IsolationDomains list by subscription GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - L3IsolationDomainsListResult value = default; + L3IsolationDomainListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = L3IsolationDomainsListResult.DeserializeL3IsolationDomainsListResult(document.RootElement); + value = L3IsolationDomainListResult.DeserializeL3IsolationDomainListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -910,7 +906,7 @@ public Response ListByResourceGroupNextPage(string } } - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -918,7 +914,7 @@ internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nex return uri; } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -932,26 +928,28 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st return message; } - /// Displays L3IsolationDomains list by subscription GET method. + /// Displays L3IsolationDomains list by resource group GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - L3IsolationDomainsListResult value = default; + L3IsolationDomainListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = L3IsolationDomainsListResult.DeserializeL3IsolationDomainsListResult(document.RootElement); + value = L3IsolationDomainListResult.DeserializeL3IsolationDomainListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -959,26 +957,28 @@ public async Task> ListBySubscriptionNext } } - /// Displays L3IsolationDomains list by subscription GET method. + /// Displays L3IsolationDomains list by resource group GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - L3IsolationDomainsListResult value = default; + L3IsolationDomainListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = L3IsolationDomainsListResult.DeserializeL3IsolationDomainsListResult(document.RootElement); + value = L3IsolationDomainListResult.DeserializeL3IsolationDomainListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NeighborGroupsRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NeighborGroupsRestOperations.cs index 9df79515643e..fb211b37e1c3 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NeighborGroupsRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NeighborGroupsRestOperations.cs @@ -32,11 +32,89 @@ public NeighborGroupsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string neighborGroupName, NetworkFabricNeighborGroupData data) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/neighborGroups", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/neighborGroups", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Displays NeighborGroups list by subscription GET method. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NeighborGroupListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NeighborGroupListResult.DeserializeNeighborGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Displays NeighborGroups list by subscription GET method. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NeighborGroupListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NeighborGroupListResult.DeserializeNeighborGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -44,85 +122,79 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/neighborGroups/", false); - uri.AppendPath(neighborGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/neighborGroups", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string neighborGroupName, NetworkFabricNeighborGroupData data) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/neighborGroups/", false); - uri.AppendPath(neighborGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/neighborGroups", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Implements the Neighbor Group PUT method. + /// Displays NeighborGroups list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Neighbor Group. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string neighborGroupName, NetworkFabricNeighborGroupData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(neighborGroupName, nameof(neighborGroupName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, neighborGroupName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NeighborGroupListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NeighborGroupListResult.DeserializeNeighborGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Implements the Neighbor Group PUT method. + /// Displays NeighborGroups list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Neighbor Group. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string neighborGroupName, NetworkFabricNeighborGroupData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(neighborGroupName, nameof(neighborGroupName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, neighborGroupName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NeighborGroupListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NeighborGroupListResult.DeserializeNeighborGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -224,7 +296,7 @@ public Response Get(string subscriptionId, strin } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string neighborGroupName, NetworkFabricNeighborGroupPatch patch) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string neighborGroupName, NetworkFabricNeighborGroupData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -238,11 +310,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string neighborGroupName, NetworkFabricNeighborGroupPatch patch) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string neighborGroupName, NetworkFabricNeighborGroupData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -256,67 +328,67 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; } - /// Updates the Neighbor Group. + /// Implements the Neighbor Group PUT method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Neighbor Group. - /// Neighbor Group properties to update. Only annotations are supported. + /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string neighborGroupName, NetworkFabricNeighborGroupPatch patch, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string neighborGroupName, NetworkFabricNeighborGroupData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(neighborGroupName, nameof(neighborGroupName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, neighborGroupName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, neighborGroupName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Updates the Neighbor Group. + /// Implements the Neighbor Group PUT method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Neighbor Group. - /// Neighbor Group properties to update. Only annotations are supported. + /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string neighborGroupName, NetworkFabricNeighborGroupPatch patch, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string neighborGroupName, NetworkFabricNeighborGroupData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(neighborGroupName, nameof(neighborGroupName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, neighborGroupName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, neighborGroupName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string neighborGroupName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string neighborGroupName, NetworkFabricNeighborGroupPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -330,11 +402,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string neighborGroupName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string neighborGroupName, NetworkFabricNeighborGroupPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -346,61 +418,69 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Implements Neighbor Group DELETE method. + /// Updates the Neighbor Group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Neighbor Group. + /// Neighbor Group properties to update. Only annotations are supported. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string neighborGroupName, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string neighborGroupName, NetworkFabricNeighborGroupPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(neighborGroupName, nameof(neighborGroupName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, neighborGroupName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, neighborGroupName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements Neighbor Group DELETE method. + /// Updates the Neighbor Group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Neighbor Group. + /// Neighbor Group properties to update. Only annotations are supported. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string neighborGroupName, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string neighborGroupName, NetworkFabricNeighborGroupPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(neighborGroupName, nameof(neighborGroupName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, neighborGroupName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, neighborGroupName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string neighborGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -408,23 +488,25 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/neighborGroups", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/neighborGroups/", false); + uri.AppendPath(neighborGroupName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string neighborGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/neighborGroups", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/neighborGroups/", false); + uri.AppendPath(neighborGroupName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -432,82 +514,72 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str return message; } - /// Displays NeighborGroups list by resource group GET method. + /// Implements Neighbor Group DELETE method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Neighbor Group. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string neighborGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(neighborGroupName, nameof(neighborGroupName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, neighborGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - NeighborGroupsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NeighborGroupsListResult.DeserializeNeighborGroupsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Displays NeighborGroups list by resource group GET method. + /// Implements Neighbor Group DELETE method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Neighbor Group. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string neighborGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(neighborGroupName, nameof(neighborGroupName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, neighborGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - NeighborGroupsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NeighborGroupsListResult.DeserializeNeighborGroupsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/neighborGroups", false); - uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendRawNextLink(nextLink, false); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/neighborGroups", false); - uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendRawNextLink(nextLink, false); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -515,23 +587,25 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// Displays NeighborGroups list by subscription GET method. + /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NeighborGroupsListResult value = default; + NeighborGroupListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NeighborGroupsListResult.DeserializeNeighborGroupsListResult(document.RootElement); + value = NeighborGroupListResult.DeserializeNeighborGroupListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -540,23 +614,25 @@ public async Task> ListBySubscriptionAsync(st } /// Displays NeighborGroups list by subscription GET method. + /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NeighborGroupsListResult value = default; + NeighborGroupListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NeighborGroupsListResult.DeserializeNeighborGroupsListResult(document.RootElement); + value = NeighborGroupListResult.DeserializeNeighborGroupListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -593,7 +669,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -605,9 +681,9 @@ public async Task> ListByResourceGroupNextPag { case 200: { - NeighborGroupsListResult value = default; + NeighborGroupListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NeighborGroupsListResult.DeserializeNeighborGroupsListResult(document.RootElement); + value = NeighborGroupListResult.DeserializeNeighborGroupListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -622,7 +698,7 @@ public async Task> ListByResourceGroupNextPag /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -634,85 +710,9 @@ public Response ListByResourceGroupNextPage(string nex { case 200: { - NeighborGroupsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NeighborGroupsListResult.DeserializeNeighborGroupsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Displays NeighborGroups list by subscription GET method. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NeighborGroupsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NeighborGroupsListResult.DeserializeNeighborGroupsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Displays NeighborGroups list by subscription GET method. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NeighborGroupsListResult value = default; + NeighborGroupListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NeighborGroupsListResult.DeserializeNeighborGroupsListResult(document.RootElement); + value = NeighborGroupListResult.DeserializeNeighborGroupListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkDeviceSkusRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkDeviceSkusRestOperations.cs index f5088736292d..7077773a0796 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkDeviceSkusRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkDeviceSkusRestOperations.cs @@ -32,23 +32,22 @@ public NetworkDeviceSkusRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string networkDeviceSkuName) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus/", false); - uri.AppendPath(networkDeviceSkuName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string networkDeviceSkuName) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -57,8 +56,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string networkDevic uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus/", false); - uri.AppendPath(networkDeviceSkuName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -66,76 +64,69 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string networkDevic return message; } - /// Get a Network Device SKU details. + /// List Network Device SKUs for the given subscription. /// The ID of the target subscription. The value must be an UUID. - /// Name of the Network Device SKU. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string networkDeviceSkuName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(networkDeviceSkuName, nameof(networkDeviceSkuName)); - using var message = CreateGetRequest(subscriptionId, networkDeviceSkuName); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkDeviceSkuData value = default; + NetworkDeviceSkuListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkDeviceSkuData.DeserializeNetworkDeviceSkuData(document.RootElement); + value = NetworkDeviceSkuListResult.DeserializeNetworkDeviceSkuListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((NetworkDeviceSkuData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get a Network Device SKU details. + /// List Network Device SKUs for the given subscription. /// The ID of the target subscription. The value must be an UUID. - /// Name of the Network Device SKU. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string networkDeviceSkuName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(networkDeviceSkuName, nameof(networkDeviceSkuName)); - using var message = CreateGetRequest(subscriptionId, networkDeviceSkuName); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkDeviceSkuData value = default; + NetworkDeviceSkuListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkDeviceSkuData.DeserializeNetworkDeviceSkuData(document.RootElement); + value = NetworkDeviceSkuListResult.DeserializeNetworkDeviceSkuListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((NetworkDeviceSkuData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string networkDeviceSkuName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus/", false); + uri.AppendPath(networkDeviceSkuName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateGetRequest(string subscriptionId, string networkDeviceSkuName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -144,7 +135,8 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus/", false); + uri.AppendPath(networkDeviceSkuName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -152,51 +144,59 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) return message; } - /// List Network Device SKUs for the given subscription. + /// Get a Network Device SKU details. /// The ID of the target subscription. The value must be an UUID. + /// Name of the Network Device SKU. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string networkDeviceSkuName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(networkDeviceSkuName, nameof(networkDeviceSkuName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateGetRequest(subscriptionId, networkDeviceSkuName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkDeviceSkusListResult value = default; + NetworkDeviceSkuData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkDeviceSkusListResult.DeserializeNetworkDeviceSkusListResult(document.RootElement); + value = NetworkDeviceSkuData.DeserializeNetworkDeviceSkuData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((NetworkDeviceSkuData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// List Network Device SKUs for the given subscription. + /// Get a Network Device SKU details. /// The ID of the target subscription. The value must be an UUID. + /// Name of the Network Device SKU. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string networkDeviceSkuName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(networkDeviceSkuName, nameof(networkDeviceSkuName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateGetRequest(subscriptionId, networkDeviceSkuName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkDeviceSkusListResult value = default; + NetworkDeviceSkuData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkDeviceSkusListResult.DeserializeNetworkDeviceSkusListResult(document.RootElement); + value = NetworkDeviceSkuData.DeserializeNetworkDeviceSkuData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((NetworkDeviceSkuData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -230,7 +230,7 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -241,9 +241,9 @@ public async Task> ListBySubscriptionNextP { case 200: { - NetworkDeviceSkusListResult value = default; + NetworkDeviceSkuListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkDeviceSkusListResult.DeserializeNetworkDeviceSkusListResult(document.RootElement); + value = NetworkDeviceSkuListResult.DeserializeNetworkDeviceSkuListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -257,7 +257,7 @@ public async Task> ListBySubscriptionNextP /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -268,9 +268,9 @@ public Response ListBySubscriptionNextPage(string n { case 200: { - NetworkDeviceSkusListResult value = default; + NetworkDeviceSkuListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkDeviceSkusListResult.DeserializeNetworkDeviceSkusListResult(document.RootElement); + value = NetworkDeviceSkuListResult.DeserializeNetworkDeviceSkuListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkDevicesRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkDevicesRestOperations.cs index 6024a1e0b5f9..9ce6f5468045 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkDevicesRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkDevicesRestOperations.cs @@ -32,11 +32,89 @@ public NetworkDevicesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkDeviceName, NetworkDeviceData data) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the Network Device resources in a given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NetworkDeviceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkDeviceListResult.DeserializeNetworkDeviceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the Network Device resources in a given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NetworkDeviceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkDeviceListResult.DeserializeNetworkDeviceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -44,85 +122,79 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices/", false); - uri.AppendPath(networkDeviceName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkDeviceName, NetworkDeviceData data) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices/", false); - uri.AppendPath(networkDeviceName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Create a Network Device resource. + /// List all the Network Device resources in a given resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Network Device. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkDeviceName, NetworkDeviceData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkDeviceName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NetworkDeviceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkDeviceListResult.DeserializeNetworkDeviceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Create a Network Device resource. + /// List all the Network Device resources in a given resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Network Device. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string networkDeviceName, NetworkDeviceData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkDeviceName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NetworkDeviceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkDeviceListResult.DeserializeNetworkDeviceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -224,6 +296,98 @@ public Response Get(string subscriptionId, string resourceGro } } + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkDeviceName, NetworkDeviceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices/", false); + uri.AppendPath(networkDeviceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkDeviceName, NetworkDeviceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices/", false); + uri.AppendPath(networkDeviceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a Network Device resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Device. + /// Request payload. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkDeviceName, NetworkDeviceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkDeviceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a Network Device resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Device. + /// Request payload. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string networkDeviceName, NetworkDeviceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkDeviceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string networkDeviceName, NetworkDevicePatch patch) { var uri = new RawRequestUriBuilder(); @@ -400,7 +564,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string n } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateRebootRequestUri(string subscriptionId, string resourceGroupName, string networkDeviceName, NetworkDeviceRebootContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -408,105 +572,121 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices/", false); + uri.AppendPath(networkDeviceName, true); + uri.AppendPath("/reboot", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateRebootRequest(string subscriptionId, string resourceGroupName, string networkDeviceName, NetworkDeviceRebootContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices/", false); + uri.AppendPath(networkDeviceName, true); + uri.AppendPath("/reboot", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// List all the Network Device resources in a given resource group. + /// Reboot the Network Device. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Network Device. + /// Request payload. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task RebootAsync(string subscriptionId, string resourceGroupName, string networkDeviceName, NetworkDeviceRebootContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateRebootRequest(subscriptionId, resourceGroupName, networkDeviceName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - NetworkDevicesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkDevicesListResult.DeserializeNetworkDevicesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// List all the Network Device resources in a given resource group. + /// Reboot the Network Device. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Network Device. + /// Request payload. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Reboot(string subscriptionId, string resourceGroupName, string networkDeviceName, NetworkDeviceRebootContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateRebootRequest(subscriptionId, resourceGroupName, networkDeviceName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - NetworkDevicesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkDevicesListResult.DeserializeNetworkDevicesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateRefreshConfigurationRequestUri(string subscriptionId, string resourceGroupName, string networkDeviceName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices/", false); + uri.AppendPath(networkDeviceName, true); + uri.AppendPath("/refreshConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateRefreshConfigurationRequest(string subscriptionId, string resourceGroupName, string networkDeviceName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices/", false); + uri.AppendPath(networkDeviceName, true); + uri.AppendPath("/refreshConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -514,57 +694,57 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) return message; } - /// List all the Network Device resources in a given subscription. + /// Refreshes the configuration the Network Device. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Device. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task RefreshConfigurationAsync(string subscriptionId, string resourceGroupName, string networkDeviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateRefreshConfigurationRequest(subscriptionId, resourceGroupName, networkDeviceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - NetworkDevicesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkDevicesListResult.DeserializeNetworkDevicesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// List all the Network Device resources in a given subscription. + /// Refreshes the configuration the Network Device. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Device. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response RefreshConfiguration(string subscriptionId, string resourceGroupName, string networkDeviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateRefreshConfigurationRequest(subscriptionId, resourceGroupName, networkDeviceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - NetworkDevicesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkDevicesListResult.DeserializeNetworkDevicesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateRebootRequestUri(string subscriptionId, string resourceGroupName, string networkDeviceName, NetworkDeviceRebootContent content) + internal RequestUriBuilder CreateRunRoCommandRequestUri(string subscriptionId, string resourceGroupName, string networkDeviceName, DeviceRoCommand body) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -574,12 +754,12 @@ internal RequestUriBuilder CreateRebootRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices/", false); uri.AppendPath(networkDeviceName, true); - uri.AppendPath("/reboot", false); + uri.AppendPath("/runRoCommand", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateRebootRequest(string subscriptionId, string resourceGroupName, string networkDeviceName, NetworkDeviceRebootContent content) + internal HttpMessage CreateRunRoCommandRequest(string subscriptionId, string resourceGroupName, string networkDeviceName, DeviceRoCommand body) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -592,34 +772,34 @@ internal HttpMessage CreateRebootRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices/", false); uri.AppendPath(networkDeviceName, true); - uri.AppendPath("/reboot", false); + uri.AppendPath("/runRoCommand", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Reboot the Network Device. + /// Run the RO Command on the Network Device. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Device. - /// Request payload. + /// Request the command. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task RebootAsync(string subscriptionId, string resourceGroupName, string networkDeviceName, NetworkDeviceRebootContent content, CancellationToken cancellationToken = default) + public async Task RunRoCommandAsync(string subscriptionId, string resourceGroupName, string networkDeviceName, DeviceRoCommand body, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(body, nameof(body)); - using var message = CreateRebootRequest(subscriptionId, resourceGroupName, networkDeviceName, content); + using var message = CreateRunRoCommandRequest(subscriptionId, resourceGroupName, networkDeviceName, body); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -631,22 +811,22 @@ public async Task RebootAsync(string subscriptionId, string resourceGr } } - /// Reboot the Network Device. + /// Run the RO Command on the Network Device. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Device. - /// Request payload. + /// Request the command. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Reboot(string subscriptionId, string resourceGroupName, string networkDeviceName, NetworkDeviceRebootContent content, CancellationToken cancellationToken = default) + public Response RunRoCommand(string subscriptionId, string resourceGroupName, string networkDeviceName, DeviceRoCommand body, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(body, nameof(body)); - using var message = CreateRebootRequest(subscriptionId, resourceGroupName, networkDeviceName, content); + using var message = CreateRunRoCommandRequest(subscriptionId, resourceGroupName, networkDeviceName, body); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -658,7 +838,7 @@ public Response Reboot(string subscriptionId, string resourceGroupName, string n } } - internal RequestUriBuilder CreateRefreshConfigurationRequestUri(string subscriptionId, string resourceGroupName, string networkDeviceName) + internal RequestUriBuilder CreateRunRwCommandRequestUri(string subscriptionId, string resourceGroupName, string networkDeviceName, DeviceRwCommand body) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -668,12 +848,12 @@ internal RequestUriBuilder CreateRefreshConfigurationRequestUri(string subscript uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices/", false); uri.AppendPath(networkDeviceName, true); - uri.AppendPath("/refreshConfiguration", false); + uri.AppendPath("/runRwCommand", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateRefreshConfigurationRequest(string subscriptionId, string resourceGroupName, string networkDeviceName) + internal HttpMessage CreateRunRwCommandRequest(string subscriptionId, string resourceGroupName, string networkDeviceName, DeviceRwCommand body) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -686,28 +866,34 @@ internal HttpMessage CreateRefreshConfigurationRequest(string subscriptionId, st uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices/", false); uri.AppendPath(networkDeviceName, true); - uri.AppendPath("/refreshConfiguration", false); + uri.AppendPath("/runRwCommand", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Refreshes the configuration the Network Device. + /// Run the RW Command on the Network Device. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Device. + /// Request the command. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task RefreshConfigurationAsync(string subscriptionId, string resourceGroupName, string networkDeviceName, CancellationToken cancellationToken = default) + public async Task RunRwCommandAsync(string subscriptionId, string resourceGroupName, string networkDeviceName, DeviceRwCommand body, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); + Argument.AssertNotNull(body, nameof(body)); - using var message = CreateRefreshConfigurationRequest(subscriptionId, resourceGroupName, networkDeviceName); + using var message = CreateRunRwCommandRequest(subscriptionId, resourceGroupName, networkDeviceName, body); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -719,20 +905,22 @@ public async Task RefreshConfigurationAsync(string subscriptionId, str } } - /// Refreshes the configuration the Network Device. + /// Run the RW Command on the Network Device. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Device. + /// Request the command. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response RefreshConfiguration(string subscriptionId, string resourceGroupName, string networkDeviceName, CancellationToken cancellationToken = default) + public Response RunRwCommand(string subscriptionId, string resourceGroupName, string networkDeviceName, DeviceRwCommand body, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); + Argument.AssertNotNull(body, nameof(body)); - using var message = CreateRefreshConfigurationRequest(subscriptionId, resourceGroupName, networkDeviceName); + using var message = CreateRunRwCommandRequest(subscriptionId, resourceGroupName, networkDeviceName, body); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -932,7 +1120,7 @@ public Response Upgrade(string subscriptionId, string resourceGroupName, string } } - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -940,7 +1128,7 @@ internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string ne return uri; } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -954,28 +1142,26 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// List all the Network Device resources in a given resource group. + /// List all the Network Device resources in a given subscription. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkDevicesListResult value = default; + NetworkDeviceListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkDevicesListResult.DeserializeNetworkDevicesListResult(document.RootElement); + value = NetworkDeviceListResult.DeserializeNetworkDeviceListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -983,28 +1169,26 @@ public async Task> ListByResourceGroupNextPag } } - /// List all the Network Device resources in a given resource group. + /// List all the Network Device resources in a given subscription. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkDevicesListResult value = default; + NetworkDeviceListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkDevicesListResult.DeserializeNetworkDevicesListResult(document.RootElement); + value = NetworkDeviceListResult.DeserializeNetworkDeviceListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1012,7 +1196,7 @@ public Response ListByResourceGroupNextPage(string nex } } - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1020,7 +1204,7 @@ internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nex return uri; } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1034,26 +1218,28 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st return message; } - /// List all the Network Device resources in a given subscription. + /// List all the Network Device resources in a given resource group. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkDevicesListResult value = default; + NetworkDeviceListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkDevicesListResult.DeserializeNetworkDevicesListResult(document.RootElement); + value = NetworkDeviceListResult.DeserializeNetworkDeviceListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1061,26 +1247,28 @@ public async Task> ListBySubscriptionNextPage } } - /// List all the Network Device resources in a given subscription. + /// List all the Network Device resources in a given resource group. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkDevicesListResult value = default; + NetworkDeviceListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkDevicesListResult.DeserializeNetworkDevicesListResult(document.RootElement); + value = NetworkDeviceListResult.DeserializeNetworkDeviceListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkFabricControllersRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkFabricControllersRestOperations.cs index d9e8b0195139..9bd461343236 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkFabricControllersRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkFabricControllersRestOperations.cs @@ -32,11 +32,89 @@ public NetworkFabricControllersRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkFabricControllerName, NetworkFabricControllerData data) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all the NetworkFabricControllers by subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NetworkFabricControllerListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkFabricControllerListResult.DeserializeNetworkFabricControllerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the NetworkFabricControllers by subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NetworkFabricControllerListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkFabricControllerListResult.DeserializeNetworkFabricControllerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -44,85 +122,79 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/", false); - uri.AppendPath(networkFabricControllerName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkFabricControllerName, NetworkFabricControllerData data) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/", false); - uri.AppendPath(networkFabricControllerName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Creates a Network Fabric Controller. + /// Lists all the NetworkFabricControllers thats available in the resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Network Fabric Controller. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkFabricControllerName, NetworkFabricControllerData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(networkFabricControllerName, nameof(networkFabricControllerName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkFabricControllerName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NetworkFabricControllerListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkFabricControllerListResult.DeserializeNetworkFabricControllerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Creates a Network Fabric Controller. + /// Lists all the NetworkFabricControllers thats available in the resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Network Fabric Controller. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string networkFabricControllerName, NetworkFabricControllerData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(networkFabricControllerName, nameof(networkFabricControllerName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkFabricControllerName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NetworkFabricControllerListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkFabricControllerListResult.DeserializeNetworkFabricControllerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -224,7 +296,7 @@ public Response Get(string subscriptionId, string r } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string networkFabricControllerName, NetworkFabricControllerPatch patch) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkFabricControllerName, NetworkFabricControllerData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -238,11 +310,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string networkFabricControllerName, NetworkFabricControllerPatch patch) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkFabricControllerName, NetworkFabricControllerData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -256,67 +328,67 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; } - /// Updates are currently not supported for the Network Fabric Controller resource. + /// Creates a Network Fabric Controller. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric Controller. - /// Network Fabric Controller properties to update. + /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string networkFabricControllerName, NetworkFabricControllerPatch patch, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkFabricControllerName, NetworkFabricControllerData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricControllerName, nameof(networkFabricControllerName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkFabricControllerName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkFabricControllerName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Updates are currently not supported for the Network Fabric Controller resource. + /// Creates a Network Fabric Controller. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric Controller. - /// Network Fabric Controller properties to update. + /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string networkFabricControllerName, NetworkFabricControllerPatch patch, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string networkFabricControllerName, NetworkFabricControllerData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricControllerName, nameof(networkFabricControllerName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkFabricControllerName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkFabricControllerName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string networkFabricControllerName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string networkFabricControllerName, NetworkFabricControllerPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -330,11 +402,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string networkFabricControllerName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string networkFabricControllerName, NetworkFabricControllerPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -346,61 +418,69 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Deletes the Network Fabric Controller resource. + /// Updates are currently not supported for the Network Fabric Controller resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric Controller. + /// Network Fabric Controller properties to update. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string networkFabricControllerName, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string networkFabricControllerName, NetworkFabricControllerPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricControllerName, nameof(networkFabricControllerName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkFabricControllerName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkFabricControllerName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Deletes the Network Fabric Controller resource. + /// Updates are currently not supported for the Network Fabric Controller resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric Controller. + /// Network Fabric Controller properties to update. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string networkFabricControllerName, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string networkFabricControllerName, NetworkFabricControllerPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricControllerName, nameof(networkFabricControllerName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkFabricControllerName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkFabricControllerName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string networkFabricControllerName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -408,23 +488,25 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/", false); + uri.AppendPath(networkFabricControllerName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string networkFabricControllerName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/", false); + uri.AppendPath(networkFabricControllerName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -432,82 +514,72 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str return message; } - /// Lists all the NetworkFabricControllers thats available in the resource group. + /// Deletes the Network Fabric Controller resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Network Fabric Controller. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string networkFabricControllerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkFabricControllerName, nameof(networkFabricControllerName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkFabricControllerName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - NetworkFabricControllersListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkFabricControllersListResult.DeserializeNetworkFabricControllersListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Lists all the NetworkFabricControllers thats available in the resource group. + /// Deletes the Network Fabric Controller resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Network Fabric Controller. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string networkFabricControllerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkFabricControllerName, nameof(networkFabricControllerName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkFabricControllerName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - NetworkFabricControllersListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkFabricControllersListResult.DeserializeNetworkFabricControllersListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers", false); - uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendRawNextLink(nextLink, false); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers", false); - uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendRawNextLink(nextLink, false); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -515,23 +587,25 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// Lists all the NetworkFabricControllers by subscription. + /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkFabricControllersListResult value = default; + NetworkFabricControllerListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkFabricControllersListResult.DeserializeNetworkFabricControllersListResult(document.RootElement); + value = NetworkFabricControllerListResult.DeserializeNetworkFabricControllerListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -540,23 +614,25 @@ public async Task> ListBySubscripti } /// Lists all the NetworkFabricControllers by subscription. + /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkFabricControllersListResult value = default; + NetworkFabricControllerListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkFabricControllersListResult.DeserializeNetworkFabricControllersListResult(document.RootElement); + value = NetworkFabricControllerListResult.DeserializeNetworkFabricControllerListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -593,7 +669,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -605,9 +681,9 @@ public async Task> ListByResourceGr { case 200: { - NetworkFabricControllersListResult value = default; + NetworkFabricControllerListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkFabricControllersListResult.DeserializeNetworkFabricControllersListResult(document.RootElement); + value = NetworkFabricControllerListResult.DeserializeNetworkFabricControllerListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -622,7 +698,7 @@ public async Task> ListByResourceGr /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -634,85 +710,9 @@ public Response ListByResourceGroupNextPage( { case 200: { - NetworkFabricControllersListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkFabricControllersListResult.DeserializeNetworkFabricControllersListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the NetworkFabricControllers by subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NetworkFabricControllersListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkFabricControllersListResult.DeserializeNetworkFabricControllersListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the NetworkFabricControllers by subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NetworkFabricControllersListResult value = default; + NetworkFabricControllerListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkFabricControllersListResult.DeserializeNetworkFabricControllersListResult(document.RootElement); + value = NetworkFabricControllerListResult.DeserializeNetworkFabricControllerListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkFabricSkusRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkFabricSkusRestOperations.cs index 832db8fae0f2..015800e3a3cf 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkFabricSkusRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkFabricSkusRestOperations.cs @@ -32,23 +32,22 @@ public NetworkFabricSkusRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string networkFabricSkuName) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus/", false); - uri.AppendPath(networkFabricSkuName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string networkFabricSkuName) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -57,8 +56,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string networkFabri uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus/", false); - uri.AppendPath(networkFabricSkuName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -66,76 +64,69 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string networkFabri return message; } - /// Implements Network Fabric SKU GET method. + /// Implements Network Fabric SKUs list by subscription GET method. /// The ID of the target subscription. The value must be an UUID. - /// Name of the Network Fabric SKU. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string networkFabricSkuName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(networkFabricSkuName, nameof(networkFabricSkuName)); - using var message = CreateGetRequest(subscriptionId, networkFabricSkuName); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkFabricSkuData value = default; + NetworkFabricSkuListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkFabricSkuData.DeserializeNetworkFabricSkuData(document.RootElement); + value = NetworkFabricSkuListResult.DeserializeNetworkFabricSkuListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((NetworkFabricSkuData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Implements Network Fabric SKU GET method. + /// Implements Network Fabric SKUs list by subscription GET method. /// The ID of the target subscription. The value must be an UUID. - /// Name of the Network Fabric SKU. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string networkFabricSkuName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(networkFabricSkuName, nameof(networkFabricSkuName)); - using var message = CreateGetRequest(subscriptionId, networkFabricSkuName); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkFabricSkuData value = default; + NetworkFabricSkuListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkFabricSkuData.DeserializeNetworkFabricSkuData(document.RootElement); + value = NetworkFabricSkuListResult.DeserializeNetworkFabricSkuListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((NetworkFabricSkuData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string networkFabricSkuName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus/", false); + uri.AppendPath(networkFabricSkuName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateGetRequest(string subscriptionId, string networkFabricSkuName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -144,7 +135,8 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus/", false); + uri.AppendPath(networkFabricSkuName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -152,51 +144,59 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) return message; } - /// Implements Network Fabric SKUs list by subscription GET method. + /// Implements Network Fabric SKU GET method. /// The ID of the target subscription. The value must be an UUID. + /// Name of the Network Fabric SKU. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string networkFabricSkuName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(networkFabricSkuName, nameof(networkFabricSkuName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateGetRequest(subscriptionId, networkFabricSkuName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkFabricSkusListResult value = default; + NetworkFabricSkuData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkFabricSkusListResult.DeserializeNetworkFabricSkusListResult(document.RootElement); + value = NetworkFabricSkuData.DeserializeNetworkFabricSkuData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((NetworkFabricSkuData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Implements Network Fabric SKUs list by subscription GET method. + /// Implements Network Fabric SKU GET method. /// The ID of the target subscription. The value must be an UUID. + /// Name of the Network Fabric SKU. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string networkFabricSkuName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(networkFabricSkuName, nameof(networkFabricSkuName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateGetRequest(subscriptionId, networkFabricSkuName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkFabricSkusListResult value = default; + NetworkFabricSkuData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkFabricSkusListResult.DeserializeNetworkFabricSkusListResult(document.RootElement); + value = NetworkFabricSkuData.DeserializeNetworkFabricSkuData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((NetworkFabricSkuData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -230,7 +230,7 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -241,9 +241,9 @@ public async Task> ListBySubscriptionNextP { case 200: { - NetworkFabricSkusListResult value = default; + NetworkFabricSkuListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkFabricSkusListResult.DeserializeNetworkFabricSkusListResult(document.RootElement); + value = NetworkFabricSkuListResult.DeserializeNetworkFabricSkuListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -257,7 +257,7 @@ public async Task> ListBySubscriptionNextP /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -268,9 +268,9 @@ public Response ListBySubscriptionNextPage(string n { case 200: { - NetworkFabricSkusListResult value = default; + NetworkFabricSkuListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkFabricSkusListResult.DeserializeNetworkFabricSkusListResult(document.RootElement); + value = NetworkFabricSkuListResult.DeserializeNetworkFabricSkuListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkFabricsRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkFabricsRestOperations.cs index 130cdb4ee9b2..085cf57aa4f6 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkFabricsRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkFabricsRestOperations.cs @@ -32,11 +32,89 @@ public NetworkFabricsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, NetworkFabricData data) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the Network Fabric resources in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NetworkFabricListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkFabricListResult.DeserializeNetworkFabricListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the Network Fabric resources in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NetworkFabricListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkFabricListResult.DeserializeNetworkFabricListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -44,85 +122,79 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); - uri.AppendPath(networkFabricName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkFabricName, NetworkFabricData data) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); - uri.AppendPath(networkFabricName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Create Network Fabric resource. + /// List all the Network Fabric resources in the given resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Network Fabric. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkFabricName, NetworkFabricData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkFabricName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NetworkFabricListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkFabricListResult.DeserializeNetworkFabricListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Create Network Fabric resource. + /// List all the Network Fabric resources in the given resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Network Fabric. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string networkFabricName, NetworkFabricData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkFabricName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NetworkFabricListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkFabricListResult.DeserializeNetworkFabricListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -224,6 +296,98 @@ public Response Get(string subscriptionId, string resourceGro } } + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, NetworkFabricData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); + uri.AppendPath(networkFabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkFabricName, NetworkFabricData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); + uri.AppendPath(networkFabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create Network Fabric resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Fabric. + /// Request payload. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkFabricName, NetworkFabricData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkFabricName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create Network Fabric resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Fabric. + /// Request payload. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string networkFabricName, NetworkFabricData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkFabricName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, NetworkFabricPatch patch) { var uri = new RawRequestUriBuilder(); @@ -400,7 +564,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string n } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateArmConfigurationDiffRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -408,23 +572,27 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); + uri.AppendPath(networkFabricName, true); + uri.AppendPath("/armConfigurationDiff", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateArmConfigurationDiffRequest(string subscriptionId, string resourceGroupName, string networkFabricName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); + uri.AppendPath(networkFabricName, true); + uri.AppendPath("/armConfigurationDiff", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -432,139 +600,417 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str return message; } - /// List all the Network Fabric resources in the given resource group. + /// Post action: Triggers diff of NetworkFabric ARM Configuration. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Network Fabric. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task ArmConfigurationDiffAsync(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateArmConfigurationDiffRequest(subscriptionId, resourceGroupName, networkFabricName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - NetworkFabricsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkFabricsListResult.DeserializeNetworkFabricsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// List all the Network Fabric resources in the given resource group. + /// Post action: Triggers diff of NetworkFabric ARM Configuration. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Network Fabric. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ArmConfigurationDiff(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateArmConfigurationDiffRequest(subscriptionId, resourceGroupName, networkFabricName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - NetworkFabricsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkFabricsListResult.DeserializeNetworkFabricsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateCommitBatchStatusRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, CommitBatchStatusContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); + uri.AppendPath(networkFabricName, true); + uri.AppendPath("/commitBatchStatus", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateCommitBatchStatusRequest(string subscriptionId, string resourceGroupName, string networkFabricName, CommitBatchStatusContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); + uri.AppendPath(networkFabricName, true); + uri.AppendPath("/commitBatchStatus", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// List all the Network Fabric resources in the given subscription. + /// Post action: Returns a status of commit batch operation. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Fabric. + /// Request payload. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CommitBatchStatusAsync(string subscriptionId, string resourceGroupName, string networkFabricName, CommitBatchStatusContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateCommitBatchStatusRequest(subscriptionId, resourceGroupName, networkFabricName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Post action: Returns a status of commit batch operation. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Fabric. + /// Request payload. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CommitBatchStatus(string subscriptionId, string resourceGroupName, string networkFabricName, CommitBatchStatusContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateCommitBatchStatusRequest(subscriptionId, resourceGroupName, networkFabricName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCommitConfigurationRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); + uri.AppendPath(networkFabricName, true); + uri.AppendPath("/commitConfiguration", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCommitConfigurationRequest(string subscriptionId, string resourceGroupName, string networkFabricName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); + uri.AppendPath(networkFabricName, true); + uri.AppendPath("/commitConfiguration", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric level. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Fabric. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CommitConfigurationAsync(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); + + using var message = CreateCommitConfigurationRequest(subscriptionId, resourceGroupName, networkFabricName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric level. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Fabric. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CommitConfiguration(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); + + using var message = CreateCommitConfigurationRequest(subscriptionId, resourceGroupName, networkFabricName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeprovisionRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); + uri.AppendPath(networkFabricName, true); + uri.AppendPath("/deprovision", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeprovisionRequest(string subscriptionId, string resourceGroupName, string networkFabricName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); + uri.AppendPath(networkFabricName, true); + uri.AppendPath("/deprovision", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deprovisions the underlying resources in the given Network Fabric instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Fabric. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeprovisionAsync(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); + + using var message = CreateDeprovisionRequest(subscriptionId, resourceGroupName, networkFabricName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deprovisions the underlying resources in the given Network Fabric instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Fabric. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Deprovision(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); + + using var message = CreateDeprovisionRequest(subscriptionId, resourceGroupName, networkFabricName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDiscardCommitBatchRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, DiscardCommitBatchContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); + uri.AppendPath(networkFabricName, true); + uri.AppendPath("/discardCommitBatch", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDiscardCommitBatchRequest(string subscriptionId, string resourceGroupName, string networkFabricName, DiscardCommitBatchContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); + uri.AppendPath(networkFabricName, true); + uri.AppendPath("/discardCommitBatch", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Post action: Discards a Batch operation in progress. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Fabric. + /// Request payload. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DiscardCommitBatchAsync(string subscriptionId, string resourceGroupName, string networkFabricName, DiscardCommitBatchContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateDiscardCommitBatchRequest(subscriptionId, resourceGroupName, networkFabricName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - NetworkFabricsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkFabricsListResult.DeserializeNetworkFabricsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// List all the Network Fabric resources in the given subscription. + /// Post action: Discards a Batch operation in progress. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Fabric. + /// Request payload. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response DiscardCommitBatch(string subscriptionId, string resourceGroupName, string networkFabricName, DiscardCommitBatchContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateDiscardCommitBatchRequest(subscriptionId, resourceGroupName, networkFabricName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - NetworkFabricsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkFabricsListResult.DeserializeNetworkFabricsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateProvisionRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName) + internal RequestUriBuilder CreateGetTopologyRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -574,12 +1020,12 @@ internal RequestUriBuilder CreateProvisionRequestUri(string subscriptionId, stri uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/provision", false); + uri.AppendPath("/getTopology", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateProvisionRequest(string subscriptionId, string resourceGroupName, string networkFabricName) + internal HttpMessage CreateGetTopologyRequest(string subscriptionId, string resourceGroupName, string networkFabricName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -592,7 +1038,7 @@ internal HttpMessage CreateProvisionRequest(string subscriptionId, string resour uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/provision", false); + uri.AppendPath("/getTopology", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -600,20 +1046,20 @@ internal HttpMessage CreateProvisionRequest(string subscriptionId, string resour return message; } - /// Provisions the underlying resources in the given Network Fabric instance. + /// Gets Topology of the underlying resources in the given Network Fabric instance. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task ProvisionAsync(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) + public async Task GetTopologyAsync(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); - using var message = CreateProvisionRequest(subscriptionId, resourceGroupName, networkFabricName); + using var message = CreateGetTopologyRequest(subscriptionId, resourceGroupName, networkFabricName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -625,20 +1071,20 @@ public async Task ProvisionAsync(string subscriptionId, string resourc } } - /// Provisions the underlying resources in the given Network Fabric instance. + /// Gets Topology of the underlying resources in the given Network Fabric instance. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Provision(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) + public Response GetTopology(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); - using var message = CreateProvisionRequest(subscriptionId, resourceGroupName, networkFabricName); + using var message = CreateGetTopologyRequest(subscriptionId, resourceGroupName, networkFabricName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -650,7 +1096,7 @@ public Response Provision(string subscriptionId, string resourceGroupName, strin } } - internal RequestUriBuilder CreateDeprovisionRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName) + internal RequestUriBuilder CreateLockFabricRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, NetworkFabricLockContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -660,12 +1106,12 @@ internal RequestUriBuilder CreateDeprovisionRequestUri(string subscriptionId, st uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/deprovision", false); + uri.AppendPath("/lockFabric", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeprovisionRequest(string subscriptionId, string resourceGroupName, string networkFabricName) + internal HttpMessage CreateLockFabricRequest(string subscriptionId, string resourceGroupName, string networkFabricName, NetworkFabricLockContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -678,28 +1124,34 @@ internal HttpMessage CreateDeprovisionRequest(string subscriptionId, string reso uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/deprovision", false); + uri.AppendPath("/lockFabric", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Deprovisions the underlying resources in the given Network Fabric instance. + /// Post action: Triggers network fabric lock operation. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeprovisionAsync(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) + public async Task LockFabricAsync(string subscriptionId, string resourceGroupName, string networkFabricName, NetworkFabricLockContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateDeprovisionRequest(subscriptionId, resourceGroupName, networkFabricName); + using var message = CreateLockFabricRequest(subscriptionId, resourceGroupName, networkFabricName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -711,20 +1163,22 @@ public async Task DeprovisionAsync(string subscriptionId, string resou } } - /// Deprovisions the underlying resources in the given Network Fabric instance. + /// Post action: Triggers network fabric lock operation. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Deprovision(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) + public Response LockFabric(string subscriptionId, string resourceGroupName, string networkFabricName, NetworkFabricLockContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateDeprovisionRequest(subscriptionId, resourceGroupName, networkFabricName); + using var message = CreateLockFabricRequest(subscriptionId, resourceGroupName, networkFabricName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -736,7 +1190,7 @@ public Response Deprovision(string subscriptionId, string resourceGroupName, str } } - internal RequestUriBuilder CreateUpgradeRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, NetworkFabricUpdateVersionContent content) + internal RequestUriBuilder CreateProvisionRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -746,12 +1200,12 @@ internal RequestUriBuilder CreateUpgradeRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/upgrade", false); + uri.AppendPath("/provision", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpgradeRequest(string subscriptionId, string resourceGroupName, string networkFabricName, NetworkFabricUpdateVersionContent content) + internal HttpMessage CreateProvisionRequest(string subscriptionId, string resourceGroupName, string networkFabricName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -764,34 +1218,28 @@ internal HttpMessage CreateUpgradeRequest(string subscriptionId, string resource uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/upgrade", false); + uri.AppendPath("/provision", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; _userAgent.Apply(message); return message; } - /// Upgrades the version of the underlying resources in the given Network Fabric instance. + /// Provisions the underlying resources in the given Network Fabric instance. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. - /// Network Fabric properties to update. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpgradeAsync(string subscriptionId, string resourceGroupName, string networkFabricName, NetworkFabricUpdateVersionContent content, CancellationToken cancellationToken = default) + public async Task ProvisionAsync(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpgradeRequest(subscriptionId, resourceGroupName, networkFabricName, content); + using var message = CreateProvisionRequest(subscriptionId, resourceGroupName, networkFabricName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -803,22 +1251,20 @@ public async Task UpgradeAsync(string subscriptionId, string resourceG } } - /// Upgrades the version of the underlying resources in the given Network Fabric instance. + /// Provisions the underlying resources in the given Network Fabric instance. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. - /// Network Fabric properties to update. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Upgrade(string subscriptionId, string resourceGroupName, string networkFabricName, NetworkFabricUpdateVersionContent content, CancellationToken cancellationToken = default) + public Response Provision(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpgradeRequest(subscriptionId, resourceGroupName, networkFabricName, content); + using var message = CreateProvisionRequest(subscriptionId, resourceGroupName, networkFabricName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -916,7 +1362,7 @@ public Response RefreshConfiguration(string subscriptionId, string resourceGroup } } - internal RequestUriBuilder CreateUpdateWorkloadManagementBfdConfigurationRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, UpdateAdministrativeStateContent content) + internal RequestUriBuilder CreateUpdateInfraManagementBfdConfigurationRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, UpdateAdministrativeStateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -926,12 +1372,12 @@ internal RequestUriBuilder CreateUpdateWorkloadManagementBfdConfigurationRequest uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/updateWorkloadManagementBfdConfiguration", false); + uri.AppendPath("/updateInfraManagementBfdConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateWorkloadManagementBfdConfigurationRequest(string subscriptionId, string resourceGroupName, string networkFabricName, UpdateAdministrativeStateContent content) + internal HttpMessage CreateUpdateInfraManagementBfdConfigurationRequest(string subscriptionId, string resourceGroupName, string networkFabricName, UpdateAdministrativeStateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -944,7 +1390,7 @@ internal HttpMessage CreateUpdateWorkloadManagementBfdConfigurationRequest(strin uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/updateWorkloadManagementBfdConfiguration", false); + uri.AppendPath("/updateInfraManagementBfdConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -956,7 +1402,7 @@ internal HttpMessage CreateUpdateWorkloadManagementBfdConfigurationRequest(strin return message; } - /// Updates the Workload Management BFD Configuration of the underlying resources in the given Network Fabric instance. + /// Updates the Infra Management BFD Configuration of the underlying resources in the given Network Fabric instance. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. @@ -964,14 +1410,14 @@ internal HttpMessage CreateUpdateWorkloadManagementBfdConfigurationRequest(strin /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateWorkloadManagementBfdConfigurationAsync(string subscriptionId, string resourceGroupName, string networkFabricName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public async Task UpdateInfraManagementBfdConfigurationAsync(string subscriptionId, string resourceGroupName, string networkFabricName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateWorkloadManagementBfdConfigurationRequest(subscriptionId, resourceGroupName, networkFabricName, content); + using var message = CreateUpdateInfraManagementBfdConfigurationRequest(subscriptionId, resourceGroupName, networkFabricName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -983,7 +1429,7 @@ public async Task UpdateWorkloadManagementBfdConfigurationAsync(string } } - /// Updates the Workload Management BFD Configuration of the underlying resources in the given Network Fabric instance. + /// Updates the Infra Management BFD Configuration of the underlying resources in the given Network Fabric instance. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. @@ -991,14 +1437,14 @@ public async Task UpdateWorkloadManagementBfdConfigurationAsync(string /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response UpdateWorkloadManagementBfdConfiguration(string subscriptionId, string resourceGroupName, string networkFabricName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public Response UpdateInfraManagementBfdConfiguration(string subscriptionId, string resourceGroupName, string networkFabricName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateWorkloadManagementBfdConfigurationRequest(subscriptionId, resourceGroupName, networkFabricName, content); + using var message = CreateUpdateInfraManagementBfdConfigurationRequest(subscriptionId, resourceGroupName, networkFabricName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1010,7 +1456,7 @@ public Response UpdateWorkloadManagementBfdConfiguration(string subscriptionId, } } - internal RequestUriBuilder CreateUpdateInfraManagementBfdConfigurationRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, UpdateAdministrativeStateContent content) + internal RequestUriBuilder CreateUpdateWorkloadManagementBfdConfigurationRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, UpdateAdministrativeStateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1020,12 +1466,12 @@ internal RequestUriBuilder CreateUpdateInfraManagementBfdConfigurationRequestUri uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/updateInfraManagementBfdConfiguration", false); + uri.AppendPath("/updateWorkloadManagementBfdConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateInfraManagementBfdConfigurationRequest(string subscriptionId, string resourceGroupName, string networkFabricName, UpdateAdministrativeStateContent content) + internal HttpMessage CreateUpdateWorkloadManagementBfdConfigurationRequest(string subscriptionId, string resourceGroupName, string networkFabricName, UpdateAdministrativeStateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1038,7 +1484,7 @@ internal HttpMessage CreateUpdateInfraManagementBfdConfigurationRequest(string s uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/updateInfraManagementBfdConfiguration", false); + uri.AppendPath("/updateWorkloadManagementBfdConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -1050,7 +1496,7 @@ internal HttpMessage CreateUpdateInfraManagementBfdConfigurationRequest(string s return message; } - /// Updates the Infra Management BFD Configuration of the underlying resources in the given Network Fabric instance. + /// Updates the Workload Management BFD Configuration of the underlying resources in the given Network Fabric instance. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. @@ -1058,14 +1504,14 @@ internal HttpMessage CreateUpdateInfraManagementBfdConfigurationRequest(string s /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateInfraManagementBfdConfigurationAsync(string subscriptionId, string resourceGroupName, string networkFabricName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public async Task UpdateWorkloadManagementBfdConfigurationAsync(string subscriptionId, string resourceGroupName, string networkFabricName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateInfraManagementBfdConfigurationRequest(subscriptionId, resourceGroupName, networkFabricName, content); + using var message = CreateUpdateWorkloadManagementBfdConfigurationRequest(subscriptionId, resourceGroupName, networkFabricName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1077,7 +1523,7 @@ public async Task UpdateInfraManagementBfdConfigurationAsync(string su } } - /// Updates the Infra Management BFD Configuration of the underlying resources in the given Network Fabric instance. + /// Updates the Workload Management BFD Configuration of the underlying resources in the given Network Fabric instance. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. @@ -1085,14 +1531,14 @@ public async Task UpdateInfraManagementBfdConfigurationAsync(string su /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response UpdateInfraManagementBfdConfiguration(string subscriptionId, string resourceGroupName, string networkFabricName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public Response UpdateWorkloadManagementBfdConfiguration(string subscriptionId, string resourceGroupName, string networkFabricName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateInfraManagementBfdConfigurationRequest(subscriptionId, resourceGroupName, networkFabricName, content); + using var message = CreateUpdateWorkloadManagementBfdConfigurationRequest(subscriptionId, resourceGroupName, networkFabricName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1104,7 +1550,7 @@ public Response UpdateInfraManagementBfdConfiguration(string subscriptionId, str } } - internal RequestUriBuilder CreateValidateConfigurationRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, ValidateConfigurationContent content) + internal RequestUriBuilder CreateUpgradeRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, UpgradeNetworkFabricProperties body) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1114,12 +1560,12 @@ internal RequestUriBuilder CreateValidateConfigurationRequestUri(string subscrip uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/validateConfiguration", false); + uri.AppendPath("/upgrade", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateValidateConfigurationRequest(string subscriptionId, string resourceGroupName, string networkFabricName, ValidateConfigurationContent content) + internal HttpMessage CreateUpgradeRequest(string subscriptionId, string resourceGroupName, string networkFabricName, UpgradeNetworkFabricProperties body) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1132,34 +1578,34 @@ internal HttpMessage CreateValidateConfigurationRequest(string subscriptionId, s uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/validateConfiguration", false); + uri.AppendPath("/upgrade", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Validates the configuration of the underlying resources in the given Network Fabric instance. + /// Upgrades the version of the underlying resources in the given Network Fabric instance. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. - /// Validate configuration properties. + /// Network Fabric properties to update. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task ValidateConfigurationAsync(string subscriptionId, string resourceGroupName, string networkFabricName, ValidateConfigurationContent content, CancellationToken cancellationToken = default) + public async Task UpgradeAsync(string subscriptionId, string resourceGroupName, string networkFabricName, UpgradeNetworkFabricProperties body, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(body, nameof(body)); - using var message = CreateValidateConfigurationRequest(subscriptionId, resourceGroupName, networkFabricName, content); + using var message = CreateUpgradeRequest(subscriptionId, resourceGroupName, networkFabricName, body); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1171,22 +1617,22 @@ public async Task ValidateConfigurationAsync(string subscriptionId, st } } - /// Validates the configuration of the underlying resources in the given Network Fabric instance. + /// Upgrades the version of the underlying resources in the given Network Fabric instance. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. - /// Validate configuration properties. + /// Network Fabric properties to update. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ValidateConfiguration(string subscriptionId, string resourceGroupName, string networkFabricName, ValidateConfigurationContent content, CancellationToken cancellationToken = default) + public Response Upgrade(string subscriptionId, string resourceGroupName, string networkFabricName, UpgradeNetworkFabricProperties body, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(body, nameof(body)); - using var message = CreateValidateConfigurationRequest(subscriptionId, resourceGroupName, networkFabricName, content); + using var message = CreateUpgradeRequest(subscriptionId, resourceGroupName, networkFabricName, body); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1198,7 +1644,7 @@ public Response ValidateConfiguration(string subscriptionId, string resourceGrou } } - internal RequestUriBuilder CreateGetTopologyRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName) + internal RequestUriBuilder CreateValidateConfigurationRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, ValidateConfigurationContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1208,12 +1654,12 @@ internal RequestUriBuilder CreateGetTopologyRequestUri(string subscriptionId, st uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/getTopology", false); + uri.AppendPath("/validateConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetTopologyRequest(string subscriptionId, string resourceGroupName, string networkFabricName) + internal HttpMessage CreateValidateConfigurationRequest(string subscriptionId, string resourceGroupName, string networkFabricName, ValidateConfigurationContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1226,28 +1672,34 @@ internal HttpMessage CreateGetTopologyRequest(string subscriptionId, string reso uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/getTopology", false); + uri.AppendPath("/validateConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Gets Topology of the underlying resources in the given Network Fabric instance. + /// Validates the configuration of the underlying resources in the given Network Fabric instance. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. + /// Validate configuration properties. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task GetTopologyAsync(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) + public async Task ValidateConfigurationAsync(string subscriptionId, string resourceGroupName, string networkFabricName, ValidateConfigurationContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateGetTopologyRequest(subscriptionId, resourceGroupName, networkFabricName); + using var message = CreateValidateConfigurationRequest(subscriptionId, resourceGroupName, networkFabricName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1259,20 +1711,22 @@ public async Task GetTopologyAsync(string subscriptionId, string resou } } - /// Gets Topology of the underlying resources in the given Network Fabric instance. + /// Validates the configuration of the underlying resources in the given Network Fabric instance. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. + /// Validate configuration properties. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response GetTopology(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) + public Response ValidateConfiguration(string subscriptionId, string resourceGroupName, string networkFabricName, ValidateConfigurationContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateGetTopologyRequest(subscriptionId, resourceGroupName, networkFabricName); + using var message = CreateValidateConfigurationRequest(subscriptionId, resourceGroupName, networkFabricName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1284,7 +1738,7 @@ public Response GetTopology(string subscriptionId, string resourceGroupName, str } } - internal RequestUriBuilder CreateCommitConfigurationRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName) + internal RequestUriBuilder CreateViewDeviceConfigurationRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1294,12 +1748,12 @@ internal RequestUriBuilder CreateCommitConfigurationRequestUri(string subscripti uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/commitConfiguration", false); + uri.AppendPath("/viewDeviceConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCommitConfigurationRequest(string subscriptionId, string resourceGroupName, string networkFabricName) + internal HttpMessage CreateViewDeviceConfigurationRequest(string subscriptionId, string resourceGroupName, string networkFabricName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1312,7 +1766,7 @@ internal HttpMessage CreateCommitConfigurationRequest(string subscriptionId, str uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/commitConfiguration", false); + uri.AppendPath("/viewDeviceConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -1320,20 +1774,20 @@ internal HttpMessage CreateCommitConfigurationRequest(string subscriptionId, str return message; } - /// Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric level. + /// Post action: Triggers view of network fabric configuration. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task CommitConfigurationAsync(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) + public async Task ViewDeviceConfigurationAsync(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); - using var message = CreateCommitConfigurationRequest(subscriptionId, resourceGroupName, networkFabricName); + using var message = CreateViewDeviceConfigurationRequest(subscriptionId, resourceGroupName, networkFabricName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1345,20 +1799,20 @@ public async Task CommitConfigurationAsync(string subscriptionId, stri } } - /// Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric level. + /// Post action: Triggers view of network fabric configuration. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response CommitConfiguration(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) + public Response ViewDeviceConfiguration(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); - using var message = CreateCommitConfigurationRequest(subscriptionId, resourceGroupName, networkFabricName); + using var message = CreateViewDeviceConfigurationRequest(subscriptionId, resourceGroupName, networkFabricName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1370,7 +1824,7 @@ public Response CommitConfiguration(string subscriptionId, string resourceGroupN } } - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1378,7 +1832,7 @@ internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string ne return uri; } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1392,28 +1846,26 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// List all the Network Fabric resources in the given resource group. + /// List all the Network Fabric resources in the given subscription. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkFabricsListResult value = default; + NetworkFabricListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkFabricsListResult.DeserializeNetworkFabricsListResult(document.RootElement); + value = NetworkFabricListResult.DeserializeNetworkFabricListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1421,28 +1873,26 @@ public async Task> ListByResourceGroupNextPag } } - /// List all the Network Fabric resources in the given resource group. + /// List all the Network Fabric resources in the given subscription. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkFabricsListResult value = default; + NetworkFabricListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkFabricsListResult.DeserializeNetworkFabricsListResult(document.RootElement); + value = NetworkFabricListResult.DeserializeNetworkFabricListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1450,7 +1900,7 @@ public Response ListByResourceGroupNextPage(string nex } } - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1458,7 +1908,7 @@ internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nex return uri; } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1472,26 +1922,28 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st return message; } - /// List all the Network Fabric resources in the given subscription. + /// List all the Network Fabric resources in the given resource group. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkFabricsListResult value = default; + NetworkFabricListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkFabricsListResult.DeserializeNetworkFabricsListResult(document.RootElement); + value = NetworkFabricListResult.DeserializeNetworkFabricListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1499,26 +1951,28 @@ public async Task> ListBySubscriptionNextPage } } - /// List all the Network Fabric resources in the given subscription. + /// List all the Network Fabric resources in the given resource group. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkFabricsListResult value = default; + NetworkFabricListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkFabricsListResult.DeserializeNetworkFabricsListResult(document.RootElement); + value = NetworkFabricListResult.DeserializeNetworkFabricListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkInterfacesRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkInterfacesRestOperations.cs index 727046815184..396a5d34a1c5 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkInterfacesRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkInterfacesRestOperations.cs @@ -32,11 +32,11 @@ public NetworkInterfacesRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, NetworkDeviceInterfaceData data) + internal RequestUriBuilder CreateListByNetworkDeviceRequestUri(string subscriptionId, string resourceGroupName, string networkDeviceName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -46,17 +46,16 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices/", false); uri.AppendPath(networkDeviceName, true); - uri.AppendPath("/networkInterfaces/", false); - uri.AppendPath(networkInterfaceName, true); + uri.AppendPath("/networkInterfaces", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, NetworkDeviceInterfaceData data) + internal HttpMessage CreateListByNetworkDeviceRequest(string subscriptionId, string resourceGroupName, string networkDeviceName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -65,72 +64,67 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices/", false); uri.AppendPath(networkDeviceName, true); - uri.AppendPath("/networkInterfaces/", false); - uri.AppendPath(networkInterfaceName, true); + uri.AppendPath("/networkInterfaces", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Create a Network Interface resource. + /// List all the Network Interface resources in a given resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Device. - /// Name of the Network Interface. - /// Request payload. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, NetworkDeviceInterfaceData data, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByNetworkDeviceAsync(string subscriptionId, string resourceGroupName, string networkDeviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); - Argument.AssertNotNullOrEmpty(networkInterfaceName, nameof(networkInterfaceName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkDeviceName, networkInterfaceName, data); + using var message = CreateListByNetworkDeviceRequest(subscriptionId, resourceGroupName, networkDeviceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NetworkInterfaceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Create a Network Interface resource. + /// List all the Network Interface resources in a given resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Device. - /// Name of the Network Interface. - /// Request payload. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, NetworkDeviceInterfaceData data, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByNetworkDevice(string subscriptionId, string resourceGroupName, string networkDeviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); - Argument.AssertNotNullOrEmpty(networkInterfaceName, nameof(networkInterfaceName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkDeviceName, networkInterfaceName, data); + using var message = CreateListByNetworkDeviceRequest(subscriptionId, resourceGroupName, networkDeviceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NetworkInterfaceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -240,7 +234,7 @@ public Response Get(string subscriptionId, string re } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, NetworkDeviceInterfacePatch patch) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, NetworkDeviceInterfaceData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -256,11 +250,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, NetworkDeviceInterfacePatch patch) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, NetworkDeviceInterfaceData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -276,71 +270,71 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; } - /// Update certain properties of the Network Interface resource. + /// Create a Network Interface resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Device. /// Name of the Network Interface. - /// NetworkInterface properties to update. Only tags are supported. + /// Request payload. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, NetworkDeviceInterfacePatch patch, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, NetworkDeviceInterfaceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); Argument.AssertNotNullOrEmpty(networkInterfaceName, nameof(networkInterfaceName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkDeviceName, networkInterfaceName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkDeviceName, networkInterfaceName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Update certain properties of the Network Interface resource. + /// Create a Network Interface resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Device. /// Name of the Network Interface. - /// NetworkInterface properties to update. Only tags are supported. + /// Request payload. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, NetworkDeviceInterfacePatch patch, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, NetworkDeviceInterfaceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); Argument.AssertNotNullOrEmpty(networkInterfaceName, nameof(networkInterfaceName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkDeviceName, networkInterfaceName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkDeviceName, networkInterfaceName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, NetworkDeviceInterfacePatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -356,11 +350,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, NetworkDeviceInterfacePatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -374,65 +368,73 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete the Network Interface resource. + /// Update certain properties of the Network Interface resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Device. /// Name of the Network Interface. + /// NetworkInterface properties to update. Only tags are supported. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, NetworkDeviceInterfacePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); Argument.AssertNotNullOrEmpty(networkInterfaceName, nameof(networkInterfaceName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkDeviceName, networkInterfaceName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkDeviceName, networkInterfaceName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Delete the Network Interface resource. + /// Update certain properties of the Network Interface resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Device. /// Name of the Network Interface. + /// NetworkInterface properties to update. Only tags are supported. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, NetworkDeviceInterfacePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); Argument.AssertNotNullOrEmpty(networkInterfaceName, nameof(networkInterfaceName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkDeviceName, networkInterfaceName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkDeviceName, networkInterfaceName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByNetworkDeviceRequestUri(string subscriptionId, string resourceGroupName, string networkDeviceName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -442,16 +444,17 @@ internal RequestUriBuilder CreateListByNetworkDeviceRequestUri(string subscripti uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices/", false); uri.AppendPath(networkDeviceName, true); - uri.AppendPath("/networkInterfaces", false); + uri.AppendPath("/networkInterfaces/", false); + uri.AppendPath(networkInterfaceName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByNetworkDeviceRequest(string subscriptionId, string resourceGroupName, string networkDeviceName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -460,7 +463,8 @@ internal HttpMessage CreateListByNetworkDeviceRequest(string subscriptionId, str uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkDevices/", false); uri.AppendPath(networkDeviceName, true); - uri.AppendPath("/networkInterfaces", false); + uri.AppendPath("/networkInterfaces/", false); + uri.AppendPath(networkInterfaceName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -468,59 +472,55 @@ internal HttpMessage CreateListByNetworkDeviceRequest(string subscriptionId, str return message; } - /// List all the Network Interface resources in a given resource group. + /// Delete the Network Interface resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Device. + /// Name of the Network Interface. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByNetworkDeviceAsync(string subscriptionId, string resourceGroupName, string networkDeviceName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); + Argument.AssertNotNullOrEmpty(networkInterfaceName, nameof(networkInterfaceName)); - using var message = CreateListByNetworkDeviceRequest(subscriptionId, resourceGroupName, networkDeviceName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkDeviceName, networkInterfaceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - NetworkDeviceInterfacesList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkDeviceInterfacesList.DeserializeNetworkDeviceInterfacesList(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// List all the Network Interface resources in a given resource group. + /// Delete the Network Interface resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Device. + /// Name of the Network Interface. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByNetworkDevice(string subscriptionId, string resourceGroupName, string networkDeviceName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string networkDeviceName, string networkInterfaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkDeviceName, nameof(networkDeviceName)); + Argument.AssertNotNullOrEmpty(networkInterfaceName, nameof(networkInterfaceName)); - using var message = CreateListByNetworkDeviceRequest(subscriptionId, resourceGroupName, networkDeviceName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkDeviceName, networkInterfaceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - NetworkDeviceInterfacesList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkDeviceInterfacesList.DeserializeNetworkDeviceInterfacesList(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -658,7 +658,7 @@ internal HttpMessage CreateListByNetworkDeviceNextPageRequest(string nextLink, s /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByNetworkDeviceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string networkDeviceName, CancellationToken cancellationToken = default) + public async Task> ListByNetworkDeviceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string networkDeviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -671,9 +671,9 @@ public async Task> ListByNetworkDeviceNext { case 200: { - NetworkDeviceInterfacesList value = default; + NetworkInterfaceListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkDeviceInterfacesList.DeserializeNetworkDeviceInterfacesList(document.RootElement); + value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -689,7 +689,7 @@ public async Task> ListByNetworkDeviceNext /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListByNetworkDeviceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string networkDeviceName, CancellationToken cancellationToken = default) + public Response ListByNetworkDeviceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string networkDeviceName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -702,9 +702,9 @@ public Response ListByNetworkDeviceNextPage(string { case 200: { - NetworkDeviceInterfacesList value = default; + NetworkInterfaceListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkDeviceInterfacesList.DeserializeNetworkDeviceInterfacesList(document.RootElement); + value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkMonitorsRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkMonitorsRestOperations.cs new file mode 100644 index 000000000000..20ef7eb92157 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkMonitorsRestOperations.cs @@ -0,0 +1,817 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ManagedNetworkFabric.Models; + +namespace Azure.ResourceManager.ManagedNetworkFabric +{ + internal partial class NetworkMonitorsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of NetworkMonitorsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public NetworkMonitorsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-06-15-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkMonitors", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkMonitors", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Displays NetworkMonitors list by subscription GET method. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NetworkMonitorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkMonitorListResult.DeserializeNetworkMonitorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Displays NetworkMonitors list by subscription GET method. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NetworkMonitorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkMonitorListResult.DeserializeNetworkMonitorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkMonitors", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkMonitors", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Displays NetworkMonitors list by resource group GET method. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NetworkMonitorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkMonitorListResult.DeserializeNetworkMonitorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Displays NetworkMonitors list by resource group GET method. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NetworkMonitorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkMonitorListResult.DeserializeNetworkMonitorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string networkMonitorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkMonitors/", false); + uri.AppendPath(networkMonitorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string networkMonitorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkMonitors/", false); + uri.AppendPath(networkMonitorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Implements NetworkMonitor GET method. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Monitor. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string networkMonitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkMonitorName, nameof(networkMonitorName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, networkMonitorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NetworkMonitorData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkMonitorData.DeserializeNetworkMonitorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkMonitorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Implements NetworkMonitor GET method. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Monitor. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string networkMonitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkMonitorName, nameof(networkMonitorName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, networkMonitorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NetworkMonitorData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkMonitorData.DeserializeNetworkMonitorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkMonitorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkMonitorName, NetworkMonitorData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkMonitors/", false); + uri.AppendPath(networkMonitorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkMonitorName, NetworkMonitorData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkMonitors/", false); + uri.AppendPath(networkMonitorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates NetworkMonitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Monitor. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkMonitorName, NetworkMonitorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkMonitorName, nameof(networkMonitorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkMonitorName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates NetworkMonitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Monitor. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string networkMonitorName, NetworkMonitorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkMonitorName, nameof(networkMonitorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkMonitorName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string networkMonitorName, NetworkMonitorPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkMonitors/", false); + uri.AppendPath(networkMonitorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string networkMonitorName, NetworkMonitorPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkMonitors/", false); + uri.AppendPath(networkMonitorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// API to update certain properties of the NetworkMonitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Monitor. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string networkMonitorName, NetworkMonitorPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkMonitorName, nameof(networkMonitorName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkMonitorName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// API to update certain properties of the NetworkMonitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Monitor. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string networkMonitorName, NetworkMonitorPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkMonitorName, nameof(networkMonitorName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkMonitorName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string networkMonitorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkMonitors/", false); + uri.AppendPath(networkMonitorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string networkMonitorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkMonitors/", false); + uri.AppendPath(networkMonitorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes layer 2 connectivity between compute nodes by managed by named NetworkMonitor name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Monitor. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string networkMonitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkMonitorName, nameof(networkMonitorName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkMonitorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes layer 2 connectivity between compute nodes by managed by named NetworkMonitor name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Monitor. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string networkMonitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkMonitorName, nameof(networkMonitorName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkMonitorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string networkMonitorName, UpdateAdministrativeStateContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkMonitors/", false); + uri.AppendPath(networkMonitorName, true); + uri.AppendPath("/updateAdministrativeState", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string networkMonitorName, UpdateAdministrativeStateContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkMonitors/", false); + uri.AppendPath(networkMonitorName, true); + uri.AppendPath("/updateAdministrativeState", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Enables isolation domain across the fabric or on specified racks. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Monitor. + /// Request payload. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string networkMonitorName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkMonitorName, nameof(networkMonitorName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, networkMonitorName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Enables isolation domain across the fabric or on specified racks. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Monitor. + /// Request payload. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response UpdateAdministrativeState(string subscriptionId, string resourceGroupName, string networkMonitorName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkMonitorName, nameof(networkMonitorName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, networkMonitorName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Displays NetworkMonitors list by subscription GET method. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NetworkMonitorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkMonitorListResult.DeserializeNetworkMonitorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Displays NetworkMonitors list by subscription GET method. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NetworkMonitorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkMonitorListResult.DeserializeNetworkMonitorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Displays NetworkMonitors list by resource group GET method. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NetworkMonitorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkMonitorListResult.DeserializeNetworkMonitorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Displays NetworkMonitors list by resource group GET method. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NetworkMonitorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkMonitorListResult.DeserializeNetworkMonitorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkPacketBrokersRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkPacketBrokersRestOperations.cs index 799de4180fe9..d6e436b64cad 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkPacketBrokersRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkPacketBrokersRestOperations.cs @@ -32,11 +32,89 @@ public NetworkPacketBrokersRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, NetworkPacketBrokerData data) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Displays Network Packet Brokers list by subscription GET method. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NetworkPacketBrokerListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkPacketBrokerListResult.DeserializeNetworkPacketBrokerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Displays Network Packet Brokers list by subscription GET method. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NetworkPacketBrokerListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkPacketBrokerListResult.DeserializeNetworkPacketBrokerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -44,85 +122,79 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/", false); - uri.AppendPath(networkPacketBrokerName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, NetworkPacketBrokerData data) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/", false); - uri.AppendPath(networkPacketBrokerName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Creates a Network Packet Broker. + /// Displays NetworkPacketBrokers list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Network Packet Broker. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, NetworkPacketBrokerData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(networkPacketBrokerName, nameof(networkPacketBrokerName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkPacketBrokerName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NetworkPacketBrokerListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkPacketBrokerListResult.DeserializeNetworkPacketBrokerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Creates a Network Packet Broker. + /// Displays NetworkPacketBrokers list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Network Packet Broker. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, NetworkPacketBrokerData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(networkPacketBrokerName, nameof(networkPacketBrokerName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkPacketBrokerName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NetworkPacketBrokerListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkPacketBrokerListResult.DeserializeNetworkPacketBrokerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -224,7 +296,7 @@ public Response Get(string subscriptionId, string resou } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, NetworkPacketBrokerPatch patch) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, NetworkPacketBrokerData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -238,11 +310,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, NetworkPacketBrokerPatch patch) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, NetworkPacketBrokerData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -256,67 +328,67 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; } - /// API to update certain properties of the Network Packet Broker resource. + /// Creates a Network Packet Broker. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Packet Broker. - /// Network Packet Broker properties to update. + /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, NetworkPacketBrokerPatch patch, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, NetworkPacketBrokerData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkPacketBrokerName, nameof(networkPacketBrokerName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkPacketBrokerName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkPacketBrokerName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// API to update certain properties of the Network Packet Broker resource. + /// Creates a Network Packet Broker. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Packet Broker. - /// Network Packet Broker properties to update. + /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, NetworkPacketBrokerPatch patch, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, NetworkPacketBrokerData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkPacketBrokerName, nameof(networkPacketBrokerName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkPacketBrokerName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkPacketBrokerName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string networkPacketBrokerName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, NetworkPacketBrokerPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -330,11 +402,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string networkPacketBrokerName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, NetworkPacketBrokerPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -346,61 +418,69 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Deletes Network Packet Broker. + /// API to update certain properties of the Network Packet Broker resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Packet Broker. + /// Network Packet Broker properties to update. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, NetworkPacketBrokerPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkPacketBrokerName, nameof(networkPacketBrokerName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkPacketBrokerName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkPacketBrokerName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Deletes Network Packet Broker. + /// API to update certain properties of the Network Packet Broker resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Packet Broker. + /// Network Packet Broker properties to update. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, NetworkPacketBrokerPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkPacketBrokerName, nameof(networkPacketBrokerName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkPacketBrokerName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkPacketBrokerName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string networkPacketBrokerName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -408,23 +488,25 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/", false); + uri.AppendPath(networkPacketBrokerName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string networkPacketBrokerName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/", false); + uri.AppendPath(networkPacketBrokerName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -432,82 +514,72 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str return message; } - /// Displays NetworkPacketBrokers list by resource group GET method. + /// Deletes Network Packet Broker. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Network Packet Broker. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkPacketBrokerName, nameof(networkPacketBrokerName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkPacketBrokerName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - NetworkPacketBrokersListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkPacketBrokersListResult.DeserializeNetworkPacketBrokersListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Displays NetworkPacketBrokers list by resource group GET method. + /// Deletes Network Packet Broker. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Network Packet Broker. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string networkPacketBrokerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkPacketBrokerName, nameof(networkPacketBrokerName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkPacketBrokerName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - NetworkPacketBrokersListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkPacketBrokersListResult.DeserializeNetworkPacketBrokersListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers", false); - uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendRawNextLink(nextLink, false); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers", false); - uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendRawNextLink(nextLink, false); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -515,23 +587,25 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// Displays Network Packet Brokers list by subscription GET method. + /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkPacketBrokersListResult value = default; + NetworkPacketBrokerListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkPacketBrokersListResult.DeserializeNetworkPacketBrokersListResult(document.RootElement); + value = NetworkPacketBrokerListResult.DeserializeNetworkPacketBrokerListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -540,23 +614,25 @@ public async Task> ListBySubscriptionAs } /// Displays Network Packet Brokers list by subscription GET method. + /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkPacketBrokersListResult value = default; + NetworkPacketBrokerListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkPacketBrokersListResult.DeserializeNetworkPacketBrokersListResult(document.RootElement); + value = NetworkPacketBrokerListResult.DeserializeNetworkPacketBrokerListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -593,7 +669,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -605,9 +681,9 @@ public async Task> ListByResourceGroupN { case 200: { - NetworkPacketBrokersListResult value = default; + NetworkPacketBrokerListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkPacketBrokersListResult.DeserializeNetworkPacketBrokersListResult(document.RootElement); + value = NetworkPacketBrokerListResult.DeserializeNetworkPacketBrokerListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -622,7 +698,7 @@ public async Task> ListByResourceGroupN /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -634,85 +710,9 @@ public Response ListByResourceGroupNextPage(stri { case 200: { - NetworkPacketBrokersListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkPacketBrokersListResult.DeserializeNetworkPacketBrokersListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Displays Network Packet Brokers list by subscription GET method. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NetworkPacketBrokersListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkPacketBrokersListResult.DeserializeNetworkPacketBrokersListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Displays Network Packet Brokers list by subscription GET method. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NetworkPacketBrokersListResult value = default; + NetworkPacketBrokerListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkPacketBrokersListResult.DeserializeNetworkPacketBrokersListResult(document.RootElement); + value = NetworkPacketBrokerListResult.DeserializeNetworkPacketBrokerListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkRacksRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkRacksRestOperations.cs index 45c06d8b5565..83d6565f34fe 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkRacksRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkRacksRestOperations.cs @@ -32,11 +32,89 @@ public NetworkRacksRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkRackName, NetworkRackData data) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkRacks", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkRacks", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all Network Rack resources in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NetworkRackListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkRackListResult.DeserializeNetworkRackListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all Network Rack resources in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NetworkRackListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkRackListResult.DeserializeNetworkRackListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -44,85 +122,79 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkRacks/", false); - uri.AppendPath(networkRackName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkRacks", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkRackName, NetworkRackData data) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkRacks/", false); - uri.AppendPath(networkRackName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkRacks", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Create Network Rack resource. + /// List all Network Rack resources in the given resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Network Rack. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkRackName, NetworkRackData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(networkRackName, nameof(networkRackName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkRackName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NetworkRackListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkRackListResult.DeserializeNetworkRackListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Create Network Rack resource. + /// List all Network Rack resources in the given resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Network Rack. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string networkRackName, NetworkRackData data, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(networkRackName, nameof(networkRackName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkRackName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NetworkRackListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkRackListResult.DeserializeNetworkRackListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -224,7 +296,7 @@ public Response Get(string subscriptionId, string resourceGroup } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string networkRackName, NetworkRackPatch patch) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkRackName, NetworkRackData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -238,11 +310,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string networkRackName, NetworkRackPatch patch) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkRackName, NetworkRackData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -256,67 +328,67 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; } - /// Update certain properties of the Network Rack resource. + /// Create Network Rack resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Rack. - /// Network Rack properties to update. + /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string networkRackName, NetworkRackPatch patch, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkRackName, NetworkRackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkRackName, nameof(networkRackName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkRackName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkRackName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Update certain properties of the Network Rack resource. + /// Create Network Rack resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Rack. - /// Network Rack properties to update. + /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string networkRackName, NetworkRackPatch patch, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string networkRackName, NetworkRackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkRackName, nameof(networkRackName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkRackName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkRackName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string networkRackName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string networkRackName, NetworkRackPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -330,11 +402,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string networkRackName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string networkRackName, NetworkRackPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -346,61 +418,69 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete Network Rack resource. + /// Update certain properties of the Network Rack resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Rack. + /// Network Rack properties to update. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string networkRackName, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string networkRackName, NetworkRackPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkRackName, nameof(networkRackName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkRackName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkRackName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Delete Network Rack resource. + /// Update certain properties of the Network Rack resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Rack. + /// Network Rack properties to update. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string networkRackName, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string networkRackName, NetworkRackPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkRackName, nameof(networkRackName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkRackName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkRackName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string networkRackName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -408,23 +488,25 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkRacks", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkRacks/", false); + uri.AppendPath(networkRackName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string networkRackName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkRacks", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkRacks/", false); + uri.AppendPath(networkRackName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -432,82 +514,72 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str return message; } - /// List all Network Rack resources in the given resource group. + /// Delete Network Rack resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Network Rack. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string networkRackName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkRackName, nameof(networkRackName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkRackName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - NetworkRacksListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkRacksListResult.DeserializeNetworkRacksListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// List all Network Rack resources in the given resource group. + /// Delete Network Rack resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Network Rack. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string networkRackName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkRackName, nameof(networkRackName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkRackName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - NetworkRacksListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkRacksListResult.DeserializeNetworkRacksListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkRacks", false); - uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendRawNextLink(nextLink, false); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkRacks", false); - uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendRawNextLink(nextLink, false); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -515,23 +587,25 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// List all Network Rack resources in the given subscription. + /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkRacksListResult value = default; + NetworkRackListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkRacksListResult.DeserializeNetworkRacksListResult(document.RootElement); + value = NetworkRackListResult.DeserializeNetworkRackListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -540,23 +614,25 @@ public async Task> ListBySubscriptionAsync(stri } /// List all Network Rack resources in the given subscription. + /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkRacksListResult value = default; + NetworkRackListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkRacksListResult.DeserializeNetworkRacksListResult(document.RootElement); + value = NetworkRackListResult.DeserializeNetworkRackListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -593,7 +669,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -605,9 +681,9 @@ public async Task> ListByResourceGroupNextPageA { case 200: { - NetworkRacksListResult value = default; + NetworkRackListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkRacksListResult.DeserializeNetworkRacksListResult(document.RootElement); + value = NetworkRackListResult.DeserializeNetworkRackListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -622,7 +698,7 @@ public async Task> ListByResourceGroupNextPageA /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -634,85 +710,9 @@ public Response ListByResourceGroupNextPage(string nextL { case 200: { - NetworkRacksListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkRacksListResult.DeserializeNetworkRacksListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all Network Rack resources in the given subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NetworkRacksListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkRacksListResult.DeserializeNetworkRacksListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all Network Rack resources in the given subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NetworkRacksListResult value = default; + NetworkRackListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkRacksListResult.DeserializeNetworkRacksListResult(document.RootElement); + value = NetworkRackListResult.DeserializeNetworkRackListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkTapRulesRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkTapRulesRestOperations.cs index ff12cdf5b073..f52988432da7 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkTapRulesRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkTapRulesRestOperations.cs @@ -32,103 +32,89 @@ public NetworkTapRulesRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkTapRuleName, NetworkTapRuleData data) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules/", false); - uri.AppendPath(networkTapRuleName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkTapRuleName, NetworkTapRuleData data) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules/", false); - uri.AppendPath(networkTapRuleName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Create Network Tap Rule resource. + /// List all the Network Tap Rule resources in the given subscription. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Name of the Network Tap Rule. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkTapRuleName, NetworkTapRuleData data, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(networkTapRuleName, nameof(networkTapRuleName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkTapRuleName, data); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NetworkTapRuleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkTapRuleListResult.DeserializeNetworkTapRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Create Network Tap Rule resource. + /// List all the Network Tap Rule resources in the given subscription. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Name of the Network Tap Rule. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string networkTapRuleName, NetworkTapRuleData data, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(networkTapRuleName, nameof(networkTapRuleName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkTapRuleName, data); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NetworkTapRuleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkTapRuleListResult.DeserializeNetworkTapRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string networkTapRuleName) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -136,13 +122,12 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules/", false); - uri.AppendPath(networkTapRuleName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string networkTapRuleName) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -153,8 +138,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules/", false); - uri.AppendPath(networkTapRuleName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -162,69 +146,61 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Get Network Tap Rule resource details. + /// List all the Network Tap Rule resources in the given resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Network Tap Rule. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string networkTapRuleName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(networkTapRuleName, nameof(networkTapRuleName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, networkTapRuleName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkTapRuleData value = default; + NetworkTapRuleListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkTapRuleData.DeserializeNetworkTapRuleData(document.RootElement); + value = NetworkTapRuleListResult.DeserializeNetworkTapRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((NetworkTapRuleData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get Network Tap Rule resource details. + /// List all the Network Tap Rule resources in the given resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Network Tap Rule. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string networkTapRuleName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(networkTapRuleName, nameof(networkTapRuleName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, networkTapRuleName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkTapRuleData value = default; + NetworkTapRuleListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkTapRuleData.DeserializeNetworkTapRuleData(document.RootElement); + value = NetworkTapRuleListResult.DeserializeNetworkTapRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((NetworkTapRuleData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string networkTapRuleName, NetworkTapRulePatch patch) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string networkTapRuleName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -238,11 +214,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string networkTapRuleName, NetworkTapRulePatch patch) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string networkTapRuleName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -254,69 +230,73 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Update certain properties of the Network Tap Rule resource. + /// Get Network Tap Rule resource details. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Tap Rule. - /// Network Tap Rule properties to update. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string networkTapRuleName, NetworkTapRulePatch patch, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string networkTapRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkTapRuleName, nameof(networkTapRuleName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkTapRuleName, patch); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, networkTapRuleName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + NetworkTapRuleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkTapRuleData.DeserializeNetworkTapRuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkTapRuleData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Update certain properties of the Network Tap Rule resource. + /// Get Network Tap Rule resource details. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Tap Rule. - /// Network Tap Rule properties to update. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string networkTapRuleName, NetworkTapRulePatch patch, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string networkTapRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkTapRuleName, nameof(networkTapRuleName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkTapRuleName, patch); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, networkTapRuleName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + NetworkTapRuleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkTapRuleData.DeserializeNetworkTapRuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkTapRuleData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string networkTapRuleName) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkTapRuleName, NetworkTapRuleData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -330,11 +310,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string networkTapRuleName) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkTapRuleName, NetworkTapRuleData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -346,61 +326,69 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Delete Network Tap Rule resource. + /// Create Network Tap Rule resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Tap Rule. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string networkTapRuleName, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkTapRuleName, NetworkTapRuleData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkTapRuleName, nameof(networkTapRuleName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkTapRuleName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkTapRuleName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 202: - case 204: + case 200: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Delete Network Tap Rule resource. + /// Create Network Tap Rule resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Tap Rule. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string networkTapRuleName, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string networkTapRuleName, NetworkTapRuleData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkTapRuleName, nameof(networkTapRuleName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkTapRuleName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkTapRuleName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 202: - case 204: + case 200: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string networkTapRuleName, NetworkTapRulePatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -408,105 +396,117 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules/", false); + uri.AppendPath(networkTapRuleName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string networkTapRuleName, NetworkTapRulePatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules/", false); + uri.AppendPath(networkTapRuleName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// List all the Network Tap Rule resources in the given resource group. + /// Update certain properties of the Network Tap Rule resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Network Tap Rule. + /// Network Tap Rule properties to update. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string networkTapRuleName, NetworkTapRulePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkTapRuleName, nameof(networkTapRuleName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkTapRuleName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - NetworkTapRulesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkTapRulesListResult.DeserializeNetworkTapRulesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// List all the Network Tap Rule resources in the given resource group. + /// Update certain properties of the Network Tap Rule resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Network Tap Rule. + /// Network Tap Rule properties to update. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string networkTapRuleName, NetworkTapRulePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkTapRuleName, nameof(networkTapRuleName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkTapRuleName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - NetworkTapRulesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkTapRulesListResult.DeserializeNetworkTapRulesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string networkTapRuleName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules/", false); + uri.AppendPath(networkTapRuleName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string networkTapRuleName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules/", false); + uri.AppendPath(networkTapRuleName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -514,57 +514,57 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) return message; } - /// List all the Network Tap Rule resources in the given subscription. + /// Delete Network Tap Rule resource. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Tap Rule. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string networkTapRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkTapRuleName, nameof(networkTapRuleName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkTapRuleName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - NetworkTapRulesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkTapRulesListResult.DeserializeNetworkTapRulesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// List all the Network Tap Rule resources in the given subscription. + /// Delete Network Tap Rule resource. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Tap Rule. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string networkTapRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkTapRuleName, nameof(networkTapRuleName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkTapRuleName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - NetworkTapRulesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkTapRulesListResult.DeserializeNetworkTapRulesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string networkTapRuleName, UpdateAdministrativeStateContent content) + internal RequestUriBuilder CreateResyncRequestUri(string subscriptionId, string resourceGroupName, string networkTapRuleName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -574,12 +574,12 @@ internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subs uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules/", false); uri.AppendPath(networkTapRuleName, true); - uri.AppendPath("/updateAdministrativeState", false); + uri.AppendPath("/resync", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string networkTapRuleName, UpdateAdministrativeStateContent content) + internal HttpMessage CreateResyncRequest(string subscriptionId, string resourceGroupName, string networkTapRuleName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -592,14 +592,10 @@ internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionI uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules/", false); uri.AppendPath(networkTapRuleName, true); - uri.AppendPath("/updateAdministrativeState", false); + uri.AppendPath("/resync", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; _userAgent.Apply(message); return message; } @@ -608,18 +604,16 @@ internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionI /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Tap Rule. - /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string networkTapRuleName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public async Task ResyncAsync(string subscriptionId, string resourceGroupName, string networkTapRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkTapRuleName, nameof(networkTapRuleName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, networkTapRuleName, content); + using var message = CreateResyncRequest(subscriptionId, resourceGroupName, networkTapRuleName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -635,18 +629,16 @@ public async Task UpdateAdministrativeStateAsync(string subscriptionId /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Tap Rule. - /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response UpdateAdministrativeState(string subscriptionId, string resourceGroupName, string networkTapRuleName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public Response Resync(string subscriptionId, string resourceGroupName, string networkTapRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkTapRuleName, nameof(networkTapRuleName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, networkTapRuleName, content); + using var message = CreateResyncRequest(subscriptionId, resourceGroupName, networkTapRuleName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -658,7 +650,7 @@ public Response UpdateAdministrativeState(string subscriptionId, string resource } } - internal RequestUriBuilder CreateResyncRequestUri(string subscriptionId, string resourceGroupName, string networkTapRuleName) + internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string networkTapRuleName, UpdateAdministrativeStateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -668,12 +660,12 @@ internal RequestUriBuilder CreateResyncRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules/", false); uri.AppendPath(networkTapRuleName, true); - uri.AppendPath("/resync", false); + uri.AppendPath("/updateAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateResyncRequest(string subscriptionId, string resourceGroupName, string networkTapRuleName) + internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string networkTapRuleName, UpdateAdministrativeStateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -686,10 +678,14 @@ internal HttpMessage CreateResyncRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTapRules/", false); uri.AppendPath(networkTapRuleName, true); - uri.AppendPath("/resync", false); + uri.AppendPath("/updateAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } @@ -698,16 +694,18 @@ internal HttpMessage CreateResyncRequest(string subscriptionId, string resourceG /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Tap Rule. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task ResyncAsync(string subscriptionId, string resourceGroupName, string networkTapRuleName, CancellationToken cancellationToken = default) + public async Task UpdateAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string networkTapRuleName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkTapRuleName, nameof(networkTapRuleName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateResyncRequest(subscriptionId, resourceGroupName, networkTapRuleName); + using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, networkTapRuleName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -723,16 +721,18 @@ public async Task ResyncAsync(string subscriptionId, string resourceGr /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Tap Rule. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Resync(string subscriptionId, string resourceGroupName, string networkTapRuleName, CancellationToken cancellationToken = default) + public Response UpdateAdministrativeState(string subscriptionId, string resourceGroupName, string networkTapRuleName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkTapRuleName, nameof(networkTapRuleName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateResyncRequest(subscriptionId, resourceGroupName, networkTapRuleName); + using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, networkTapRuleName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -830,7 +830,7 @@ public Response ValidateConfiguration(string subscriptionId, string resourceGrou } } - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -838,7 +838,7 @@ internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string ne return uri; } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -852,28 +852,26 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// List all the Network Tap Rule resources in the given resource group. + /// List all the Network Tap Rule resources in the given subscription. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkTapRulesListResult value = default; + NetworkTapRuleListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkTapRulesListResult.DeserializeNetworkTapRulesListResult(document.RootElement); + value = NetworkTapRuleListResult.DeserializeNetworkTapRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -881,28 +879,26 @@ public async Task> ListByResourceGroupNextPa } } - /// List all the Network Tap Rule resources in the given resource group. + /// List all the Network Tap Rule resources in the given subscription. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkTapRulesListResult value = default; + NetworkTapRuleListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkTapRulesListResult.DeserializeNetworkTapRulesListResult(document.RootElement); + value = NetworkTapRuleListResult.DeserializeNetworkTapRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -910,7 +906,7 @@ public Response ListByResourceGroupNextPage(string ne } } - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -918,7 +914,7 @@ internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nex return uri; } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -932,26 +928,28 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st return message; } - /// List all the Network Tap Rule resources in the given subscription. + /// List all the Network Tap Rule resources in the given resource group. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkTapRulesListResult value = default; + NetworkTapRuleListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkTapRulesListResult.DeserializeNetworkTapRulesListResult(document.RootElement); + value = NetworkTapRuleListResult.DeserializeNetworkTapRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -959,26 +957,28 @@ public async Task> ListBySubscriptionNextPag } } - /// List all the Network Tap Rule resources in the given subscription. + /// List all the Network Tap Rule resources in the given resource group. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkTapRulesListResult value = default; + NetworkTapRuleListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkTapRulesListResult.DeserializeNetworkTapRulesListResult(document.RootElement); + value = NetworkTapRuleListResult.DeserializeNetworkTapRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkTapsRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkTapsRestOperations.cs index 348a378732a7..c7f0b36358ff 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkTapsRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkTapsRestOperations.cs @@ -32,103 +32,89 @@ public NetworkTapsRestOperations(HttpPipeline pipeline, string applicationId, Ur { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkTapName, NetworkTapData data) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps/", false); - uri.AppendPath(networkTapName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkTapName, NetworkTapData data) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps/", false); - uri.AppendPath(networkTapName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Creates a Network Tap. + /// Displays Network Taps list by subscription GET method. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Name of the Network Tap. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkTapName, NetworkTapData data, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(networkTapName, nameof(networkTapName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkTapName, data); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NetworkTapListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkTapListResult.DeserializeNetworkTapListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Creates a Network Tap. + /// Displays Network Taps list by subscription GET method. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Name of the Network Tap. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string networkTapName, NetworkTapData data, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(networkTapName, nameof(networkTapName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkTapName, data); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NetworkTapListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkTapListResult.DeserializeNetworkTapListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string networkTapName) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -136,13 +122,12 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps/", false); - uri.AppendPath(networkTapName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string networkTapName) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -153,8 +138,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps/", false); - uri.AppendPath(networkTapName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -162,69 +146,61 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Retrieves details of this Network Tap. + /// Displays Network Taps list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Network Tap. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string networkTapName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(networkTapName, nameof(networkTapName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, networkTapName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkTapData value = default; + NetworkTapListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkTapData.DeserializeNetworkTapData(document.RootElement); + value = NetworkTapListResult.DeserializeNetworkTapListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((NetworkTapData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Retrieves details of this Network Tap. + /// Displays Network Taps list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Network Tap. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string networkTapName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(networkTapName, nameof(networkTapName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, networkTapName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkTapData value = default; + NetworkTapListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkTapData.DeserializeNetworkTapData(document.RootElement); + value = NetworkTapListResult.DeserializeNetworkTapListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((NetworkTapData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string networkTapName, NetworkTapPatch patch) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string networkTapName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -238,11 +214,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string networkTapName, NetworkTapPatch patch) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string networkTapName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -254,69 +230,73 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// API to update certain properties of the Network Tap resource. + /// Retrieves details of this Network Tap. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Tap. - /// Network Tap properties to update. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string networkTapName, NetworkTapPatch patch, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string networkTapName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkTapName, nameof(networkTapName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkTapName, patch); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, networkTapName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + NetworkTapData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkTapData.DeserializeNetworkTapData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkTapData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// API to update certain properties of the Network Tap resource. + /// Retrieves details of this Network Tap. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Tap. - /// Network Tap properties to update. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string networkTapName, NetworkTapPatch patch, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string networkTapName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkTapName, nameof(networkTapName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkTapName, patch); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, networkTapName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + NetworkTapData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkTapData.DeserializeNetworkTapData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkTapData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string networkTapName) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkTapName, NetworkTapData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -330,11 +310,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string networkTapName) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkTapName, NetworkTapData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -346,61 +326,69 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Deletes Network Tap. + /// Creates a Network Tap. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Tap. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string networkTapName, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkTapName, NetworkTapData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkTapName, nameof(networkTapName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkTapName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkTapName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 202: - case 204: + case 200: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Deletes Network Tap. + /// Creates a Network Tap. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Tap. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string networkTapName, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string networkTapName, NetworkTapData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkTapName, nameof(networkTapName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkTapName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkTapName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 202: - case 204: + case 200: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string networkTapName, NetworkTapPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -408,105 +396,117 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps/", false); + uri.AppendPath(networkTapName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string networkTapName, NetworkTapPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps/", false); + uri.AppendPath(networkTapName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Displays Network Taps list by resource group GET method. + /// API to update certain properties of the Network Tap resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Network Tap. + /// Network Tap properties to update. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string networkTapName, NetworkTapPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkTapName, nameof(networkTapName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkTapName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - NetworkTapsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkTapsListResult.DeserializeNetworkTapsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Displays Network Taps list by resource group GET method. + /// API to update certain properties of the Network Tap resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Network Tap. + /// Network Tap properties to update. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string networkTapName, NetworkTapPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkTapName, nameof(networkTapName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkTapName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - NetworkTapsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkTapsListResult.DeserializeNetworkTapsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string networkTapName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps/", false); + uri.AppendPath(networkTapName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string networkTapName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps/", false); + uri.AppendPath(networkTapName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -514,57 +514,57 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) return message; } - /// Displays Network Taps list by subscription GET method. + /// Deletes Network Tap. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Tap. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string networkTapName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkTapName, nameof(networkTapName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkTapName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - NetworkTapsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkTapsListResult.DeserializeNetworkTapsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Displays Network Taps list by subscription GET method. + /// Deletes Network Tap. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Network Tap. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string networkTapName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(networkTapName, nameof(networkTapName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkTapName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - NetworkTapsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkTapsListResult.DeserializeNetworkTapsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string networkTapName, UpdateAdministrativeStateContent content) + internal RequestUriBuilder CreateResyncRequestUri(string subscriptionId, string resourceGroupName, string networkTapName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -574,12 +574,12 @@ internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subs uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps/", false); uri.AppendPath(networkTapName, true); - uri.AppendPath("/updateAdministrativeState", false); + uri.AppendPath("/resync", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string networkTapName, UpdateAdministrativeStateContent content) + internal HttpMessage CreateResyncRequest(string subscriptionId, string resourceGroupName, string networkTapName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -592,14 +592,10 @@ internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionI uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps/", false); uri.AppendPath(networkTapName, true); - uri.AppendPath("/updateAdministrativeState", false); + uri.AppendPath("/resync", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; _userAgent.Apply(message); return message; } @@ -608,18 +604,16 @@ internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionI /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Tap. - /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string networkTapName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public async Task ResyncAsync(string subscriptionId, string resourceGroupName, string networkTapName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkTapName, nameof(networkTapName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, networkTapName, content); + using var message = CreateResyncRequest(subscriptionId, resourceGroupName, networkTapName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -635,18 +629,16 @@ public async Task UpdateAdministrativeStateAsync(string subscriptionId /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Tap. - /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response UpdateAdministrativeState(string subscriptionId, string resourceGroupName, string networkTapName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public Response Resync(string subscriptionId, string resourceGroupName, string networkTapName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkTapName, nameof(networkTapName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, networkTapName, content); + using var message = CreateResyncRequest(subscriptionId, resourceGroupName, networkTapName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -658,7 +650,7 @@ public Response UpdateAdministrativeState(string subscriptionId, string resource } } - internal RequestUriBuilder CreateResyncRequestUri(string subscriptionId, string resourceGroupName, string networkTapName) + internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string networkTapName, UpdateAdministrativeStateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -668,12 +660,12 @@ internal RequestUriBuilder CreateResyncRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps/", false); uri.AppendPath(networkTapName, true); - uri.AppendPath("/resync", false); + uri.AppendPath("/updateAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateResyncRequest(string subscriptionId, string resourceGroupName, string networkTapName) + internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string networkTapName, UpdateAdministrativeStateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -686,10 +678,14 @@ internal HttpMessage CreateResyncRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkTaps/", false); uri.AppendPath(networkTapName, true); - uri.AppendPath("/resync", false); + uri.AppendPath("/updateAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } @@ -698,16 +694,18 @@ internal HttpMessage CreateResyncRequest(string subscriptionId, string resourceG /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Tap. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task ResyncAsync(string subscriptionId, string resourceGroupName, string networkTapName, CancellationToken cancellationToken = default) + public async Task UpdateAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string networkTapName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkTapName, nameof(networkTapName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateResyncRequest(subscriptionId, resourceGroupName, networkTapName); + using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, networkTapName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -723,16 +721,18 @@ public async Task ResyncAsync(string subscriptionId, string resourceGr /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Tap. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Resync(string subscriptionId, string resourceGroupName, string networkTapName, CancellationToken cancellationToken = default) + public Response UpdateAdministrativeState(string subscriptionId, string resourceGroupName, string networkTapName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkTapName, nameof(networkTapName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateResyncRequest(subscriptionId, resourceGroupName, networkTapName); + using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, networkTapName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -744,7 +744,7 @@ public Response Resync(string subscriptionId, string resourceGroupName, string n } } - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -752,7 +752,7 @@ internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string ne return uri; } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -766,28 +766,26 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// Displays Network Taps list by resource group GET method. + /// Displays Network Taps list by subscription GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkTapsListResult value = default; + NetworkTapListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkTapsListResult.DeserializeNetworkTapsListResult(document.RootElement); + value = NetworkTapListResult.DeserializeNetworkTapListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -795,28 +793,26 @@ public async Task> ListByResourceGroupNextPageAs } } - /// Displays Network Taps list by resource group GET method. + /// Displays Network Taps list by subscription GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkTapsListResult value = default; + NetworkTapListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkTapsListResult.DeserializeNetworkTapsListResult(document.RootElement); + value = NetworkTapListResult.DeserializeNetworkTapListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -824,7 +820,7 @@ public Response ListByResourceGroupNextPage(string nextLi } } - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -832,7 +828,7 @@ internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nex return uri; } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -846,26 +842,28 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st return message; } - /// Displays Network Taps list by subscription GET method. + /// Displays Network Taps list by resource group GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkTapsListResult value = default; + NetworkTapListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkTapsListResult.DeserializeNetworkTapsListResult(document.RootElement); + value = NetworkTapListResult.DeserializeNetworkTapListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -873,26 +871,28 @@ public async Task> ListBySubscriptionNextPageAsy } } - /// Displays Network Taps list by subscription GET method. + /// Displays Network Taps list by resource group GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkTapsListResult value = default; + NetworkTapListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkTapsListResult.DeserializeNetworkTapsListResult(document.RootElement); + value = NetworkTapListResult.DeserializeNetworkTapListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkToNetworkInterconnectsRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkToNetworkInterconnectsRestOperations.cs index 278e33705262..c0f279e31859 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkToNetworkInterconnectsRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/NetworkToNetworkInterconnectsRestOperations.cs @@ -32,11 +32,11 @@ public NetworkToNetworkInterconnectsRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NetworkToNetworkInterconnectData data) + internal RequestUriBuilder CreateListByNetworkFabricRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -46,17 +46,16 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/networkToNetworkInterconnects/", false); - uri.AppendPath(networkToNetworkInterconnectName, true); + uri.AppendPath("/networkToNetworkInterconnects", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NetworkToNetworkInterconnectData data) + internal HttpMessage CreateListByNetworkFabricRequest(string subscriptionId, string resourceGroupName, string networkFabricName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -65,72 +64,67 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/networkToNetworkInterconnects/", false); - uri.AppendPath(networkToNetworkInterconnectName, true); + uri.AppendPath("/networkToNetworkInterconnects", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Configuration used to setup CE-PE connectivity PUT Method. + /// Implements Network To Network Interconnects list by Network Fabric GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. - /// Name of the Network to Network Interconnect. - /// Request payload. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NetworkToNetworkInterconnectData data, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByNetworkFabricAsync(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); - Argument.AssertNotNullOrEmpty(networkToNetworkInterconnectName, nameof(networkToNetworkInterconnectName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, data); + using var message = CreateListByNetworkFabricRequest(subscriptionId, resourceGroupName, networkFabricName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NetworkToNetworkInterconnectListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkToNetworkInterconnectListResult.DeserializeNetworkToNetworkInterconnectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Configuration used to setup CE-PE connectivity PUT Method. + /// Implements Network To Network Interconnects list by Network Fabric GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. - /// Name of the Network to Network Interconnect. - /// Request payload. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NetworkToNetworkInterconnectData data, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByNetworkFabric(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); - Argument.AssertNotNullOrEmpty(networkToNetworkInterconnectName, nameof(networkToNetworkInterconnectName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, data); + using var message = CreateListByNetworkFabricRequest(subscriptionId, resourceGroupName, networkFabricName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + NetworkToNetworkInterconnectListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkToNetworkInterconnectListResult.DeserializeNetworkToNetworkInterconnectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -240,7 +234,7 @@ public Response Get(string subscriptionId, str } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NetworkToNetworkInterconnectPatch patch) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NetworkToNetworkInterconnectData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -256,11 +250,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NetworkToNetworkInterconnectPatch patch) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NetworkToNetworkInterconnectData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -276,71 +270,71 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; } - /// Update certain properties of the Network To NetworkInterconnects resource. + /// Configuration used to setup CE-PE connectivity PUT Method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. /// Name of the Network to Network Interconnect. - /// Network to Network Interconnect properties to update. + /// Request payload. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NetworkToNetworkInterconnectPatch patch, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NetworkToNetworkInterconnectData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); Argument.AssertNotNullOrEmpty(networkToNetworkInterconnectName, nameof(networkToNetworkInterconnectName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Update certain properties of the Network To NetworkInterconnects resource. + /// Configuration used to setup CE-PE connectivity PUT Method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. /// Name of the Network to Network Interconnect. - /// Network to Network Interconnect properties to update. + /// Request payload. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NetworkToNetworkInterconnectPatch patch, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NetworkToNetworkInterconnectData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); Argument.AssertNotNullOrEmpty(networkToNetworkInterconnectName, nameof(networkToNetworkInterconnectName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, patch); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NetworkToNetworkInterconnectPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -356,11 +350,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NetworkToNetworkInterconnectPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -374,65 +368,73 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Implements NetworkToNetworkInterconnects DELETE method. + /// Update certain properties of the Network To NetworkInterconnects resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. /// Name of the Network to Network Interconnect. + /// Network to Network Interconnect properties to update. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NetworkToNetworkInterconnectPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); Argument.AssertNotNullOrEmpty(networkToNetworkInterconnectName, nameof(networkToNetworkInterconnectName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements NetworkToNetworkInterconnects DELETE method. + /// Update certain properties of the Network To NetworkInterconnects resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. /// Name of the Network to Network Interconnect. + /// Network to Network Interconnect properties to update. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NetworkToNetworkInterconnectPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); Argument.AssertNotNullOrEmpty(networkToNetworkInterconnectName, nameof(networkToNetworkInterconnectName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByNetworkFabricRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -442,16 +444,17 @@ internal RequestUriBuilder CreateListByNetworkFabricRequestUri(string subscripti uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/networkToNetworkInterconnects", false); + uri.AppendPath("/networkToNetworkInterconnects/", false); + uri.AppendPath(networkToNetworkInterconnectName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByNetworkFabricRequest(string subscriptionId, string resourceGroupName, string networkFabricName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -460,7 +463,8 @@ internal HttpMessage CreateListByNetworkFabricRequest(string subscriptionId, str uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/networkFabrics/", false); uri.AppendPath(networkFabricName, true); - uri.AppendPath("/networkToNetworkInterconnects", false); + uri.AppendPath("/networkToNetworkInterconnects/", false); + uri.AppendPath(networkToNetworkInterconnectName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -468,65 +472,61 @@ internal HttpMessage CreateListByNetworkFabricRequest(string subscriptionId, str return message; } - /// Implements Network To Network Interconnects list by Network Fabric GET method. + /// Implements NetworkToNetworkInterconnects DELETE method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. + /// Name of the Network to Network Interconnect. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByNetworkFabricAsync(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); + Argument.AssertNotNullOrEmpty(networkToNetworkInterconnectName, nameof(networkToNetworkInterconnectName)); - using var message = CreateListByNetworkFabricRequest(subscriptionId, resourceGroupName, networkFabricName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - NetworkToNetworkInterconnectsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkToNetworkInterconnectsList.DeserializeNetworkToNetworkInterconnectsList(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements Network To Network Interconnects list by Network Fabric GET method. + /// Implements NetworkToNetworkInterconnects DELETE method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. + /// Name of the Network to Network Interconnect. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByNetworkFabric(string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(networkFabricName, nameof(networkFabricName)); + Argument.AssertNotNullOrEmpty(networkToNetworkInterconnectName, nameof(networkToNetworkInterconnectName)); - using var message = CreateListByNetworkFabricRequest(subscriptionId, resourceGroupName, networkFabricName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - NetworkToNetworkInterconnectsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkToNetworkInterconnectsList.DeserializeNetworkToNetworkInterconnectsList(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateNpbStaticRouteBfdAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, UpdateAdministrativeStateContent content) + internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, UpdateAdministrativeStateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -538,12 +538,12 @@ internal RequestUriBuilder CreateUpdateNpbStaticRouteBfdAdministrativeStateReque uri.AppendPath(networkFabricName, true); uri.AppendPath("/networkToNetworkInterconnects/", false); uri.AppendPath(networkToNetworkInterconnectName, true); - uri.AppendPath("/updateNpbStaticRouteBfdAdministrativeState", false); + uri.AppendPath("/updateAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateNpbStaticRouteBfdAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, UpdateAdministrativeStateContent content) + internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, UpdateAdministrativeStateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -558,7 +558,7 @@ internal HttpMessage CreateUpdateNpbStaticRouteBfdAdministrativeStateRequest(str uri.AppendPath(networkFabricName, true); uri.AppendPath("/networkToNetworkInterconnects/", false); uri.AppendPath(networkToNetworkInterconnectName, true); - uri.AppendPath("/updateNpbStaticRouteBfdAdministrativeState", false); + uri.AppendPath("/updateAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -570,7 +570,7 @@ internal HttpMessage CreateUpdateNpbStaticRouteBfdAdministrativeStateRequest(str return message; } - /// Updates the NPB Static Route BFD Administrative State. + /// Updates the Admin State. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. @@ -579,7 +579,7 @@ internal HttpMessage CreateUpdateNpbStaticRouteBfdAdministrativeStateRequest(str /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateNpbStaticRouteBfdAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public async Task UpdateAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -587,7 +587,7 @@ public async Task UpdateNpbStaticRouteBfdAdministrativeStateAsync(stri Argument.AssertNotNullOrEmpty(networkToNetworkInterconnectName, nameof(networkToNetworkInterconnectName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateNpbStaticRouteBfdAdministrativeStateRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, content); + using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -599,7 +599,7 @@ public async Task UpdateNpbStaticRouteBfdAdministrativeStateAsync(stri } } - /// Updates the NPB Static Route BFD Administrative State. + /// Updates the Admin State. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Network Fabric. @@ -608,7 +608,7 @@ public async Task UpdateNpbStaticRouteBfdAdministrativeStateAsync(stri /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response UpdateNpbStaticRouteBfdAdministrativeState(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public Response UpdateAdministrativeState(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -616,7 +616,7 @@ public Response UpdateNpbStaticRouteBfdAdministrativeState(string subscriptionId Argument.AssertNotNullOrEmpty(networkToNetworkInterconnectName, nameof(networkToNetworkInterconnectName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateNpbStaticRouteBfdAdministrativeStateRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, content); + using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -628,7 +628,7 @@ public Response UpdateNpbStaticRouteBfdAdministrativeState(string subscriptionId } } - internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, UpdateAdministrativeStateContent content) + internal RequestUriBuilder CreateUpdateBfdAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NniBfdAdministrativeStateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -640,12 +640,12 @@ internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subs uri.AppendPath(networkFabricName, true); uri.AppendPath("/networkToNetworkInterconnects/", false); uri.AppendPath(networkToNetworkInterconnectName, true); - uri.AppendPath("/updateAdministrativeState", false); + uri.AppendPath("/updateBfdAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, UpdateAdministrativeStateContent content) + internal HttpMessage CreateUpdateBfdAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NniBfdAdministrativeStateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -660,7 +660,7 @@ internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionI uri.AppendPath(networkFabricName, true); uri.AppendPath("/networkToNetworkInterconnects/", false); uri.AppendPath(networkToNetworkInterconnectName, true); - uri.AppendPath("/updateAdministrativeState", false); + uri.AppendPath("/updateBfdAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -681,7 +681,7 @@ internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionI /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public async Task UpdateBfdAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NniBfdAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -689,7 +689,7 @@ public async Task UpdateAdministrativeStateAsync(string subscriptionId Argument.AssertNotNullOrEmpty(networkToNetworkInterconnectName, nameof(networkToNetworkInterconnectName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, content); + using var message = CreateUpdateBfdAdministrativeStateRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -710,7 +710,7 @@ public async Task UpdateAdministrativeStateAsync(string subscriptionId /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response UpdateAdministrativeState(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public Response UpdateBfdAdministrativeState(string subscriptionId, string resourceGroupName, string networkFabricName, string networkToNetworkInterconnectName, NniBfdAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -718,7 +718,7 @@ public Response UpdateAdministrativeState(string subscriptionId, string resource Argument.AssertNotNullOrEmpty(networkToNetworkInterconnectName, nameof(networkToNetworkInterconnectName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, content); + using var message = CreateUpdateBfdAdministrativeStateRequest(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -760,7 +760,7 @@ internal HttpMessage CreateListByNetworkFabricNextPageRequest(string nextLink, s /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByNetworkFabricNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) + public async Task> ListByNetworkFabricNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -773,9 +773,9 @@ public async Task> ListByNetworkFabr { case 200: { - NetworkToNetworkInterconnectsList value = default; + NetworkToNetworkInterconnectListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkToNetworkInterconnectsList.DeserializeNetworkToNetworkInterconnectsList(document.RootElement); + value = NetworkToNetworkInterconnectListResult.DeserializeNetworkToNetworkInterconnectListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -791,7 +791,7 @@ public async Task> ListByNetworkFabr /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListByNetworkFabricNextPage(string nextLink, string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) + public Response ListByNetworkFabricNextPage(string nextLink, string subscriptionId, string resourceGroupName, string networkFabricName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -804,9 +804,9 @@ public Response ListByNetworkFabricNextPage(s { case 200: { - NetworkToNetworkInterconnectsList value = default; + NetworkToNetworkInterconnectListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkToNetworkInterconnectsList.DeserializeNetworkToNetworkInterconnectsList(document.RootElement); + value = NetworkToNetworkInterconnectListResult.DeserializeNetworkToNetworkInterconnectListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/RoutePoliciesRestOperations.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/RoutePoliciesRestOperations.cs index 7a5c2bb363b4..b977a045dc51 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/RoutePoliciesRestOperations.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/RestOperations/RoutePoliciesRestOperations.cs @@ -32,103 +32,89 @@ public RoutePoliciesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-15"; + _apiVersion = apiVersion ?? "2024-06-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string routePolicyName, NetworkFabricRoutePolicyData data) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies/", false); - uri.AppendPath(routePolicyName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string routePolicyName, NetworkFabricRoutePolicyData data) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies/", false); - uri.AppendPath(routePolicyName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Implements Route Policy PUT method. + /// Implements RoutePolicies list by subscription GET method. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Name of the Route Policy. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string routePolicyName, NetworkFabricRoutePolicyData data, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(routePolicyName, nameof(routePolicyName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, routePolicyName, data); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + RoutePolicyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = RoutePolicyListResult.DeserializeRoutePolicyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Implements Route Policy PUT method. + /// Implements RoutePolicies list by subscription GET method. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Name of the Route Policy. - /// Request payload. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string routePolicyName, NetworkFabricRoutePolicyData data, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(routePolicyName, nameof(routePolicyName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, routePolicyName, data); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + RoutePolicyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = RoutePolicyListResult.DeserializeRoutePolicyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string routePolicyName) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -136,13 +122,12 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies/", false); - uri.AppendPath(routePolicyName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string routePolicyName) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -153,8 +138,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies/", false); - uri.AppendPath(routePolicyName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -162,69 +146,61 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Implements Route Policy GET method. + /// Implements RoutePolicies list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Route Policy. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string routePolicyName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(routePolicyName, nameof(routePolicyName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, routePolicyName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NetworkFabricRoutePolicyData value = default; + RoutePolicyListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkFabricRoutePolicyData.DeserializeNetworkFabricRoutePolicyData(document.RootElement); + value = RoutePolicyListResult.DeserializeRoutePolicyListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((NetworkFabricRoutePolicyData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Implements Route Policy GET method. + /// Implements RoutePolicies list by resource group GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of the Route Policy. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string routePolicyName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(routePolicyName, nameof(routePolicyName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, routePolicyName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NetworkFabricRoutePolicyData value = default; + RoutePolicyListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkFabricRoutePolicyData.DeserializeNetworkFabricRoutePolicyData(document.RootElement); + value = RoutePolicyListResult.DeserializeRoutePolicyListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((NetworkFabricRoutePolicyData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string routePolicyName, NetworkFabricRoutePolicyPatch patch) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string routePolicyName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -238,11 +214,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string routePolicyName, NetworkFabricRoutePolicyPatch patch) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string routePolicyName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -254,69 +230,73 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// API to update certain properties of the Route Policy resource. + /// Implements Route Policy GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Route Policy. - /// Route Policy properties to update. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string routePolicyName, NetworkFabricRoutePolicyPatch patch, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string routePolicyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(routePolicyName, nameof(routePolicyName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, routePolicyName, patch); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, routePolicyName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + NetworkFabricRoutePolicyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkFabricRoutePolicyData.DeserializeNetworkFabricRoutePolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkFabricRoutePolicyData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// API to update certain properties of the Route Policy resource. + /// Implements Route Policy GET method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Route Policy. - /// Route Policy properties to update. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string routePolicyName, NetworkFabricRoutePolicyPatch patch, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string routePolicyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(routePolicyName, nameof(routePolicyName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, routePolicyName, patch); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, routePolicyName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + NetworkFabricRoutePolicyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkFabricRoutePolicyData.DeserializeNetworkFabricRoutePolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkFabricRoutePolicyData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string routePolicyName) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string routePolicyName, NetworkFabricRoutePolicyData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -330,11 +310,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string routePolicyName) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string routePolicyName, NetworkFabricRoutePolicyData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -346,61 +326,69 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Implements Route Policy DELETE method. + /// Implements Route Policy PUT method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Route Policy. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string routePolicyName, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string routePolicyName, NetworkFabricRoutePolicyData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(routePolicyName, nameof(routePolicyName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, routePolicyName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, routePolicyName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 202: - case 204: + case 200: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements Route Policy DELETE method. + /// Implements Route Policy PUT method. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Route Policy. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string routePolicyName, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string routePolicyName, NetworkFabricRoutePolicyData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(routePolicyName, nameof(routePolicyName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, routePolicyName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, routePolicyName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 202: - case 204: + case 200: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string routePolicyName, NetworkFabricRoutePolicyPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -408,105 +396,117 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies/", false); + uri.AppendPath(routePolicyName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string routePolicyName, NetworkFabricRoutePolicyPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies", false); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies/", false); + uri.AppendPath(routePolicyName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Implements RoutePolicies list by resource group GET method. + /// API to update certain properties of the Route Policy resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Route Policy. + /// Route Policy properties to update. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string routePolicyName, NetworkFabricRoutePolicyPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(routePolicyName, nameof(routePolicyName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, routePolicyName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - RoutePoliciesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = RoutePoliciesListResult.DeserializeRoutePoliciesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements RoutePolicies list by resource group GET method. + /// API to update certain properties of the Route Policy resource. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of the Route Policy. + /// Route Policy properties to update. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string routePolicyName, NetworkFabricRoutePolicyPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(routePolicyName, nameof(routePolicyName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, routePolicyName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - RoutePoliciesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = RoutePoliciesListResult.DeserializeRoutePoliciesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string routePolicyName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies/", false); + uri.AppendPath(routePolicyName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string routePolicyName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies/", false); + uri.AppendPath(routePolicyName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -514,57 +514,57 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) return message; } - /// Implements RoutePolicies list by subscription GET method. + /// Implements Route Policy DELETE method. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Route Policy. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string routePolicyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(routePolicyName, nameof(routePolicyName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, routePolicyName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - RoutePoliciesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = RoutePoliciesListResult.DeserializeRoutePoliciesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Implements RoutePolicies list by subscription GET method. + /// Implements Route Policy DELETE method. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Route Policy. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string routePolicyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(routePolicyName, nameof(routePolicyName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, routePolicyName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - RoutePoliciesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = RoutePoliciesListResult.DeserializeRoutePoliciesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string routePolicyName, UpdateAdministrativeStateContent content) + internal RequestUriBuilder CreateCommitConfigurationRequestUri(string subscriptionId, string resourceGroupName, string routePolicyName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -574,12 +574,12 @@ internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subs uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies/", false); uri.AppendPath(routePolicyName, true); - uri.AppendPath("/updateAdministrativeState", false); + uri.AppendPath("/commitConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string routePolicyName, UpdateAdministrativeStateContent content) + internal HttpMessage CreateCommitConfigurationRequest(string subscriptionId, string resourceGroupName, string routePolicyName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -592,34 +592,28 @@ internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionI uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies/", false); uri.AppendPath(routePolicyName, true); - uri.AppendPath("/updateAdministrativeState", false); + uri.AppendPath("/commitConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; _userAgent.Apply(message); return message; } - /// Updated the admin state for this Route Policy. + /// Commits the configuration of the given resources. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Route Policy. - /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string routePolicyName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public async Task CommitConfigurationAsync(string subscriptionId, string resourceGroupName, string routePolicyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(routePolicyName, nameof(routePolicyName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, routePolicyName, content); + using var message = CreateCommitConfigurationRequest(subscriptionId, resourceGroupName, routePolicyName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -631,22 +625,20 @@ public async Task UpdateAdministrativeStateAsync(string subscriptionId } } - /// Updated the admin state for this Route Policy. + /// Commits the configuration of the given resources. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Route Policy. - /// Request payload. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response UpdateAdministrativeState(string subscriptionId, string resourceGroupName, string routePolicyName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) + public Response CommitConfiguration(string subscriptionId, string resourceGroupName, string routePolicyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(routePolicyName, nameof(routePolicyName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, routePolicyName, content); + using var message = CreateCommitConfigurationRequest(subscriptionId, resourceGroupName, routePolicyName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -658,7 +650,7 @@ public Response UpdateAdministrativeState(string subscriptionId, string resource } } - internal RequestUriBuilder CreateValidateConfigurationRequestUri(string subscriptionId, string resourceGroupName, string routePolicyName) + internal RequestUriBuilder CreateUpdateAdministrativeStateRequestUri(string subscriptionId, string resourceGroupName, string routePolicyName, UpdateAdministrativeStateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -668,12 +660,12 @@ internal RequestUriBuilder CreateValidateConfigurationRequestUri(string subscrip uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies/", false); uri.AppendPath(routePolicyName, true); - uri.AppendPath("/validateConfiguration", false); + uri.AppendPath("/updateAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateValidateConfigurationRequest(string subscriptionId, string resourceGroupName, string routePolicyName) + internal HttpMessage CreateUpdateAdministrativeStateRequest(string subscriptionId, string resourceGroupName, string routePolicyName, UpdateAdministrativeStateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -686,28 +678,34 @@ internal HttpMessage CreateValidateConfigurationRequest(string subscriptionId, s uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies/", false); uri.AppendPath(routePolicyName, true); - uri.AppendPath("/validateConfiguration", false); + uri.AppendPath("/updateAdministrativeState", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Validates the configuration of the resources. + /// Updated the admin state for this Route Policy. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Route Policy. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task ValidateConfigurationAsync(string subscriptionId, string resourceGroupName, string routePolicyName, CancellationToken cancellationToken = default) + public async Task UpdateAdministrativeStateAsync(string subscriptionId, string resourceGroupName, string routePolicyName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(routePolicyName, nameof(routePolicyName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateValidateConfigurationRequest(subscriptionId, resourceGroupName, routePolicyName); + using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, routePolicyName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -719,20 +717,22 @@ public async Task ValidateConfigurationAsync(string subscriptionId, st } } - /// Validates the configuration of the resources. + /// Updated the admin state for this Route Policy. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Route Policy. + /// Request payload. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ValidateConfiguration(string subscriptionId, string resourceGroupName, string routePolicyName, CancellationToken cancellationToken = default) + public Response UpdateAdministrativeState(string subscriptionId, string resourceGroupName, string routePolicyName, UpdateAdministrativeStateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(routePolicyName, nameof(routePolicyName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateValidateConfigurationRequest(subscriptionId, resourceGroupName, routePolicyName); + using var message = CreateUpdateAdministrativeStateRequest(subscriptionId, resourceGroupName, routePolicyName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -744,7 +744,7 @@ public Response ValidateConfiguration(string subscriptionId, string resourceGrou } } - internal RequestUriBuilder CreateCommitConfigurationRequestUri(string subscriptionId, string resourceGroupName, string routePolicyName) + internal RequestUriBuilder CreateValidateConfigurationRequestUri(string subscriptionId, string resourceGroupName, string routePolicyName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -754,12 +754,12 @@ internal RequestUriBuilder CreateCommitConfigurationRequestUri(string subscripti uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies/", false); uri.AppendPath(routePolicyName, true); - uri.AppendPath("/commitConfiguration", false); + uri.AppendPath("/validateConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCommitConfigurationRequest(string subscriptionId, string resourceGroupName, string routePolicyName) + internal HttpMessage CreateValidateConfigurationRequest(string subscriptionId, string resourceGroupName, string routePolicyName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -772,7 +772,7 @@ internal HttpMessage CreateCommitConfigurationRequest(string subscriptionId, str uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ManagedNetworkFabric/routePolicies/", false); uri.AppendPath(routePolicyName, true); - uri.AppendPath("/commitConfiguration", false); + uri.AppendPath("/validateConfiguration", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -780,20 +780,20 @@ internal HttpMessage CreateCommitConfigurationRequest(string subscriptionId, str return message; } - /// Commits the configuration of the given resources. + /// Validates the configuration of the resources. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Route Policy. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task CommitConfigurationAsync(string subscriptionId, string resourceGroupName, string routePolicyName, CancellationToken cancellationToken = default) + public async Task ValidateConfigurationAsync(string subscriptionId, string resourceGroupName, string routePolicyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(routePolicyName, nameof(routePolicyName)); - using var message = CreateCommitConfigurationRequest(subscriptionId, resourceGroupName, routePolicyName); + using var message = CreateValidateConfigurationRequest(subscriptionId, resourceGroupName, routePolicyName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -805,20 +805,20 @@ public async Task CommitConfigurationAsync(string subscriptionId, stri } } - /// Commits the configuration of the given resources. + /// Validates the configuration of the resources. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Route Policy. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response CommitConfiguration(string subscriptionId, string resourceGroupName, string routePolicyName, CancellationToken cancellationToken = default) + public Response ValidateConfiguration(string subscriptionId, string resourceGroupName, string routePolicyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(routePolicyName, nameof(routePolicyName)); - using var message = CreateCommitConfigurationRequest(subscriptionId, resourceGroupName, routePolicyName); + using var message = CreateValidateConfigurationRequest(subscriptionId, resourceGroupName, routePolicyName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -830,7 +830,7 @@ public Response CommitConfiguration(string subscriptionId, string resourceGroupN } } - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -838,7 +838,7 @@ internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string ne return uri; } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -852,28 +852,26 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// Implements RoutePolicies list by resource group GET method. + /// Implements RoutePolicies list by subscription GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - RoutePoliciesListResult value = default; + RoutePolicyListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = RoutePoliciesListResult.DeserializeRoutePoliciesListResult(document.RootElement); + value = RoutePolicyListResult.DeserializeRoutePolicyListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -881,28 +879,26 @@ public async Task> ListByResourceGroupNextPage } } - /// Implements RoutePolicies list by resource group GET method. + /// Implements RoutePolicies list by subscription GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - RoutePoliciesListResult value = default; + RoutePolicyListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = RoutePoliciesListResult.DeserializeRoutePoliciesListResult(document.RootElement); + value = RoutePolicyListResult.DeserializeRoutePolicyListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -910,7 +906,7 @@ public Response ListByResourceGroupNextPage(string next } } - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -918,7 +914,7 @@ internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nex return uri; } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -932,26 +928,28 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st return message; } - /// Implements RoutePolicies list by subscription GET method. + /// Implements RoutePolicies list by resource group GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - RoutePoliciesListResult value = default; + RoutePolicyListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = RoutePoliciesListResult.DeserializeRoutePoliciesListResult(document.RootElement); + value = RoutePolicyListResult.DeserializeRoutePolicyListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -959,26 +957,28 @@ public async Task> ListBySubscriptionNextPageA } } - /// Implements RoutePolicies list by subscription GET method. + /// Implements RoutePolicies list by resource group GET method. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - RoutePoliciesListResult value = default; + RoutePolicyListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = RoutePoliciesListResult.DeserializeRoutePoliciesListResult(document.RootElement); + value = RoutePolicyListResult.DeserializeRoutePolicyListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/autorest.md b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/autorest.md index 3407634d9f09..81cd090b6273 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/autorest.md +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/autorest.md @@ -7,8 +7,8 @@ azure-arm: true csharp: true library-name: Azure.ResourceManager.ManagedNetworkFabric namespace: Azure.ResourceManager.ManagedNetworkFabric -require: https://github.com/Azure/azure-rest-api-specs/blob/0baf811c3c76c87b3c127d098519bd97141222dd/specification/managednetworkfabric/resource-manager/readme.md -#tag: package-2023-06-15 +require: https://github.com/Azure/azure-rest-api-specs/blob/5476ceee2ed3364cdedec8e0d002d2e45389a8f0/specification/managednetworkfabric/resource-manager/readme.md +tag: package-2024-06-15-preview output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -62,18 +62,18 @@ acronym-mapping: rename-mapping: AccessControlList: NetworkFabricAccessControlList - AccessControlListsListResult: AccessControlListsResult ExternalNetwork: NetworkFabricExternalNetwork ExternalNetwork.properties.networkToNetworkInterconnectId: -|arm-id InternalNetwork: NetworkFabricInternalNetwork InternetGateway: NetworkFabricInternetGateway InternetGateway.properties.ipv4Address: IpV4Address InternetGatewayRule: NetworkFabricInternetGatewayRule - InternetGatewayRule.properties.internetGatewayIds: -|arm-id IpCommunity: NetworkFabricIpCommunity IpExtendedCommunity: NetworkFabricIpExtendedCommunity IpPrefix: NetworkFabricIpPrefix L2IsolationDomain: NetworkFabricL2IsolationDomain + ConnectedSubnetRoutePolicy.exportRoutePolicy: connectedExportRoutePolicy + ConnectedSubnetRoutePolicyPatch.exportRoutePolicy: connectedExportRoutePolicy L3IsolationDomain: NetworkFabricL3IsolationDomain NeighborGroup: NetworkFabricNeighborGroup NetworkDevice.properties.managementIpv4Address: -|ip-address @@ -81,9 +81,7 @@ rename-mapping: RoutePolicy: NetworkFabricRoutePolicy NetworkInterface: NetworkDeviceInterface Action: InternetGatewayRuleAction - AddressFamilyTypeL: NetworkFabricAddressFamilyType AdministrativeState: NetworkFabricAdministrativeState - AnnotationResource: AnnotationResourceProperties BooleanEnumProperty: NetworkFabricBooleanValue CommonPostActionResponseForDeviceUpdate: DeviceUpdateCommonPostActionResult CommonPostActionResponseForStateUpdate: StateUpdateCommonPostActionResult @@ -95,8 +93,6 @@ rename-mapping: DestinationType: NetworkTapDestinationType DeviceAdministrativeState: NetworkDeviceAdministrativeState DeviceInterfaceProperties: NetworkDeviceInterfaceProperties - EnableDisableOnResources: UpdateAdministrativeStateOnResources - EnableDisableOnResources.resourceIds: -|arm-id EnableDisableState: AdministrativeEnableState Encapsulation: IsolationDomainEncapsulationType EncapsulationType: NetworkTapEncapsulationType @@ -104,8 +100,6 @@ rename-mapping: Extension: StaticRouteConfigurationExtension ExternalNetworkPatchPropertiesOptionAProperties: ExternalNetworkPatchOptionAProperties ExternalNetworkPropertiesOptionAProperties: ExternalNetworkOptionAProperties - InternalNetworkPropertiesBgpConfiguration: InternalNetworkBgpConfiguration - InternalNetworkPropertiesStaticRouteConfiguration: InternalNetworkStaticRouteConfiguration IpCommunityIdList.ipCommunityIds: -|arm-id IpExtendedCommunityIdList.ipExtendedCommunityIds: -|arm-id GatewayType: InternetGatewayType @@ -115,11 +109,7 @@ rename-mapping: IPAddressType: NetworkFabricIPAddressType NeighborGroupDestination.ipv4Addresses: -|ip-address NetworkDevice.properties.networkRackId: -|arm-id - NetworkFabricController.properties.workloadManagementNetwork: IsWorkloadManagementNetwork NetworkInterfacePatch: NetworkDeviceInterfacePatch - NetworkInterfacesList: NetworkDeviceInterfacesList - NetworkTapRule.properties.networkTapId: -|arm-id - NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration: NetworkToNetworkInterconnectOptionBLayer3Configuration NfcSku: NetworkFabricControllerSKU PollingType: NetworkTapPollingType PortCondition: NetworkFabricPortCondition @@ -137,14 +127,37 @@ rename-mapping: ValidateAction: NetworkFabricValidateAction ValidateConfigurationProperties: ValidateConfigurationContent ValidateConfigurationResponse: ValidateConfigurationResult - VpnConfigurationPatchablePropertiesOptionAProperties: VpnConfigurationPatchableOptionAProperties - VpnConfigurationPropertiesOptionAProperties: VpnConfigurationOptionAProperties + CommitBatchStatusResponse: CommitBatchStatusResult + InternalNetworkBfdAdministrativeStateResponse: InternalNetworkBfdAdministrativeStateResult + InternalNetworkBgpAdministrativeStateResponse: InternalNetworkBgpAdministrativeStateResult + DiscardCommitBatchResponse: DiscardCommitBatchResult + ArmConfigurationDiffResponse: ArmConfigurationDiffResult + ExternalNetworkBfdAdministrativeStateResponse: ExternalNetworkBfdAdministrativeStateResult + NniBfdAdministrativeStateResponse: NniBfdAdministrativeStateResult + ViewDeviceConfigurationResponse: ViewDeviceConfigurationResult directive: - - from: NetworkFabricControllers.json + - from: managednetworkfabric.json where: $.definitions - transform: + transform: > + $.NetworkDevice.properties.properties["x-ms-client-flatten"] = true; + $.NetworkInterface.properties.properties["x-ms-client-flatten"] = true; + $.NetworkDeviceSku.properties.properties["x-ms-client-flatten"] = true; + $.AccessControlList.properties.properties["x-ms-client-flatten"] = true; + $.NetworkFabricController.properties.properties["x-ms-client-flatten"] = true; + $.NetworkFabric.properties.properties["x-ms-client-flatten"] = true; + $.ExternalNetwork.properties.properties["x-ms-client-flatten"] = true; + $.InternalNetwork.properties.properties["x-ms-client-flatten"] = true; + $.InternetGateway.properties.properties["x-ms-client-flatten"] = true; + # change some properties back to optional to overcome some breaking changes + - from: managednetworkfabric.json + where: $.definitions + transform: > $.ExpressRouteConnectionInformation.required = [ 'expressRouteCircuitId' ]; + $.BgpConfiguration.required = undefined; + $.ExternalNetworkPropertiesOptionAProperties.required = undefined; + $.OptionBLayer3Configuration.required = undefined; + $.AccessControlListProperties.required = undefined; # Removing the operations that are not allowed for the end users. - remove-operation: InternetGateways_Delete - remove-operation: InternetGateways_Create diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceCollection.cs index 1c10eb5053c0..12966c2bf3fd 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkDeviceCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_NetworkDevicesCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDevices_Create.json // this example is just showing the usage of "NetworkDevices_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task CreateOrUpdate_NetworkDevicesCreateMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -40,15 +40,14 @@ public async Task CreateOrUpdate_NetworkDevicesCreateMaximumSetGen() // invoke the operation string networkDeviceName = "example-device"; - NetworkDeviceData data = new NetworkDeviceData(new AzureLocation("eastuseuap")) + NetworkDeviceData data = new NetworkDeviceData(new AzureLocation("eastuseuap"), "Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX") { Annotation = "annotation", HostName = "NFA-Device", - SerialNumber = "Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX", NetworkDeviceSku = "DeviceSku", Tags = { -["keyID"] = "KeyValue" +["KeyId"] = "KeyValue" }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, networkDeviceName, data); @@ -65,7 +64,7 @@ public async Task CreateOrUpdate_NetworkDevicesCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_NetworkDevicesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDevices_Get.json // this example is just showing the usage of "NetworkDevices_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -75,7 +74,7 @@ public async Task Get_NetworkDevicesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -98,7 +97,7 @@ public async Task Get_NetworkDevicesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_NetworkDevicesListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDevices_ListByResourceGroup.json // this example is just showing the usage of "NetworkDevices_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -108,7 +107,7 @@ public async Task GetAll_NetworkDevicesListByResourceGroupMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -133,7 +132,7 @@ public async Task GetAll_NetworkDevicesListByResourceGroupMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_NetworkDevicesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDevices_Get.json // this example is just showing the usage of "NetworkDevices_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -143,7 +142,7 @@ public async Task Exists_NetworkDevicesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -162,7 +161,7 @@ public async Task Exists_NetworkDevicesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_NetworkDevicesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDevices_Get.json // this example is just showing the usage of "NetworkDevices_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -172,7 +171,7 @@ public async Task GetIfExists_NetworkDevicesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceInterfaceCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceInterfaceCollection.cs index 7ab996b194a5..d7b480dac6a9 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceInterfaceCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceInterfaceCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_NetworkDeviceInterfaceCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_NetworkInterfacesCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkInterfaces_Create.json // this example is just showing the usage of "NetworkInterfaces_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -29,7 +29,7 @@ public async Task CreateOrUpdate_NetworkInterfacesCreateMaximumSetGen() // this example assumes you already have this NetworkDeviceResource created on azure // for more information of creating NetworkDeviceResource, please refer to the document of NetworkDeviceResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkDeviceName = "example-device"; ResourceIdentifier networkDeviceResourceId = NetworkDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkDeviceName); @@ -43,6 +43,8 @@ public async Task CreateOrUpdate_NetworkInterfacesCreateMaximumSetGen() NetworkDeviceInterfaceData data = new NetworkDeviceInterfaceData { Annotation = "annotation", + Description = "device 1", + AdditionalDescription = "device 1", }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, networkInterfaceName, data); NetworkDeviceInterfaceResource result = lro.Value; @@ -58,7 +60,7 @@ public async Task CreateOrUpdate_NetworkInterfacesCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_NetworkInterfacesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkInterfaces_Get.json // this example is just showing the usage of "NetworkInterfaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -68,7 +70,7 @@ public async Task Get_NetworkInterfacesGetMaximumSetGen() // this example assumes you already have this NetworkDeviceResource created on azure // for more information of creating NetworkDeviceResource, please refer to the document of NetworkDeviceResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkDeviceName = "example-device"; ResourceIdentifier networkDeviceResourceId = NetworkDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkDeviceName); @@ -92,7 +94,7 @@ public async Task Get_NetworkInterfacesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_NetworkInterfacesListByNetworkDeviceMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_ListByNetworkDevice_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkInterfaces_ListByNetworkDevice.json // this example is just showing the usage of "NetworkInterfaces_ListByNetworkDevice" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -102,7 +104,7 @@ public async Task GetAll_NetworkInterfacesListByNetworkDeviceMaximumSetGen() // this example assumes you already have this NetworkDeviceResource created on azure // for more information of creating NetworkDeviceResource, please refer to the document of NetworkDeviceResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkDeviceName = "example-device"; ResourceIdentifier networkDeviceResourceId = NetworkDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkDeviceName); @@ -128,7 +130,7 @@ public async Task GetAll_NetworkInterfacesListByNetworkDeviceMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_NetworkInterfacesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkInterfaces_Get.json // this example is just showing the usage of "NetworkInterfaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +140,7 @@ public async Task Exists_NetworkInterfacesGetMaximumSetGen() // this example assumes you already have this NetworkDeviceResource created on azure // for more information of creating NetworkDeviceResource, please refer to the document of NetworkDeviceResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkDeviceName = "example-device"; ResourceIdentifier networkDeviceResourceId = NetworkDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkDeviceName); @@ -158,7 +160,7 @@ public async Task Exists_NetworkInterfacesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_NetworkInterfacesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkInterfaces_Get.json // this example is just showing the usage of "NetworkInterfaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +170,7 @@ public async Task GetIfExists_NetworkInterfacesGetMaximumSetGen() // this example assumes you already have this NetworkDeviceResource created on azure // for more information of creating NetworkDeviceResource, please refer to the document of NetworkDeviceResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkDeviceName = "example-device"; ResourceIdentifier networkDeviceResourceId = NetworkDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkDeviceName); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceInterfaceResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceInterfaceResource.cs index 504d68fd0d94..4976e615e3e7 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceInterfaceResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceInterfaceResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkDeviceInterfaceResource [Ignore("Only validating compilation of examples")] public async Task Get_NetworkInterfacesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkInterfaces_Get.json // this example is just showing the usage of "NetworkInterfaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_NetworkInterfacesGetMaximumSetGen() // this example assumes you already have this NetworkDeviceInterfaceResource created on azure // for more information of creating NetworkDeviceInterfaceResource, please refer to the document of NetworkDeviceInterfaceResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkDeviceName = "example-device"; string networkInterfaceName = "example-interface"; @@ -51,7 +51,7 @@ public async Task Get_NetworkInterfacesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_NetworkInterfacesDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkInterfaces_Delete.json // this example is just showing the usage of "NetworkInterfaces_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,10 +61,10 @@ public async Task Delete_NetworkInterfacesDeleteMaximumSetGen() // this example assumes you already have this NetworkDeviceInterfaceResource created on azure // for more information of creating NetworkDeviceInterfaceResource, please refer to the document of NetworkDeviceInterfaceResource - string subscriptionId = "94D0FD57-C08B-4CA3-A926-6B76D8B7B956"; - string resourceGroupName = "rgNetworkDevices"; - string networkDeviceName = "sjzd"; - string networkInterfaceName = "emrgu"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; + string resourceGroupName = "example-rg"; + string networkDeviceName = "example-device"; + string networkInterfaceName = "example-interface"; ResourceIdentifier networkDeviceInterfaceResourceId = NetworkDeviceInterfaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkDeviceName, networkInterfaceName); NetworkDeviceInterfaceResource networkDeviceInterface = client.GetNetworkDeviceInterfaceResource(networkDeviceInterfaceResourceId); @@ -78,7 +78,7 @@ public async Task Delete_NetworkInterfacesDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_NetworkInterfacesUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkInterfaces_Update.json // this example is just showing the usage of "NetworkInterfaces_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task Update_NetworkInterfacesUpdateMaximumSetGen() // this example assumes you already have this NetworkDeviceInterfaceResource created on azure // for more information of creating NetworkDeviceInterfaceResource, please refer to the document of NetworkDeviceInterfaceResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkDeviceName = "example-device"; string networkInterfaceName = "example-interface"; @@ -98,7 +98,12 @@ public async Task Update_NetworkInterfacesUpdateMaximumSetGen() // invoke the operation NetworkDeviceInterfacePatch patch = new NetworkDeviceInterfacePatch { - Annotation = "annotation", + Properties = new NetworkInterfacePatchProperties + { + Annotation = "annotation", + Description = "device 1", + AdditionalDescription = "device 1", + }, }; ArmOperation lro = await networkDeviceInterface.UpdateAsync(WaitUntil.Completed, patch); NetworkDeviceInterfaceResource result = lro.Value; @@ -114,7 +119,7 @@ public async Task Update_NetworkInterfacesUpdateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task UpdateAdministrativeState_NetworkInterfacesUpdateAdministrativeStateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_UpdateAdministrativeState_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkInterfaces_UpdateAdministrativeState.json // this example is just showing the usage of "NetworkInterfaces_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +129,7 @@ public async Task UpdateAdministrativeState_NetworkInterfacesUpdateAdministrativ // this example assumes you already have this NetworkDeviceInterfaceResource created on azure // for more information of creating NetworkDeviceInterfaceResource, please refer to the document of NetworkDeviceInterfaceResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkDeviceName = "example-device"; string networkInterfaceName = "example-interface"; @@ -134,8 +139,8 @@ public async Task UpdateAdministrativeState_NetworkInterfacesUpdateAdministrativ // invoke the operation UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent { + ResourceIds = { "" }, State = AdministrativeEnableState.Enable, - ResourceIds = { new ResourceIdentifier("") }, }; ArmOperation lro = await networkDeviceInterface.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); StateUpdateCommonPostActionResult result = lro.Value; diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceResource.cs index 072a39012b6c..ee08d2536711 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkDeviceResource [Ignore("Only validating compilation of examples")] public async Task Get_NetworkDevicesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDevices_Get.json // this example is just showing the usage of "NetworkDevices_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_NetworkDevicesGetMaximumSetGen() // this example assumes you already have this NetworkDeviceResource created on azure // for more information of creating NetworkDeviceResource, please refer to the document of NetworkDeviceResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkDeviceName = "example-device"; ResourceIdentifier networkDeviceResourceId = NetworkDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkDeviceName); @@ -50,7 +50,7 @@ public async Task Get_NetworkDevicesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_NetworkDevicesDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDevices_Delete.json // this example is just showing the usage of "NetworkDevices_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task Delete_NetworkDevicesDeleteMaximumSetGen() // this example assumes you already have this NetworkDeviceResource created on azure // for more information of creating NetworkDeviceResource, please refer to the document of NetworkDeviceResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkDeviceName = "example-device"; ResourceIdentifier networkDeviceResourceId = NetworkDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkDeviceName); @@ -76,7 +76,7 @@ public async Task Delete_NetworkDevicesDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_NetworkDevicesUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDevices_Update.json // this example is just showing the usage of "NetworkDevices_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Update_NetworkDevicesUpdateMaximumSetGen() // this example assumes you already have this NetworkDeviceResource created on azure // for more information of creating NetworkDeviceResource, please refer to the document of NetworkDeviceResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkDeviceName = "example-device"; ResourceIdentifier networkDeviceResourceId = NetworkDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkDeviceName); @@ -95,13 +95,16 @@ public async Task Update_NetworkDevicesUpdateMaximumSetGen() // invoke the operation NetworkDevicePatch patch = new NetworkDevicePatch { - Annotation = "annotation", - HostName = "NFA-Device", - SerialNumber = "Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX", Tags = { -["keyID"] = "KeyValue" +["KeyId"] = "KeyValue" }, + Properties = new NetworkDevicePatchParametersProperties + { + Annotation = "annotation", + HostName = "NFA-Device", + SerialNumber = "Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX", + }, }; ArmOperation lro = await networkDevice.UpdateAsync(WaitUntil.Completed, patch); NetworkDeviceResource result = lro.Value; @@ -117,7 +120,7 @@ public async Task Update_NetworkDevicesUpdateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Reboot_NetworkDevicesRebootMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Reboot_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDevices_Reboot.json // this example is just showing the usage of "NetworkDevices_Reboot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +130,7 @@ public async Task Reboot_NetworkDevicesRebootMaximumSetGen() // this example assumes you already have this NetworkDeviceResource created on azure // for more information of creating NetworkDeviceResource, please refer to the document of NetworkDeviceResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkDeviceName = "example-device"; ResourceIdentifier networkDeviceResourceId = NetworkDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkDeviceName); @@ -148,7 +151,7 @@ public async Task Reboot_NetworkDevicesRebootMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task RefreshConfiguration_NetworkDevicesRefreshConfigurationMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_RefreshConfiguration_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDevices_RefreshConfiguration.json // this example is just showing the usage of "NetworkDevices_RefreshConfiguration" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -158,7 +161,7 @@ public async Task RefreshConfiguration_NetworkDevicesRefreshConfigurationMaximum // this example assumes you already have this NetworkDeviceResource created on azure // for more information of creating NetworkDeviceResource, please refer to the document of NetworkDeviceResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkDeviceName = "example-device"; ResourceIdentifier networkDeviceResourceId = NetworkDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkDeviceName); @@ -171,11 +174,73 @@ public async Task RefreshConfiguration_NetworkDevicesRefreshConfigurationMaximum Console.WriteLine($"Succeeded: {result}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task RunRoCommand_NetworkDevicesRunRoCommandMaximumSetGen() + { + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDevices_RunRoCommand.json + // this example is just showing the usage of "NetworkDevices_RunRoCommand" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NetworkDeviceResource created on azure + // for more information of creating NetworkDeviceResource, please refer to the document of NetworkDeviceResource + string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string resourceGroupName = "example-rg"; + string networkDeviceName = "example-device"; + ResourceIdentifier networkDeviceResourceId = NetworkDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkDeviceName); + NetworkDeviceResource networkDevice = client.GetNetworkDeviceResource(networkDeviceResourceId); + + // invoke the operation + DeviceRoCommand body = new DeviceRoCommand + { + Command = "show version", + }; + ArmOperation lro = await networkDevice.RunRoCommandAsync(WaitUntil.Completed, body); + CommonPostActionResponseForDeviceROCommandsOperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task RunRwCommand_NetworkDevicesRunRwCommandMaximumSetGen() + { + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDevices_RunRwCommand.json + // this example is just showing the usage of "NetworkDevices_RunRwCommand" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NetworkDeviceResource created on azure + // for more information of creating NetworkDeviceResource, please refer to the document of NetworkDeviceResource + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; + string resourceGroupName = "example-rg"; + string networkDeviceName = "example-device"; + ResourceIdentifier networkDeviceResourceId = NetworkDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkDeviceName); + NetworkDeviceResource networkDevice = client.GetNetworkDeviceResource(networkDeviceResourceId); + + // invoke the operation + DeviceRwCommand body = new DeviceRwCommand + { + Command = "yzuabghycngqmqtfacvoh", + }; + ArmOperation lro = await networkDevice.RunRwCommandAsync(WaitUntil.Completed, body); + CommonPostActionResponseForDeviceRWCommands result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task UpdateAdministrativeState_NetworkDevicesUpdateAdministrativeStateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_UpdateAdministrativeState_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDevices_UpdateAdministrativeState.json // this example is just showing the usage of "NetworkDevices_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -185,7 +250,7 @@ public async Task UpdateAdministrativeState_NetworkDevicesUpdateAdministrativeSt // this example assumes you already have this NetworkDeviceResource created on azure // for more information of creating NetworkDeviceResource, please refer to the document of NetworkDeviceResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkDeviceName = "example-device"; ResourceIdentifier networkDeviceResourceId = NetworkDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkDeviceName); @@ -194,8 +259,8 @@ public async Task UpdateAdministrativeState_NetworkDevicesUpdateAdministrativeSt // invoke the operation UpdateDeviceAdministrativeStateContent content = new UpdateDeviceAdministrativeStateContent { + ResourceIds = { "" }, State = NetworkDeviceAdministrativeState.Rma, - ResourceIds = { new ResourceIdentifier("") }, }; ArmOperation lro = await networkDevice.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); StateUpdateCommonPostActionResult result = lro.Value; @@ -207,7 +272,7 @@ public async Task UpdateAdministrativeState_NetworkDevicesUpdateAdministrativeSt [Ignore("Only validating compilation of examples")] public async Task Upgrade_NetworkDevicesUpgradeMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Upgrade_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDevices_Upgrade.json // this example is just showing the usage of "NetworkDevices_Upgrade" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -217,7 +282,7 @@ public async Task Upgrade_NetworkDevicesUpgradeMaximumSetGen() // this example assumes you already have this NetworkDeviceResource created on azure // for more information of creating NetworkDeviceResource, please refer to the document of NetworkDeviceResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkDeviceName = "example-device"; ResourceIdentifier networkDeviceResourceId = NetworkDeviceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkDeviceName); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceSkuCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceSkuCollection.cs index ba31c9a389a2..7200423668dd 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceSkuCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceSkuCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkDeviceSkuCollection [Ignore("Only validating compilation of examples")] public async Task Get_NetworkDeviceSkusGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDeviceSkus_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDeviceSkus_Get.json // this example is just showing the usage of "NetworkDeviceSkus_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_NetworkDeviceSkusGetMaximumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -52,7 +52,7 @@ public async Task Get_NetworkDeviceSkusGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_NetworkDeviceSkusListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDeviceSkus_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDeviceSkus_ListBySubscription.json // this example is just showing the usage of "NetworkDeviceSkus_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,7 +62,7 @@ public async Task GetAll_NetworkDeviceSkusListBySubscriptionMaximumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -86,7 +86,7 @@ public async Task GetAll_NetworkDeviceSkusListBySubscriptionMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_NetworkDeviceSkusGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDeviceSkus_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDeviceSkus_Get.json // this example is just showing the usage of "NetworkDeviceSkus_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Exists_NetworkDeviceSkusGetMaximumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -114,7 +114,7 @@ public async Task Exists_NetworkDeviceSkusGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_NetworkDeviceSkusGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDeviceSkus_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDeviceSkus_Get.json // this example is just showing the usage of "NetworkDeviceSkus_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +124,7 @@ public async Task GetIfExists_NetworkDeviceSkusGetMaximumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceSkuResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceSkuResource.cs index 144655a4f4cf..f46e90719616 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceSkuResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkDeviceSkuResource.cs @@ -19,7 +19,7 @@ public partial class Sample_NetworkDeviceSkuResource [Ignore("Only validating compilation of examples")] public async Task Get_NetworkDeviceSkusGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDeviceSkus_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDeviceSkus_Get.json // this example is just showing the usage of "NetworkDeviceSkus_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -29,7 +29,7 @@ public async Task Get_NetworkDeviceSkusGetMaximumSetGen() // this example assumes you already have this NetworkDeviceSkuResource created on azure // for more information of creating NetworkDeviceSkuResource, please refer to the document of NetworkDeviceSkuResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string networkDeviceSkuName = "example-deviceSku"; ResourceIdentifier networkDeviceSkuResourceId = NetworkDeviceSkuResource.CreateResourceIdentifier(subscriptionId, networkDeviceSkuName); NetworkDeviceSkuResource networkDeviceSku = client.GetNetworkDeviceSkuResource(networkDeviceSkuResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricAccessControlListCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricAccessControlListCollection.cs index ac0647179876..34d9c462dc48 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricAccessControlListCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricAccessControlListCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_NetworkFabricAccessControlListCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_AccessControlListsCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/AccessControlLists_Create.json // this example is just showing the usage of "AccessControlLists_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task CreateOrUpdate_AccessControlListsCreateMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -54,18 +54,6 @@ public async Task CreateOrUpdate_AccessControlListsCreateMaximumSetGen() IPAddressType = NetworkFabricIPAddressType.IPv4, MatchConditions = {new AccessControlListMatchCondition { -EtherTypes = {"0x1"}, -Fragments = {"0xff00-0xffff"}, -IPLengths = {"4094-9214"}, -TtlValues = {"23"}, -DscpMarkings = {"32"}, -PortCondition = new AccessControlListPortCondition(Layer4Protocol.Tcp) -{ -Flags = {"established"}, -PortType = NetworkFabricPortType.SourcePort, -Ports = {"1-20"}, -PortGroupNames = {"example-portGroup"}, -}, ProtocolTypes = {"TCP"}, VlanMatchCondition = new VlanMatchCondition { @@ -80,11 +68,39 @@ public async Task CreateOrUpdate_AccessControlListsCreateMaximumSetGen() IPPrefixValues = {"10.20.20.20/12"}, IPGroupNames = {"example-ipGroup"}, }, +EtherTypes = {"0x1"}, +Fragments = {"0xff00-0xffff"}, +IPLengths = {"4094-9214"}, +TtlValues = {"23"}, +DscpMarkings = {"32"}, +ProtocolNeighbors = {"example-neighbor"}, +PortCondition = new AccessControlListPortCondition(Layer4Protocol.Tcp) +{ +PortType = NetworkFabricPortType.SourcePort, +Ports = {"1-20"}, +PortGroupNames = {"example-portGroup"}, +Flags = {"established"}, +}, +IcmpTypes = {"echo"}, }}, Actions = {new AccessControlListAction { AclActionType = AclActionType.Count, CounterName = "example-counter", +RemarkComment = "example-remark", +PoliceRateConfiguration = new PoliceRateConfigurationProperties +{ +BitRate = new BitRate +{ +Rate = 15L, +Unit = BitRateUnit.Bps, +}, +BurstSize = new BurstSize +{ +Size = 2L, +Unit = BurstSizeUnit.Bytes, +}, +}, }}, }}, DynamicMatchConfigurations = {new CommonDynamicMatchConfiguration @@ -106,9 +122,12 @@ public async Task CreateOrUpdate_AccessControlListsCreateMaximumSetGen() Ports = {"100-200"}, }}, }}, + AclType = AclType.Cp, + DeviceRole = DeviceRole.CE, + GlobalAccessControlListActionsEnableCount = NetworkFabricBooleanValue.True, Tags = { -["keyID"] = "KeyValue" +["keyID"] = "keyValue" }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, accessControlListName, data); @@ -125,7 +144,7 @@ public async Task CreateOrUpdate_AccessControlListsCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_AccessControlListsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/AccessControlLists_Get.json // this example is just showing the usage of "AccessControlLists_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -135,7 +154,7 @@ public async Task Get_AccessControlListsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -158,7 +177,7 @@ public async Task Get_AccessControlListsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_AccessControlListsListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/AccessControlLists_ListByResourceGroup.json // this example is just showing the usage of "AccessControlLists_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +187,7 @@ public async Task GetAll_AccessControlListsListByResourceGroupMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -193,7 +212,7 @@ public async Task GetAll_AccessControlListsListByResourceGroupMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_AccessControlListsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/AccessControlLists_Get.json // this example is just showing the usage of "AccessControlLists_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -203,7 +222,7 @@ public async Task Exists_AccessControlListsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -222,7 +241,7 @@ public async Task Exists_AccessControlListsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_AccessControlListsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/AccessControlLists_Get.json // this example is just showing the usage of "AccessControlLists_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -232,7 +251,7 @@ public async Task GetIfExists_AccessControlListsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricAccessControlListResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricAccessControlListResource.cs index a2019b417cfa..eda4c5c7f949 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricAccessControlListResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricAccessControlListResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkFabricAccessControlListResource [Ignore("Only validating compilation of examples")] public async Task Get_AccessControlListsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/AccessControlLists_Get.json // this example is just showing the usage of "AccessControlLists_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_AccessControlListsGetMaximumSetGen() // this example assumes you already have this NetworkFabricAccessControlListResource created on azure // for more information of creating NetworkFabricAccessControlListResource, please refer to the document of NetworkFabricAccessControlListResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string accessControlListName = "example-acl"; ResourceIdentifier networkFabricAccessControlListResourceId = NetworkFabricAccessControlListResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accessControlListName); @@ -50,7 +50,7 @@ public async Task Get_AccessControlListsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_AccessControlListsDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/AccessControlLists_Delete.json // this example is just showing the usage of "AccessControlLists_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task Delete_AccessControlListsDeleteMaximumSetGen() // this example assumes you already have this NetworkFabricAccessControlListResource created on azure // for more information of creating NetworkFabricAccessControlListResource, please refer to the document of NetworkFabricAccessControlListResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string accessControlListName = "example-acl"; ResourceIdentifier networkFabricAccessControlListResourceId = NetworkFabricAccessControlListResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accessControlListName); @@ -76,7 +76,7 @@ public async Task Delete_AccessControlListsDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_AccessControlListsUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/AccessControlLists_Update.json // this example is just showing the usage of "AccessControlLists_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Update_AccessControlListsUpdateMaximumSetGen() // this example assumes you already have this NetworkFabricAccessControlListResource created on azure // for more information of creating NetworkFabricAccessControlListResource, please refer to the document of NetworkFabricAccessControlListResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string accessControlListName = "example-acl"; ResourceIdentifier networkFabricAccessControlListResourceId = NetworkFabricAccessControlListResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accessControlListName); @@ -95,73 +95,96 @@ public async Task Update_AccessControlListsUpdateMaximumSetGen() // invoke the operation NetworkFabricAccessControlListPatch patch = new NetworkFabricAccessControlListPatch { - ConfigurationType = NetworkFabricConfigurationType.File, - AclsUri = new Uri("https://microsoft.com/a"), - DefaultAction = CommunityActionType.Permit, - MatchConfigurations = {new AccessControlListMatchConfiguration + Tags = +{ +["KeyId"] = "KeyValue" +}, + Properties = new AccessControlListPatchProperties + { + ConfigurationType = NetworkFabricConfigurationType.File, + AclsUri = new Uri("https://microsoft.com/a"), + DefaultAction = CommunityActionType.Permit, + MatchConfigurations = {new AccessControlListMatchConfigurationPatch { MatchConfigurationName = "example-match", SequenceNumber = 123L, IPAddressType = NetworkFabricIPAddressType.IPv4, -MatchConditions = {new AccessControlListMatchCondition -{ -EtherTypes = {"0x1"}, -Fragments = {"0xff00-0xffff"}, -IPLengths = {"4094-9214"}, -TtlValues = {"23"}, -DscpMarkings = {"32"}, -PortCondition = new AccessControlListPortCondition(Layer4Protocol.Tcp) +MatchConditions = {new AccessControlListMatchConditionPatch { -Flags = {"established"}, -PortType = NetworkFabricPortType.SourcePort, -Ports = {"1-20"}, -PortGroupNames = {"example-portGroup"}, -}, ProtocolTypes = {"TCP"}, -VlanMatchCondition = new VlanMatchCondition +VlanMatchCondition = new VlanMatchConditionPatch { Vlans = {"20-30"}, InnerVlans = {"30"}, VlanGroupNames = {"example-vlanGroup"}, }, -IPCondition = new IPMatchCondition +IPCondition = new IPMatchConditionPatch { SourceDestinationType = SourceDestinationType.SourceIP, PrefixType = IPMatchConditionPrefixType.Prefix, IPPrefixValues = {"10.20.20.20/12"}, IPGroupNames = {"example-ipGroup"}, }, +EtherTypes = {"0x1"}, +Fragments = {"0xff00-0xffff"}, +IPLengths = {"4094-9214"}, +TtlValues = {"23"}, +DscpMarkings = {"32"}, +PortCondition = new AccessControlListPortConditionPatch +{ +PortType = NetworkFabricPortType.SourcePort, +Layer4Protocol = Layer4Protocol.Tcp, +Ports = {"1-20"}, +PortGroupNames = {"example-portGroup"}, +Flags = {"established"}, +}, +ProtocolNeighbors = {"example-neighbor"}, +IcmpTypes = {"echo"}, }}, -Actions = {new AccessControlListAction +Actions = {new AccessControlListActionPatch { AclActionType = AclActionType.Count, CounterName = "example-counter", +RemarkComment = "example-remark", +PoliceRateConfiguration = new PoliceRateConfigurationProperties +{ +BitRate = new BitRate +{ +Rate = 15L, +Unit = BitRateUnit.Bps, +}, +BurstSize = new BurstSize +{ +Size = 2L, +Unit = BurstSizeUnit.Bytes, +}, +}, }}, }}, - DynamicMatchConfigurations = {new CommonDynamicMatchConfiguration + DynamicMatchConfigurations = {new CommonDynamicMatchConfigurationPatch { -IPGroups = {new MatchConfigurationIPGroupProperties +IPGroups = {new IPGroupPatchProperties { Name = "example-ipGroup", IPAddressType = NetworkFabricIPAddressType.IPv4, IPPrefixes = {"10.20.3.1/20"}, }}, -VlanGroups = {new VlanGroupProperties +VlanGroups = {new VlanGroupPatchProperties { Name = "example-vlanGroup", Vlans = {"20-30"}, }}, -PortGroups = {new PortGroupProperties +PortGroups = {new PortGroupPatchProperties { Name = "example-portGroup", Ports = {"100-200"}, }}, }}, - Annotation = "annotation", - Tags = -{ -["keyID"] = "KeyValue" -}, + AclType = AclType.Cp, + DeviceRole = DeviceRole.CE, + GlobalAccessControlListActionsEnableCount = NetworkFabricBooleanValue.True, + Annotation = "annotation", + }, }; ArmOperation lro = await networkFabricAccessControlList.UpdateAsync(WaitUntil.Completed, patch); NetworkFabricAccessControlListResource result = lro.Value; @@ -175,10 +198,10 @@ public async Task Update_AccessControlListsUpdateMaximumSetGen() [Test] [Ignore("Only validating compilation of examples")] - public async Task UpdateAdministrativeState_AccessControlListsUpdateAdministrativeStateMaximumSetGen() + public async Task Resync_AccessControlListsResyncMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_UpdateAdministrativeState_MaximumSet_Gen.json - // this example is just showing the usage of "AccessControlLists_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/AccessControlLists_Resync.json + // this example is just showing the usage of "AccessControlLists_Resync" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -187,19 +210,14 @@ public async Task UpdateAdministrativeState_AccessControlListsUpdateAdministrati // this example assumes you already have this NetworkFabricAccessControlListResource created on azure // for more information of creating NetworkFabricAccessControlListResource, please refer to the document of NetworkFabricAccessControlListResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string accessControlListName = "example-acl"; ResourceIdentifier networkFabricAccessControlListResourceId = NetworkFabricAccessControlListResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accessControlListName); NetworkFabricAccessControlListResource networkFabricAccessControlList = client.GetNetworkFabricAccessControlListResource(networkFabricAccessControlListResourceId); // invoke the operation - UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent - { - State = AdministrativeEnableState.Enable, - ResourceIds = { new ResourceIdentifier("") }, - }; - ArmOperation lro = await networkFabricAccessControlList.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); + ArmOperation lro = await networkFabricAccessControlList.ResyncAsync(WaitUntil.Completed); StateUpdateCommonPostActionResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); @@ -207,10 +225,10 @@ public async Task UpdateAdministrativeState_AccessControlListsUpdateAdministrati [Test] [Ignore("Only validating compilation of examples")] - public async Task Resync_AccessControlListsResyncMaximumSetGen() + public async Task UpdateAdministrativeState_AccessControlListsUpdateAdministrativeStateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Resync_MaximumSet_Gen.json - // this example is just showing the usage of "AccessControlLists_Resync" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/AccessControlLists_UpdateAdministrativeState.json + // this example is just showing the usage of "AccessControlLists_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -219,14 +237,19 @@ public async Task Resync_AccessControlListsResyncMaximumSetGen() // this example assumes you already have this NetworkFabricAccessControlListResource created on azure // for more information of creating NetworkFabricAccessControlListResource, please refer to the document of NetworkFabricAccessControlListResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string accessControlListName = "example-acl"; ResourceIdentifier networkFabricAccessControlListResourceId = NetworkFabricAccessControlListResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accessControlListName); NetworkFabricAccessControlListResource networkFabricAccessControlList = client.GetNetworkFabricAccessControlListResource(networkFabricAccessControlListResourceId); // invoke the operation - ArmOperation lro = await networkFabricAccessControlList.ResyncAsync(WaitUntil.Completed); + UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent + { + ResourceIds = { "" }, + State = AdministrativeEnableState.Enable, + }; + ArmOperation lro = await networkFabricAccessControlList.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); StateUpdateCommonPostActionResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); @@ -236,7 +259,7 @@ public async Task Resync_AccessControlListsResyncMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task ValidateConfiguration_AccessControlListsValidateConfigurationMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_ValidateConfiguration_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/AccessControlLists_ValidateConfiguration.json // this example is just showing the usage of "AccessControlLists_ValidateConfiguration" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -246,7 +269,7 @@ public async Task ValidateConfiguration_AccessControlListsValidateConfigurationM // this example assumes you already have this NetworkFabricAccessControlListResource created on azure // for more information of creating NetworkFabricAccessControlListResource, please refer to the document of NetworkFabricAccessControlListResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string accessControlListName = "example-acl"; ResourceIdentifier networkFabricAccessControlListResourceId = NetworkFabricAccessControlListResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accessControlListName); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricCollection.cs index eede1ba29c00..4560125ef716 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricCollection.cs @@ -10,6 +10,7 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.ManagedNetworkFabric.Models; +using Azure.ResourceManager.Models; using Azure.ResourceManager.Resources; using NUnit.Framework; @@ -21,7 +22,7 @@ public partial class Sample_NetworkFabricCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_NetworkFabricsCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_Create.json // this example is just showing the usage of "NetworkFabrics_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +32,7 @@ public async Task CreateOrUpdate_NetworkFabricsCreateMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -48,84 +49,101 @@ public async Task CreateOrUpdate_NetworkFabricsCreateMaximumSetGen() 8, "10.18.0.0/19", 29249L, - new TerminalServerConfiguration + new TerminalServerConfiguration("username", "xxx-xx-xx", "10.0.0.12/30", "40.0.0.14/30") { - PrimaryIPv4Prefix = "10.0.0.12/30", + SerialNumber = "123456", PrimaryIPv6Prefix = "4FFE:FFFF:0:CD30::a8/127", - SecondaryIPv4Prefix = "20.0.0.13/30", SecondaryIPv6Prefix = "6FFE:FFFF:0:CD30::ac/127", - Username = "username", - Password = "xxxx", - SerialNumber = "123456", }, new ManagementNetworkConfigurationProperties(new VpnConfigurationProperties(PeeringOption.OptionA) { NetworkToNetworkInterconnectId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - OptionBProperties = new OptionBProperties + OptionBProperties = new VpnOptionBProperties { ImportRouteTargets = { "65046:10050" }, ExportRouteTargets = { "65046:10050" }, RouteTargets = new RouteTargetInformation { - ImportIPv4RouteTargets = { "65046:10039" }, - ImportIPv6RouteTargets = { "65046:10039" }, - ExportIPv4RouteTargets = { "65046:10039" }, - ExportIPv6RouteTargets = { "65046:10039" }, + ImportIPv4RouteTargets = { "65046:10050" }, + ImportIPv6RouteTargets = { "65046:10050" }, + ExportIPv4RouteTargets = { "65046:10050" }, + ExportIPv6RouteTargets = { "65046:10050" }, }, }, - OptionAProperties = new VpnConfigurationOptionAProperties + OptionAProperties = new VpnOptionAProperties(3001, 1235L) { - PrimaryIPv4Prefix = "10.0.0.12/30", - PrimaryIPv6Prefix = "4FFE:FFFF:0:CD30::a8/127", - SecondaryIPv4Prefix = "20.0.0.13/30", - SecondaryIPv6Prefix = "6FFE:FFFF:0:CD30::ac/127", Mtu = 1501, - VlanId = 3001, - PeerAsn = 1235L, BfdConfiguration = new BfdConfiguration { IntervalInMilliSeconds = 300, Multiplier = 10, }, + PrimaryIPv4Prefix = "10.0.0.12/30", + PrimaryIPv6Prefix = "4FFE:FFFF:0:CD30::a8/127", + SecondaryIPv4Prefix = "20.0.0.13/30", + SecondaryIPv6Prefix = "6FFE:FFFF:0:CD30::ac/127", }, }, new VpnConfigurationProperties(PeeringOption.OptionA) { NetworkToNetworkInterconnectId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - OptionBProperties = new OptionBProperties + OptionBProperties = new VpnOptionBProperties { ImportRouteTargets = { "65046:10050" }, ExportRouteTargets = { "65046:10050" }, RouteTargets = new RouteTargetInformation { - ImportIPv4RouteTargets = { "65046:10039" }, - ImportIPv6RouteTargets = { "65046:10039" }, - ExportIPv4RouteTargets = { "65046:10039" }, - ExportIPv6RouteTargets = { "65046:10039" }, + ImportIPv4RouteTargets = { "65046:10050" }, + ImportIPv6RouteTargets = { "65046:10050" }, + ExportIPv4RouteTargets = { "65046:10050" }, + ExportIPv6RouteTargets = { "65046:10050" }, }, }, - OptionAProperties = new VpnConfigurationOptionAProperties + OptionAProperties = new VpnOptionAProperties(3000, 61234L) { - PrimaryIPv4Prefix = "10.0.0.14/30", - PrimaryIPv6Prefix = "2FFE:FFFF:0:CD30::a7/126", - SecondaryIPv4Prefix = "10.0.0.15/30", - SecondaryIPv6Prefix = "2FFE:FFFF:0:CD30::ac/126", Mtu = 1500, - VlanId = 3000, - PeerAsn = 61234L, BfdConfiguration = new BfdConfiguration { IntervalInMilliSeconds = 300, Multiplier = 5, }, + PrimaryIPv4Prefix = "10.0.0.14/30", + PrimaryIPv6Prefix = "2FFE:FFFF:0:CD30::a7/126", + SecondaryIPv4Prefix = "10.0.0.15/30", + SecondaryIPv6Prefix = "2FFE:FFFF:0:CD30::ac/126", }, })) { + Identity = new ManagedServiceIdentity("None") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("key872")] = new UserAssignedIdentity() +}, + }, Annotation = "annotation", + FabricVersion = "version1", + StorageAccountConfiguration = new StorageAccountConfiguration + { + StorageAccountId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Storage/storageAccounts/nfStorage"), + StorageAccountIdentity = new IdentitySelector(ManagedServiceIdentitySelectorType.UserAssignedIdentity) + { + UserAssignedIdentityResourceId = new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789abc/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-id"), + }, + }, RackCount = 4, IPv6Prefix = "3FFE:FFFF:0:CD40::/59", + HardwareAlertThreshold = 74, + ControlPlaneAcls = { new ResourceIdentifier("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl") }, + TrustedIPPrefixes = { new ResourceIdentifier("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-prefix") }, + UniqueRdConfiguration = new UniqueRouteDistinguisherProperties + { + UniqueRdConfigurationState = UniqueRouteDistinguisherConfigurationState.Enabled, + NniDerivedUniqueRdConfigurationState = NNIDerivedUniqueRouteDistinguisherConfigurationState.Enabled, + }, + StorageArrayCount = 1, Tags = { -["keyID"] = "keyValue" +["keyId"] = "keyValue" }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, networkFabricName, data); @@ -142,7 +160,7 @@ public async Task CreateOrUpdate_NetworkFabricsCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_NetworkFabricsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_Get.json // this example is just showing the usage of "NetworkFabrics_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -152,7 +170,7 @@ public async Task Get_NetworkFabricsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -175,7 +193,7 @@ public async Task Get_NetworkFabricsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_NetworkFabricsListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_ListByResourceGroup.json // this example is just showing the usage of "NetworkFabrics_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -185,7 +203,7 @@ public async Task GetAll_NetworkFabricsListByResourceGroupMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -210,7 +228,7 @@ public async Task GetAll_NetworkFabricsListByResourceGroupMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_NetworkFabricsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_Get.json // this example is just showing the usage of "NetworkFabrics_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -220,7 +238,7 @@ public async Task Exists_NetworkFabricsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -239,7 +257,7 @@ public async Task Exists_NetworkFabricsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_NetworkFabricsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_Get.json // this example is just showing the usage of "NetworkFabrics_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -249,7 +267,7 @@ public async Task GetIfExists_NetworkFabricsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricControllerCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricControllerCollection.cs index 9247ed54cf8c..5ab93e1a3305 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricControllerCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricControllerCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_NetworkFabricControllerCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_NetworkFabricControllersCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabricControllers_Create.json // this example is just showing the usage of "NetworkFabricControllers_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task CreateOrUpdate_NetworkFabricControllersCreateMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -46,11 +46,11 @@ public async Task CreateOrUpdate_NetworkFabricControllersCreateMaximumSetGen() Annotation = "annotation", InfrastructureExpressRouteConnections = {new ExpressRouteConnectionInformation(new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName")) { -ExpressRouteAuthorizationKey = "1234ABCD-0A1B-1234-5678-123456ABCDEF", +ExpressRouteAuthorizationKey = "xxx-xxx-xxx", }}, WorkloadExpressRouteConnections = {new ExpressRouteConnectionInformation(new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName")) { -ExpressRouteAuthorizationKey = "xxxxx", +ExpressRouteAuthorizationKey = "xxx-xxx-xxx", }}, ManagedResourceGroupConfiguration = new ManagedResourceGroupConfiguration { @@ -61,6 +61,10 @@ public async Task CreateOrUpdate_NetworkFabricControllersCreateMaximumSetGen() IPv4AddressSpace = "172.253.0.0/19", IPv6AddressSpace = "::/60", NfcSku = NetworkFabricControllerSKU.Standard, + Tags = +{ +["keyId"] = "KeyValue" +}, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, networkFabricControllerName, data); NetworkFabricControllerResource result = lro.Value; @@ -76,7 +80,7 @@ public async Task CreateOrUpdate_NetworkFabricControllersCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_NetworkFabricControllersGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabricControllers_Get.json // this example is just showing the usage of "NetworkFabricControllers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +90,7 @@ public async Task Get_NetworkFabricControllersGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -109,7 +113,7 @@ public async Task Get_NetworkFabricControllersGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_NetworkFabricControllersListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabricControllers_ListByResourceGroup.json // this example is just showing the usage of "NetworkFabricControllers_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,7 +123,7 @@ public async Task GetAll_NetworkFabricControllersListByResourceGroupMaximumSetGe // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -144,7 +148,7 @@ public async Task GetAll_NetworkFabricControllersListByResourceGroupMaximumSetGe [Ignore("Only validating compilation of examples")] public async Task Exists_NetworkFabricControllersGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabricControllers_Get.json // this example is just showing the usage of "NetworkFabricControllers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -154,7 +158,7 @@ public async Task Exists_NetworkFabricControllersGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -173,7 +177,7 @@ public async Task Exists_NetworkFabricControllersGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_NetworkFabricControllersGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabricControllers_Get.json // this example is just showing the usage of "NetworkFabricControllers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -183,7 +187,7 @@ public async Task GetIfExists_NetworkFabricControllersGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricControllerResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricControllerResource.cs index 65410696ad67..5a48fdf1cc2d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricControllerResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricControllerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkFabricControllerResource [Ignore("Only validating compilation of examples")] public async Task Get_NetworkFabricControllersGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabricControllers_Get.json // this example is just showing the usage of "NetworkFabricControllers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_NetworkFabricControllersGetMaximumSetGen() // this example assumes you already have this NetworkFabricControllerResource created on azure // for more information of creating NetworkFabricControllerResource, please refer to the document of NetworkFabricControllerResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkFabricControllerName = "example-networkController"; ResourceIdentifier networkFabricControllerResourceId = NetworkFabricControllerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricControllerName); @@ -50,7 +50,7 @@ public async Task Get_NetworkFabricControllersGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_NetworkFabricControllersDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabricControllers_Delete.json // this example is just showing the usage of "NetworkFabricControllers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task Delete_NetworkFabricControllersDeleteMaximumSetGen() // this example assumes you already have this NetworkFabricControllerResource created on azure // for more information of creating NetworkFabricControllerResource, please refer to the document of NetworkFabricControllerResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkFabricControllerName = "example-networkController"; ResourceIdentifier networkFabricControllerResourceId = NetworkFabricControllerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricControllerName); @@ -76,7 +76,7 @@ public async Task Delete_NetworkFabricControllersDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_NetworkFabricControllersUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabricControllers_Update.json // this example is just showing the usage of "NetworkFabricControllers_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Update_NetworkFabricControllersUpdateMaximumSetGen() // this example assumes you already have this NetworkFabricControllerResource created on azure // for more information of creating NetworkFabricControllerResource, please refer to the document of NetworkFabricControllerResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkFabricControllerName = "example-networkController"; ResourceIdentifier networkFabricControllerResourceId = NetworkFabricControllerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricControllerName); @@ -95,14 +95,21 @@ public async Task Update_NetworkFabricControllersUpdateMaximumSetGen() // invoke the operation NetworkFabricControllerPatch patch = new NetworkFabricControllerPatch { - InfrastructureExpressRouteConnections = {new ExpressRouteConnectionInformation(new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName")) + Tags = { -ExpressRouteAuthorizationKey = "xxxxxxx", +["keyId"] = "KeyValue" +}, + Properties = new NetworkFabricControllerPatchProperties + { + InfrastructureExpressRouteConnections = {new ExpressRouteConnectionInformation(new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName")) +{ +ExpressRouteAuthorizationKey = "xxx-xxx-xxx", }}, - WorkloadExpressRouteConnections = {new ExpressRouteConnectionInformation(new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName")) + WorkloadExpressRouteConnections = {new ExpressRouteConnectionInformation(new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName")) { -ExpressRouteAuthorizationKey = "xxxxxxx", +ExpressRouteAuthorizationKey = "xxx-xxx-xxx", }}, + }, }; ArmOperation lro = await networkFabricController.UpdateAsync(WaitUntil.Completed, patch); NetworkFabricControllerResource result = lro.Value; diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricExternalNetworkCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricExternalNetworkCollection.cs index ec6eb3ec4f1d..4d73b305982e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricExternalNetworkCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricExternalNetworkCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkFabricExternalNetworkCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ExternalNetworksCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/ExternalNetworks_Create.json // this example is just showing the usage of "ExternalNetworks_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,9 +30,9 @@ public async Task CreateOrUpdate_ExternalNetworksCreateMaximumSetGen() // this example assumes you already have this NetworkFabricL3IsolationDomainResource created on azure // for more information of creating NetworkFabricL3IsolationDomainResource, please refer to the document of NetworkFabricL3IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l3IsolationDomainName = "example-l3domain"; + string l3IsolationDomainName = "example-externalnetwork"; ResourceIdentifier networkFabricL3IsolationDomainResourceId = NetworkFabricL3IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName); NetworkFabricL3IsolationDomainResource networkFabricL3IsolationDomain = client.GetNetworkFabricL3IsolationDomainResource(networkFabricL3IsolationDomainResourceId); @@ -40,12 +40,11 @@ public async Task CreateOrUpdate_ExternalNetworksCreateMaximumSetGen() NetworkFabricExternalNetworkCollection collection = networkFabricL3IsolationDomain.GetNetworkFabricExternalNetworks(); // invoke the operation - string externalNetworkName = "example-externalnetwork"; + string externalNetworkName = "example-ext"; NetworkFabricExternalNetworkData data = new NetworkFabricExternalNetworkData(PeeringOption.OptionA) { Annotation = "annotation", - ImportRoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ExportRoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + NetworkToNetworkInterconnectId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), ImportRoutePolicy = new ImportRoutePolicy { ImportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), @@ -62,28 +61,53 @@ public async Task CreateOrUpdate_ExternalNetworksCreateMaximumSetGen() ExportRouteTargets = { "65046:10039" }, RouteTargets = new RouteTargetInformation { - ImportIPv4RouteTargets = { "65046:10039" }, - ImportIPv6RouteTargets = { "65046:10039" }, - ExportIPv4RouteTargets = { "65046:10039" }, - ExportIPv6RouteTargets = { "65046:10039" }, + ImportIPv4RouteTargets = { "65046:10050" }, + ImportIPv6RouteTargets = { "65046:10050" }, + ExportIPv4RouteTargets = { "65046:10050" }, + ExportIPv6RouteTargets = { "65046:10050" }, }, }, OptionAProperties = new ExternalNetworkOptionAProperties { + PrimaryIPv4Prefix = "10.1.1.0/30", + PrimaryIPv6Prefix = "3FFE:FFFF:0:CD30::a0/126", + SecondaryIPv4Prefix = "10.1.1.4/30", + SecondaryIPv6Prefix = "3FFE:FFFF:0:CD30::a4/126", Mtu = 1500, VlanId = 1001, PeerAsn = 65047L, BfdConfiguration = new BfdConfiguration { IntervalInMilliSeconds = 300, - Multiplier = 15, + Multiplier = 10, }, IngressAclId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + BmpConfigurationState = BmpConfigurationState.Enabled, EgressAclId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - PrimaryIPv4Prefix = "10.1.1.0/30", - PrimaryIPv6Prefix = "3FFE:FFFF:0:CD30::a0/126", - SecondaryIPv4Prefix = "10.1.1.4/30", - SecondaryIPv6Prefix = "3FFE:FFFF:0:CD30::a4/126", + V4OverV6BgpSession = V4OverV6BgpSessionState.Enabled, + V6OverV4BgpSession = V6OverV4BgpSessionState.Enabled, + NativeIPv4PrefixLimits = {new PrefixLimitProperties +{ +MaximumRoutes = 14, +Threshold = 17, +IdleTimeExpiry = 7, +}}, + NativeIPv6PrefixLimits = {new PrefixLimitProperties +{ +MaximumRoutes = 14, +Threshold = 17, +IdleTimeExpiry = 7, +}}, + }, + StaticRouteConfiguration = new ExternalNetworkStaticRouteConfiguration + { + BfdConfiguration = new BfdConfiguration + { + IntervalInMilliSeconds = 300, + Multiplier = 10, + }, + IPv4Routes = { new StaticRouteProperties("10.0.0.1/24", new string[] { "10.0.0.1" }) }, + IPv6Routes = { new StaticRouteProperties("2fff::/64", new string[] { "3ffe::1" }) }, }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, externalNetworkName, data); @@ -100,7 +124,7 @@ public async Task CreateOrUpdate_ExternalNetworksCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_ExternalNetworksGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/ExternalNetworks_Get.json // this example is just showing the usage of "ExternalNetworks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -110,9 +134,9 @@ public async Task Get_ExternalNetworksGetMaximumSetGen() // this example assumes you already have this NetworkFabricL3IsolationDomainResource created on azure // for more information of creating NetworkFabricL3IsolationDomainResource, please refer to the document of NetworkFabricL3IsolationDomainResource - string subscriptionId = "42EEDB3B-8E17-46E3-B0B4-B1CD9842D90D"; - string resourceGroupName = "rgL3IsolationDomains"; - string l3IsolationDomainName = "yhtr"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; + string resourceGroupName = "example-rg"; + string l3IsolationDomainName = "example-externalnetwork"; ResourceIdentifier networkFabricL3IsolationDomainResourceId = NetworkFabricL3IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName); NetworkFabricL3IsolationDomainResource networkFabricL3IsolationDomain = client.GetNetworkFabricL3IsolationDomainResource(networkFabricL3IsolationDomainResourceId); @@ -120,7 +144,7 @@ public async Task Get_ExternalNetworksGetMaximumSetGen() NetworkFabricExternalNetworkCollection collection = networkFabricL3IsolationDomain.GetNetworkFabricExternalNetworks(); // invoke the operation - string externalNetworkName = "fltpszzikbalrzaqq"; + string externalNetworkName = "example-ext"; NetworkFabricExternalNetworkResource result = await collection.GetAsync(externalNetworkName); // the variable result is a resource, you could call other operations on this instance as well @@ -134,7 +158,7 @@ public async Task Get_ExternalNetworksGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_ExternalNetworksListByL3IsolationDomainMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_ListByL3IsolationDomain_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/ExternalNetworks_ListByL3IsolationDomain.json // this example is just showing the usage of "ExternalNetworks_ListByL3IsolationDomain" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -144,9 +168,9 @@ public async Task GetAll_ExternalNetworksListByL3IsolationDomainMaximumSetGen() // this example assumes you already have this NetworkFabricL3IsolationDomainResource created on azure // for more information of creating NetworkFabricL3IsolationDomainResource, please refer to the document of NetworkFabricL3IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l3IsolationDomainName = "example-l3domain"; + string l3IsolationDomainName = "example-externalnetwork"; ResourceIdentifier networkFabricL3IsolationDomainResourceId = NetworkFabricL3IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName); NetworkFabricL3IsolationDomainResource networkFabricL3IsolationDomain = client.GetNetworkFabricL3IsolationDomainResource(networkFabricL3IsolationDomainResourceId); @@ -170,7 +194,7 @@ public async Task GetAll_ExternalNetworksListByL3IsolationDomainMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_ExternalNetworksGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/ExternalNetworks_Get.json // this example is just showing the usage of "ExternalNetworks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -180,9 +204,9 @@ public async Task Exists_ExternalNetworksGetMaximumSetGen() // this example assumes you already have this NetworkFabricL3IsolationDomainResource created on azure // for more information of creating NetworkFabricL3IsolationDomainResource, please refer to the document of NetworkFabricL3IsolationDomainResource - string subscriptionId = "42EEDB3B-8E17-46E3-B0B4-B1CD9842D90D"; - string resourceGroupName = "rgL3IsolationDomains"; - string l3IsolationDomainName = "yhtr"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; + string resourceGroupName = "example-rg"; + string l3IsolationDomainName = "example-externalnetwork"; ResourceIdentifier networkFabricL3IsolationDomainResourceId = NetworkFabricL3IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName); NetworkFabricL3IsolationDomainResource networkFabricL3IsolationDomain = client.GetNetworkFabricL3IsolationDomainResource(networkFabricL3IsolationDomainResourceId); @@ -190,7 +214,7 @@ public async Task Exists_ExternalNetworksGetMaximumSetGen() NetworkFabricExternalNetworkCollection collection = networkFabricL3IsolationDomain.GetNetworkFabricExternalNetworks(); // invoke the operation - string externalNetworkName = "fltpszzikbalrzaqq"; + string externalNetworkName = "example-ext"; bool result = await collection.ExistsAsync(externalNetworkName); Console.WriteLine($"Succeeded: {result}"); @@ -200,7 +224,7 @@ public async Task Exists_ExternalNetworksGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ExternalNetworksGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/ExternalNetworks_Get.json // this example is just showing the usage of "ExternalNetworks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -210,9 +234,9 @@ public async Task GetIfExists_ExternalNetworksGetMaximumSetGen() // this example assumes you already have this NetworkFabricL3IsolationDomainResource created on azure // for more information of creating NetworkFabricL3IsolationDomainResource, please refer to the document of NetworkFabricL3IsolationDomainResource - string subscriptionId = "42EEDB3B-8E17-46E3-B0B4-B1CD9842D90D"; - string resourceGroupName = "rgL3IsolationDomains"; - string l3IsolationDomainName = "yhtr"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; + string resourceGroupName = "example-rg"; + string l3IsolationDomainName = "example-externalnetwork"; ResourceIdentifier networkFabricL3IsolationDomainResourceId = NetworkFabricL3IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName); NetworkFabricL3IsolationDomainResource networkFabricL3IsolationDomain = client.GetNetworkFabricL3IsolationDomainResource(networkFabricL3IsolationDomainResourceId); @@ -220,7 +244,7 @@ public async Task GetIfExists_ExternalNetworksGetMaximumSetGen() NetworkFabricExternalNetworkCollection collection = networkFabricL3IsolationDomain.GetNetworkFabricExternalNetworks(); // invoke the operation - string externalNetworkName = "fltpszzikbalrzaqq"; + string externalNetworkName = "example-ext"; NullableResponse response = await collection.GetIfExistsAsync(externalNetworkName); NetworkFabricExternalNetworkResource result = response.HasValue ? response.Value : null; diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricExternalNetworkResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricExternalNetworkResource.cs index cf82dad3c6bf..6f41277c7ef7 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricExternalNetworkResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricExternalNetworkResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkFabricExternalNetworkResource [Ignore("Only validating compilation of examples")] public async Task Get_ExternalNetworksGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/ExternalNetworks_Get.json // this example is just showing the usage of "ExternalNetworks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,10 +30,10 @@ public async Task Get_ExternalNetworksGetMaximumSetGen() // this example assumes you already have this NetworkFabricExternalNetworkResource created on azure // for more information of creating NetworkFabricExternalNetworkResource, please refer to the document of NetworkFabricExternalNetworkResource - string subscriptionId = "42EEDB3B-8E17-46E3-B0B4-B1CD9842D90D"; - string resourceGroupName = "rgL3IsolationDomains"; - string l3IsolationDomainName = "yhtr"; - string externalNetworkName = "fltpszzikbalrzaqq"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; + string resourceGroupName = "example-rg"; + string l3IsolationDomainName = "example-externalnetwork"; + string externalNetworkName = "example-ext"; ResourceIdentifier networkFabricExternalNetworkResourceId = NetworkFabricExternalNetworkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName); NetworkFabricExternalNetworkResource networkFabricExternalNetwork = client.GetNetworkFabricExternalNetworkResource(networkFabricExternalNetworkResourceId); @@ -51,7 +51,7 @@ public async Task Get_ExternalNetworksGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_ExternalNetworksDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/ExternalNetworks_Delete.json // this example is just showing the usage of "ExternalNetworks_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,10 +61,10 @@ public async Task Delete_ExternalNetworksDeleteMaximumSetGen() // this example assumes you already have this NetworkFabricExternalNetworkResource created on azure // for more information of creating NetworkFabricExternalNetworkResource, please refer to the document of NetworkFabricExternalNetworkResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l3IsolationDomainName = "example-l3domain"; - string externalNetworkName = "example-externalnetwork"; + string l3IsolationDomainName = "example-externalnetwork"; + string externalNetworkName = "example-ext"; ResourceIdentifier networkFabricExternalNetworkResourceId = NetworkFabricExternalNetworkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName); NetworkFabricExternalNetworkResource networkFabricExternalNetwork = client.GetNetworkFabricExternalNetworkResource(networkFabricExternalNetworkResourceId); @@ -78,7 +78,7 @@ public async Task Delete_ExternalNetworksDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_ExternalNetworksUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/ExternalNetworks_Update.json // this example is just showing the usage of "ExternalNetworks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,58 +88,85 @@ public async Task Update_ExternalNetworksUpdateMaximumSetGen() // this example assumes you already have this NetworkFabricExternalNetworkResource created on azure // for more information of creating NetworkFabricExternalNetworkResource, please refer to the document of NetworkFabricExternalNetworkResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l3IsolationDomainName = "example-l3domain"; - string externalNetworkName = "example-externalnetwork"; + string l3IsolationDomainName = "example-externalnetwork"; + string externalNetworkName = "example-ext"; ResourceIdentifier networkFabricExternalNetworkResourceId = NetworkFabricExternalNetworkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName); NetworkFabricExternalNetworkResource networkFabricExternalNetwork = client.GetNetworkFabricExternalNetworkResource(networkFabricExternalNetworkResourceId); // invoke the operation NetworkFabricExternalNetworkPatch patch = new NetworkFabricExternalNetworkPatch { - Annotation = "annotation1", - ImportRoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ExportRoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ImportRoutePolicy = new ImportRoutePolicy - { - ImportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ImportIPv6RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - }, - ExportRoutePolicy = new ExportRoutePolicy - { - ExportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ExportIPv6RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - }, - PeeringOption = PeeringOption.OptionA, - OptionBProperties = new L3OptionBProperties + Properties = new ExternalNetworkPatchProperties { - ImportRouteTargets = { "65046:10039" }, - ExportRouteTargets = { "65046:10039" }, - RouteTargets = new RouteTargetInformation + Annotation = "annotation1", + NetworkToNetworkInterconnectId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + ImportRoutePolicy = new ImportRoutePolicyPatch { - ImportIPv4RouteTargets = { "65046:10039" }, - ImportIPv6RouteTargets = { "65046:10039" }, - ExportIPv4RouteTargets = { "65046:10039" }, - ExportIPv6RouteTargets = { "65046:10039" }, + ImportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + ImportIPv6RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), }, - }, - OptionAProperties = new ExternalNetworkPatchOptionAProperties - { - Mtu = 1500, - VlanId = 1001, - PeerAsn = 65047L, - BfdConfiguration = new BfdConfiguration + ExportRoutePolicy = new ExportRoutePolicyPatch + { + ExportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + ExportIPv6RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + }, + PeeringOption = PeeringOption.OptionA, + OptionBProperties = new L3OptionBPatchProperties { - IntervalInMilliSeconds = 300, - Multiplier = 15, + ImportRouteTargets = { "65046:10039" }, + ExportRouteTargets = { "65046:10039" }, + RouteTargets = new RouteTargetPatchInformation + { + ImportIPv4RouteTargets = { "65046:10050" }, + ImportIPv6RouteTargets = { "65046:10050" }, + ExportIPv4RouteTargets = { "65046:10050" }, + ExportIPv6RouteTargets = { "65046:10050" }, + }, + }, + OptionAProperties = new ExternalNetworkPatchOptionAProperties + { + PrimaryIPv4Prefix = "10.1.1.0/30", + PrimaryIPv6Prefix = "3FFE:FFFF:0:CD30::a0/126", + SecondaryIPv4Prefix = "10.1.1.4/30", + SecondaryIPv6Prefix = "3FFE:FFFF:0:CD30::a4/126", + Mtu = 1500, + VlanId = 1001, + PeerAsn = 65047L, + BfdConfiguration = new BfdPatchConfiguration + { + IntervalInMilliSeconds = 300, + Multiplier = 10, + }, + IngressAclId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + EgressAclId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + BmpConfigurationState = BmpConfigurationState.Enabled, + V4OverV6BgpSession = V4OverV6BgpSessionState.Enabled, + V6OverV4BgpSession = V6OverV4BgpSessionState.Enabled, + NativeIPv4PrefixLimits = {new PrefixLimitPatchProperties +{ +MaximumRoutes = 13, +Threshold = 24, +IdleTimeExpiry = 8, +}}, + NativeIPv6PrefixLimits = {new PrefixLimitPatchProperties +{ +MaximumRoutes = 13, +Threshold = 24, +IdleTimeExpiry = 8, +}}, + }, + StaticRouteConfiguration = new ExternalNetworkStaticRoutePatchConfiguration + { + BfdConfiguration = new BfdPatchConfiguration + { + IntervalInMilliSeconds = 300, + Multiplier = 10, + }, + IPv4Routes = { new StaticRoutePatchProperties("10.0.0.1/14", new string[] { "10.0.0.1" }) }, + IPv6Routes = { new StaticRoutePatchProperties("2fff::/64", new string[] { "3ffe::1" }) }, }, - IngressAclId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - EgressAclId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - PrimaryIPv4Prefix = "10.1.1.0/30", - PrimaryIPv6Prefix = "3FFE:FFFF:0:CD30::a0/126", - SecondaryIPv4Prefix = "10.1.1.4/30", - SecondaryIPv6Prefix = "3FFE:FFFF:0:CD30::a4/126", }, }; ArmOperation lro = await networkFabricExternalNetwork.UpdateAsync(WaitUntil.Completed, patch); @@ -156,7 +183,7 @@ public async Task Update_ExternalNetworksUpdateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task UpdateAdministrativeState_ExternalNetworksUpdateAdministrativeStateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_UpdateAdministrativeState_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/ExternalNetworks_UpdateAdministrativeState.json // this example is just showing the usage of "ExternalNetworks_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,18 +193,18 @@ public async Task UpdateAdministrativeState_ExternalNetworksUpdateAdministrative // this example assumes you already have this NetworkFabricExternalNetworkResource created on azure // for more information of creating NetworkFabricExternalNetworkResource, please refer to the document of NetworkFabricExternalNetworkResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l3IsolationDomainName = "example-l3domain"; - string externalNetworkName = "example-externalnetwork"; + string l3IsolationDomainName = "example-externalnetwork"; + string externalNetworkName = "example-ext"; ResourceIdentifier networkFabricExternalNetworkResourceId = NetworkFabricExternalNetworkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName); NetworkFabricExternalNetworkResource networkFabricExternalNetwork = client.GetNetworkFabricExternalNetworkResource(networkFabricExternalNetworkResourceId); // invoke the operation UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent { + ResourceIds = { "" }, State = AdministrativeEnableState.Enable, - ResourceIds = { new ResourceIdentifier("") }, }; ArmOperation lro = await networkFabricExternalNetwork.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); StateUpdateCommonPostActionResult result = lro.Value; @@ -187,10 +214,10 @@ public async Task UpdateAdministrativeState_ExternalNetworksUpdateAdministrative [Test] [Ignore("Only validating compilation of examples")] - public async Task UpdateStaticRouteBfdAdministrativeState_ExternalNetworksUpdateStaticRouteBfdAdministrativeStateMaximumSetGen() + public async Task UpdateBfdAdministrativeState_ExternalNetworksUpdateBfdAdministrativeState() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_UpdateStaticRouteBfdAdministrativeState_MaximumSet_Gen.json - // this example is just showing the usage of "ExternalNetworks_UpdateStaticRouteBfdAdministrativeState" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/ExternalNetworks_UpdateBfdAdministrativeState.json + // this example is just showing the usage of "ExternalNetworks_UpdateBfdAdministrativeState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -199,21 +226,21 @@ public async Task UpdateStaticRouteBfdAdministrativeState_ExternalNetworksUpdate // this example assumes you already have this NetworkFabricExternalNetworkResource created on azure // for more information of creating NetworkFabricExternalNetworkResource, please refer to the document of NetworkFabricExternalNetworkResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l3IsolationDomainName = "example-l3domain"; - string externalNetworkName = "example-externalnetwork"; + string l3IsolationDomainName = "example-externalnetwork"; + string externalNetworkName = "example-ext"; ResourceIdentifier networkFabricExternalNetworkResourceId = NetworkFabricExternalNetworkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName, externalNetworkName); NetworkFabricExternalNetworkResource networkFabricExternalNetwork = client.GetNetworkFabricExternalNetworkResource(networkFabricExternalNetworkResourceId); // invoke the operation - UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent + ExternalNetworkBfdAdministrativeStateContent content = new ExternalNetworkBfdAdministrativeStateContent { - State = AdministrativeEnableState.Enable, - ResourceIds = { new ResourceIdentifier("") }, + RouteType = ExternalNetworkRouteType.Static, + AdministrativeState = new BfdAdministrativeState("Enable"), }; - ArmOperation lro = await networkFabricExternalNetwork.UpdateStaticRouteBfdAdministrativeStateAsync(WaitUntil.Completed, content); - StateUpdateCommonPostActionResult result = lro.Value; + ArmOperation lro = await networkFabricExternalNetwork.UpdateBfdAdministrativeStateAsync(WaitUntil.Completed, content); + ExternalNetworkBfdAdministrativeStateResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPCommunityCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPCommunityCollection.cs index aca2f0392269..b435d86285e7 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPCommunityCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPCommunityCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_NetworkFabricIPCommunityCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_IpCommunitiesCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpCommunities_Create.json // this example is just showing the usage of "IpCommunities_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task CreateOrUpdate_IpCommunitiesCreateMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -41,16 +41,20 @@ public async Task CreateOrUpdate_IpCommunitiesCreateMaximumSetGen() // invoke the operation string ipCommunityName = "example-ipcommunity"; - NetworkFabricIPCommunityData data = new NetworkFabricIPCommunityData(new AzureLocation("eastus")) + NetworkFabricIPCommunityData data = new NetworkFabricIPCommunityData(new AzureLocation("eastus"), new IPCommunityProperties(new IPCommunityRule[] { - Annotation = "annotation", - IPCommunityRules = {new IPCommunityRule(CommunityActionType.Permit, 4155123341L, new string[]{"1:1"}) +new IPCommunityRule(CommunityActionType.Permit, 4155123341L, new string[]{"1:1"}) { WellKnownCommunities = {WellKnownCommunity.Internet}, -}}, +} + }) + { + Annotation = "annotation", + }) + { Tags = { -["keyId"] = "KeyValue" +["KeyId"] = "KeyValue" }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, ipCommunityName, data); @@ -67,7 +71,7 @@ public async Task CreateOrUpdate_IpCommunitiesCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_IpCommunitiesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpCommunities_Get.json // this example is just showing the usage of "IpCommunities_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,7 +81,7 @@ public async Task Get_IpCommunitiesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -100,7 +104,7 @@ public async Task Get_IpCommunitiesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_IpCommunitiesListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpCommunities_ListByResourceGroup.json // this example is just showing the usage of "IpCommunities_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -110,7 +114,7 @@ public async Task GetAll_IpCommunitiesListByResourceGroupMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -135,7 +139,7 @@ public async Task GetAll_IpCommunitiesListByResourceGroupMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_IpCommunitiesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpCommunities_Get.json // this example is just showing the usage of "IpCommunities_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -145,7 +149,7 @@ public async Task Exists_IpCommunitiesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -164,7 +168,7 @@ public async Task Exists_IpCommunitiesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_IpCommunitiesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpCommunities_Get.json // this example is just showing the usage of "IpCommunities_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +178,7 @@ public async Task GetIfExists_IpCommunitiesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPCommunityResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPCommunityResource.cs index 12fc969a3e2f..54862232b93d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPCommunityResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPCommunityResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkFabricIPCommunityResource [Ignore("Only validating compilation of examples")] public async Task Get_IpCommunitiesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpCommunities_Get.json // this example is just showing the usage of "IpCommunities_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_IpCommunitiesGetMaximumSetGen() // this example assumes you already have this NetworkFabricIPCommunityResource created on azure // for more information of creating NetworkFabricIPCommunityResource, please refer to the document of NetworkFabricIPCommunityResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string ipCommunityName = "example-ipcommunity"; ResourceIdentifier networkFabricIPCommunityResourceId = NetworkFabricIPCommunityResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, ipCommunityName); @@ -50,7 +50,7 @@ public async Task Get_IpCommunitiesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_IpCommunitiesDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpCommunities_Delete.json // this example is just showing the usage of "IpCommunities_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task Delete_IpCommunitiesDeleteMaximumSetGen() // this example assumes you already have this NetworkFabricIPCommunityResource created on azure // for more information of creating NetworkFabricIPCommunityResource, please refer to the document of NetworkFabricIPCommunityResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string ipCommunityName = "example-ipcommunity"; ResourceIdentifier networkFabricIPCommunityResourceId = NetworkFabricIPCommunityResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, ipCommunityName); @@ -76,7 +76,7 @@ public async Task Delete_IpCommunitiesDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_IpCommunitiesUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpCommunities_Update.json // this example is just showing the usage of "IpCommunities_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Update_IpCommunitiesUpdateMaximumSetGen() // this example assumes you already have this NetworkFabricIPCommunityResource created on azure // for more information of creating NetworkFabricIPCommunityResource, please refer to the document of NetworkFabricIPCommunityResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string ipCommunityName = "example-ipcommunity"; ResourceIdentifier networkFabricIPCommunityResourceId = NetworkFabricIPCommunityResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, ipCommunityName); @@ -95,6 +95,10 @@ public async Task Update_IpCommunitiesUpdateMaximumSetGen() // invoke the operation NetworkFabricIPCommunityPatch patch = new NetworkFabricIPCommunityPatch { + Tags = +{ +["keyID"] = "KeyValue" +}, IPCommunityRules = {new IPCommunityRule(CommunityActionType.Permit, 4155123341L, new string[]{"1:1"}) { WellKnownCommunities = {WellKnownCommunity.Internet}, diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPExtendedCommunityCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPExtendedCommunityCollection.cs index 14465a3f54ec..538deb86455e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPExtendedCommunityCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPExtendedCommunityCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_NetworkFabricIPExtendedCommunityCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_IpExtendedCommunitiesCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpExtendedCommunities_Create.json // this example is just showing the usage of "IpExtendedCommunities_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task CreateOrUpdate_IpExtendedCommunitiesCreateMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -41,15 +41,17 @@ public async Task CreateOrUpdate_IpExtendedCommunitiesCreateMaximumSetGen() // invoke the operation string ipExtendedCommunityName = "example-ipExtendedCommunity"; - NetworkFabricIPExtendedCommunityData data = new NetworkFabricIPExtendedCommunityData(new AzureLocation("eastus"), new IPExtendedCommunityRule[] + NetworkFabricIPExtendedCommunityData data = new NetworkFabricIPExtendedCommunityData(new AzureLocation("eastus"), new IPExtendedCommunityProperties(new IPExtendedCommunityRule[] { new IPExtendedCommunityRule(CommunityActionType.Permit, 4155123341L, new string[]{"1234:2345"}) }) { Annotation = "annotation", + }) + { Tags = { -["keyID"] = "KeyValue" +["KeyId"] = "KeyValue" }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, ipExtendedCommunityName, data); @@ -66,7 +68,7 @@ public async Task CreateOrUpdate_IpExtendedCommunitiesCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_IpExtendedCommunitiesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpExtendedCommunities_Get.json // this example is just showing the usage of "IpExtendedCommunities_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +78,7 @@ public async Task Get_IpExtendedCommunitiesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -99,7 +101,7 @@ public async Task Get_IpExtendedCommunitiesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_IpExtendedCommunitiesListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpExtendedCommunities_ListByResourceGroup.json // this example is just showing the usage of "IpExtendedCommunities_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -109,7 +111,7 @@ public async Task GetAll_IpExtendedCommunitiesListByResourceGroupMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -134,7 +136,7 @@ public async Task GetAll_IpExtendedCommunitiesListByResourceGroupMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_IpExtendedCommunitiesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpExtendedCommunities_Get.json // this example is just showing the usage of "IpExtendedCommunities_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -144,7 +146,7 @@ public async Task Exists_IpExtendedCommunitiesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -163,7 +165,7 @@ public async Task Exists_IpExtendedCommunitiesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_IpExtendedCommunitiesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpExtendedCommunities_Get.json // this example is just showing the usage of "IpExtendedCommunities_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -173,7 +175,7 @@ public async Task GetIfExists_IpExtendedCommunitiesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPExtendedCommunityResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPExtendedCommunityResource.cs index b566d8153479..e86be1b24b18 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPExtendedCommunityResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPExtendedCommunityResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkFabricIPExtendedCommunityResource [Ignore("Only validating compilation of examples")] public async Task Get_IpExtendedCommunitiesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpExtendedCommunities_Get.json // this example is just showing the usage of "IpExtendedCommunities_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_IpExtendedCommunitiesGetMaximumSetGen() // this example assumes you already have this NetworkFabricIPExtendedCommunityResource created on azure // for more information of creating NetworkFabricIPExtendedCommunityResource, please refer to the document of NetworkFabricIPExtendedCommunityResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string ipExtendedCommunityName = "example-ipExtendedCommunity"; ResourceIdentifier networkFabricIPExtendedCommunityResourceId = NetworkFabricIPExtendedCommunityResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, ipExtendedCommunityName); @@ -50,7 +50,7 @@ public async Task Get_IpExtendedCommunitiesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_IpExtendedCommunitiesDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpExtendedCommunities_Delete.json // this example is just showing the usage of "IpExtendedCommunities_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task Delete_IpExtendedCommunitiesDeleteMaximumSetGen() // this example assumes you already have this NetworkFabricIPExtendedCommunityResource created on azure // for more information of creating NetworkFabricIPExtendedCommunityResource, please refer to the document of NetworkFabricIPExtendedCommunityResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string ipExtendedCommunityName = "example-ipExtendedCommunity"; ResourceIdentifier networkFabricIPExtendedCommunityResourceId = NetworkFabricIPExtendedCommunityResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, ipExtendedCommunityName); @@ -76,7 +76,7 @@ public async Task Delete_IpExtendedCommunitiesDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_IpExtendedCommunitiesUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpExtendedCommunities_Update.json // this example is just showing the usage of "IpExtendedCommunities_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Update_IpExtendedCommunitiesUpdateMaximumSetGen() // this example assumes you already have this NetworkFabricIPExtendedCommunityResource created on azure // for more information of creating NetworkFabricIPExtendedCommunityResource, please refer to the document of NetworkFabricIPExtendedCommunityResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string ipExtendedCommunityName = "example-ipExtendedCommunity"; ResourceIdentifier networkFabricIPExtendedCommunityResourceId = NetworkFabricIPExtendedCommunityResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, ipExtendedCommunityName); @@ -95,11 +95,15 @@ public async Task Update_IpExtendedCommunitiesUpdateMaximumSetGen() // invoke the operation NetworkFabricIPExtendedCommunityPatch patch = new NetworkFabricIPExtendedCommunityPatch { - IPExtendedCommunityRules = { new IPExtendedCommunityRule(CommunityActionType.Permit, 4155123341L, new string[] { "1234:2345" }) }, Tags = { -["keyID"] = "KeyValue" +["KeyId"] = "KeyValue" }, + Properties = new IPExtendedCommunityPatchProperties + { + Annotation = "annotation", + IPExtendedCommunityRules = { new IPExtendedCommunityRule(CommunityActionType.Permit, 4155123341L, new string[] { "1234:2345" }) }, + }, }; ArmOperation lro = await networkFabricIPExtendedCommunity.UpdateAsync(WaitUntil.Completed, patch); NetworkFabricIPExtendedCommunityResource result = lro.Value; diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPPrefixCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPPrefixCollection.cs index 23b78ea56457..d1e4a2e03092 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPPrefixCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPPrefixCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_NetworkFabricIPPrefixCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_IpPrefixesCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpPrefixes_Create.json // this example is just showing the usage of "IpPrefixes_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task CreateOrUpdate_IpPrefixesCreateMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -41,17 +41,21 @@ public async Task CreateOrUpdate_IpPrefixesCreateMaximumSetGen() // invoke the operation string ipPrefixName = "example-ipPrefix"; - NetworkFabricIPPrefixData data = new NetworkFabricIPPrefixData(new AzureLocation("eastus")) + NetworkFabricIPPrefixData data = new NetworkFabricIPPrefixData(new AzureLocation("eastus"), new IPPrefixProperties(new IPPrefixRule[] { - Annotation = "annotation", - IPPrefixRules = {new IPPrefixRule(CommunityActionType.Permit, 4155123341L, "10.10.10.10/30") +new IPPrefixRule(CommunityActionType.Permit, 4155123341L, "10.10.10.10/30") { Condition = IPPrefixRuleCondition.GreaterThanOrEqualTo, SubnetMaskLength = "10", -}}, +} + }) + { + Annotation = "annotation", + }) + { Tags = { -["keyID"] = "KeyValue" +["KeyId"] = "KeyValue" }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, ipPrefixName, data); @@ -68,7 +72,7 @@ public async Task CreateOrUpdate_IpPrefixesCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_IpPrefixesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpPrefixes_Get.json // this example is just showing the usage of "IpPrefixes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +82,7 @@ public async Task Get_IpPrefixesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -101,7 +105,7 @@ public async Task Get_IpPrefixesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_IpPrefixesListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpPrefixes_ListByResourceGroup.json // this example is just showing the usage of "IpPrefixes_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -111,7 +115,7 @@ public async Task GetAll_IpPrefixesListByResourceGroupMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -136,7 +140,7 @@ public async Task GetAll_IpPrefixesListByResourceGroupMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_IpPrefixesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpPrefixes_Get.json // this example is just showing the usage of "IpPrefixes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -146,7 +150,7 @@ public async Task Exists_IpPrefixesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -165,7 +169,7 @@ public async Task Exists_IpPrefixesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_IpPrefixesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpPrefixes_Get.json // this example is just showing the usage of "IpPrefixes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -175,7 +179,7 @@ public async Task GetIfExists_IpPrefixesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPPrefixResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPPrefixResource.cs index 18c607d5472c..3ab7ab53a7ab 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPPrefixResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricIPPrefixResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkFabricIPPrefixResource [Ignore("Only validating compilation of examples")] public async Task Get_IpPrefixesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpPrefixes_Get.json // this example is just showing the usage of "IpPrefixes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_IpPrefixesGetMaximumSetGen() // this example assumes you already have this NetworkFabricIPPrefixResource created on azure // for more information of creating NetworkFabricIPPrefixResource, please refer to the document of NetworkFabricIPPrefixResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string ipPrefixName = "example-ipPrefix"; ResourceIdentifier networkFabricIPPrefixResourceId = NetworkFabricIPPrefixResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, ipPrefixName); @@ -50,7 +50,7 @@ public async Task Get_IpPrefixesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_IpPrefixesDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpPrefixes_Delete.json // this example is just showing the usage of "IpPrefixes_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task Delete_IpPrefixesDeleteMaximumSetGen() // this example assumes you already have this NetworkFabricIPPrefixResource created on azure // for more information of creating NetworkFabricIPPrefixResource, please refer to the document of NetworkFabricIPPrefixResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string ipPrefixName = "example-ipPrefix"; ResourceIdentifier networkFabricIPPrefixResourceId = NetworkFabricIPPrefixResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, ipPrefixName); @@ -76,7 +76,7 @@ public async Task Delete_IpPrefixesDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_IpPrefixesUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpPrefixes_Update.json // this example is just showing the usage of "IpPrefixes_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Update_IpPrefixesUpdateMaximumSetGen() // this example assumes you already have this NetworkFabricIPPrefixResource created on azure // for more information of creating NetworkFabricIPPrefixResource, please refer to the document of NetworkFabricIPPrefixResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string ipPrefixName = "example-ipPrefix"; ResourceIdentifier networkFabricIPPrefixResourceId = NetworkFabricIPPrefixResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, ipPrefixName); @@ -95,16 +95,19 @@ public async Task Update_IpPrefixesUpdateMaximumSetGen() // invoke the operation NetworkFabricIPPrefixPatch patch = new NetworkFabricIPPrefixPatch { - Annotation = "annotation", - IPPrefixRules = {new IPPrefixRule(CommunityActionType.Permit, 4155123341L, "10.10.10.10/30") + Tags = +{ +["KeyId"] = "KeyValue" +}, + Properties = new IPPrefixPatchProperties + { + Annotation = "annotation", + IPPrefixRules = {new IPPrefixRule(CommunityActionType.Permit, 4155123341L, "10.10.10.10/30") { Condition = IPPrefixRuleCondition.GreaterThanOrEqualTo, SubnetMaskLength = "10", }}, - Tags = -{ -["keyID"] = "KeyValue" -}, + }, }; ArmOperation lro = await networkFabricIPPrefix.UpdateAsync(WaitUntil.Completed, patch); NetworkFabricIPPrefixResource result = lro.Value; diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternalNetworkCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternalNetworkCollection.cs index 43f8806b338f..ac61a658b56a 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternalNetworkCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternalNetworkCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkFabricInternalNetworkCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_InternalNetworksCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternalNetworks_Create.json // this example is just showing the usage of "InternalNetworks_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,9 +30,9 @@ public async Task CreateOrUpdate_InternalNetworksCreateMaximumSetGen() // this example assumes you already have this NetworkFabricL3IsolationDomainResource created on azure // for more information of creating NetworkFabricL3IsolationDomainResource, please refer to the document of NetworkFabricL3IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l3IsolationDomainName = "example-l3domain"; + string l3IsolationDomainName = "example-l3isd"; ResourceIdentifier networkFabricL3IsolationDomainResourceId = NetworkFabricL3IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName); NetworkFabricL3IsolationDomainResource networkFabricL3IsolationDomain = client.GetNetworkFabricL3IsolationDomainResource(networkFabricL3IsolationDomainResourceId); @@ -53,8 +53,6 @@ public async Task CreateOrUpdate_InternalNetworksCreateMaximumSetGen() { Annotation = "annotation", }}, - ImportRoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ExportRoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), ImportRoutePolicy = new ImportRoutePolicy { ImportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), @@ -69,12 +67,13 @@ public async Task CreateOrUpdate_InternalNetworksCreateMaximumSetGen() EgressAclId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), IsMonitoringEnabled = IsMonitoringEnabled.True, Extension = StaticRouteConfigurationExtension.NoExtension, - BgpConfiguration = new InternalNetworkBgpConfiguration + BgpConfiguration = new BgpConfiguration { + Annotation = "annotation", BfdConfiguration = new BfdConfiguration { IntervalInMilliSeconds = 300, - Multiplier = 5, + Multiplier = 10, }, DefaultRouteOriginate = NetworkFabricBooleanValue.True, AllowAS = 10, @@ -90,19 +89,37 @@ public async Task CreateOrUpdate_InternalNetworksCreateMaximumSetGen() { Address = "2fff::", }}, - Annotation = "annotation", + BmpConfiguration = new InternalNetworkBmpProperties + { + NeighborIPExclusions = { "10.0.0.1" }, + BmpConfigurationState = BmpConfigurationState.Enabled, + }, + V4OverV6BgpSession = V4OverV6BgpSessionState.Enabled, + V6OverV4BgpSession = V6OverV4BgpSessionState.Enabled, }, - StaticRouteConfiguration = new InternalNetworkStaticRouteConfiguration + StaticRouteConfiguration = new StaticRouteConfiguration { - Extension = StaticRouteConfigurationExtension.NoExtension, BfdConfiguration = new BfdConfiguration { IntervalInMilliSeconds = 300, - Multiplier = 15, + Multiplier = 10, }, - IPv4Routes = { new StaticRouteProperties("jffgck", new string[] { "10.0.0.1" }) }, + IPv4Routes = { new StaticRouteProperties("10.0.0.1/24", new string[] { "10.0.0.1" }) }, IPv6Routes = { new StaticRouteProperties("2fff::/64", new string[] { "3ffe::1" }) }, + Extension = StaticRouteConfigurationExtension.NoExtension, }, + NativeIPv4PrefixLimits = {new PrefixLimitProperties +{ +MaximumRoutes = 23, +Threshold = 7, +IdleTimeExpiry = 28, +}}, + NativeIPv6PrefixLimits = {new PrefixLimitProperties +{ +MaximumRoutes = 23, +Threshold = 7, +IdleTimeExpiry = 28, +}}, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, internalNetworkName, data); NetworkFabricInternalNetworkResource result = lro.Value; @@ -118,7 +135,7 @@ public async Task CreateOrUpdate_InternalNetworksCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_InternalNetworksGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternalNetworks_Get.json // this example is just showing the usage of "InternalNetworks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,9 +145,9 @@ public async Task Get_InternalNetworksGetMaximumSetGen() // this example assumes you already have this NetworkFabricL3IsolationDomainResource created on azure // for more information of creating NetworkFabricL3IsolationDomainResource, please refer to the document of NetworkFabricL3IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l3IsolationDomainName = "example-l3domain"; + string l3IsolationDomainName = "example-l3isd"; ResourceIdentifier networkFabricL3IsolationDomainResourceId = NetworkFabricL3IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName); NetworkFabricL3IsolationDomainResource networkFabricL3IsolationDomain = client.GetNetworkFabricL3IsolationDomainResource(networkFabricL3IsolationDomainResourceId); @@ -152,7 +169,7 @@ public async Task Get_InternalNetworksGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_InternalNetworksListByL3IsolationDomainMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_ListByL3IsolationDomain_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternalNetworks_ListByL3IsolationDomain.json // this example is just showing the usage of "InternalNetworks_ListByL3IsolationDomain" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -162,9 +179,9 @@ public async Task GetAll_InternalNetworksListByL3IsolationDomainMaximumSetGen() // this example assumes you already have this NetworkFabricL3IsolationDomainResource created on azure // for more information of creating NetworkFabricL3IsolationDomainResource, please refer to the document of NetworkFabricL3IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l3IsolationDomainName = "example-l3domain"; + string l3IsolationDomainName = "example-l3isd"; ResourceIdentifier networkFabricL3IsolationDomainResourceId = NetworkFabricL3IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName); NetworkFabricL3IsolationDomainResource networkFabricL3IsolationDomain = client.GetNetworkFabricL3IsolationDomainResource(networkFabricL3IsolationDomainResourceId); @@ -188,7 +205,7 @@ public async Task GetAll_InternalNetworksListByL3IsolationDomainMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_InternalNetworksGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternalNetworks_Get.json // this example is just showing the usage of "InternalNetworks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -198,9 +215,9 @@ public async Task Exists_InternalNetworksGetMaximumSetGen() // this example assumes you already have this NetworkFabricL3IsolationDomainResource created on azure // for more information of creating NetworkFabricL3IsolationDomainResource, please refer to the document of NetworkFabricL3IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l3IsolationDomainName = "example-l3domain"; + string l3IsolationDomainName = "example-l3isd"; ResourceIdentifier networkFabricL3IsolationDomainResourceId = NetworkFabricL3IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName); NetworkFabricL3IsolationDomainResource networkFabricL3IsolationDomain = client.GetNetworkFabricL3IsolationDomainResource(networkFabricL3IsolationDomainResourceId); @@ -218,7 +235,7 @@ public async Task Exists_InternalNetworksGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_InternalNetworksGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternalNetworks_Get.json // this example is just showing the usage of "InternalNetworks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -228,9 +245,9 @@ public async Task GetIfExists_InternalNetworksGetMaximumSetGen() // this example assumes you already have this NetworkFabricL3IsolationDomainResource created on azure // for more information of creating NetworkFabricL3IsolationDomainResource, please refer to the document of NetworkFabricL3IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l3IsolationDomainName = "example-l3domain"; + string l3IsolationDomainName = "example-l3isd"; ResourceIdentifier networkFabricL3IsolationDomainResourceId = NetworkFabricL3IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName); NetworkFabricL3IsolationDomainResource networkFabricL3IsolationDomain = client.GetNetworkFabricL3IsolationDomainResource(networkFabricL3IsolationDomainResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternalNetworkResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternalNetworkResource.cs index d14833aa35b9..5dbc9b23e93d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternalNetworkResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternalNetworkResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkFabricInternalNetworkResource [Ignore("Only validating compilation of examples")] public async Task Get_InternalNetworksGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternalNetworks_Get.json // this example is just showing the usage of "InternalNetworks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,9 +30,9 @@ public async Task Get_InternalNetworksGetMaximumSetGen() // this example assumes you already have this NetworkFabricInternalNetworkResource created on azure // for more information of creating NetworkFabricInternalNetworkResource, please refer to the document of NetworkFabricInternalNetworkResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l3IsolationDomainName = "example-l3domain"; + string l3IsolationDomainName = "example-l3isd"; string internalNetworkName = "example-internalnetwork"; ResourceIdentifier networkFabricInternalNetworkResourceId = NetworkFabricInternalNetworkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName); NetworkFabricInternalNetworkResource networkFabricInternalNetwork = client.GetNetworkFabricInternalNetworkResource(networkFabricInternalNetworkResourceId); @@ -51,7 +51,7 @@ public async Task Get_InternalNetworksGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_InternalNetworksDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternalNetworks_Delete.json // this example is just showing the usage of "InternalNetworks_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,9 +61,9 @@ public async Task Delete_InternalNetworksDeleteMaximumSetGen() // this example assumes you already have this NetworkFabricInternalNetworkResource created on azure // for more information of creating NetworkFabricInternalNetworkResource, please refer to the document of NetworkFabricInternalNetworkResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l3IsolationDomainName = "example-l3domain"; + string l3IsolationDomainName = "example-l3isd"; string internalNetworkName = "example-internalnetwork"; ResourceIdentifier networkFabricInternalNetworkResourceId = NetworkFabricInternalNetworkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName); NetworkFabricInternalNetworkResource networkFabricInternalNetwork = client.GetNetworkFabricInternalNetworkResource(networkFabricInternalNetworkResourceId); @@ -78,7 +78,7 @@ public async Task Delete_InternalNetworksDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_InternalNetworksUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternalNetworks_Update.json // this example is just showing the usage of "InternalNetworks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,9 +88,9 @@ public async Task Update_InternalNetworksUpdateMaximumSetGen() // this example assumes you already have this NetworkFabricInternalNetworkResource created on azure // for more information of creating NetworkFabricInternalNetworkResource, please refer to the document of NetworkFabricInternalNetworkResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l3IsolationDomainName = "example-l3domain"; + string l3IsolationDomainName = "example-l3isd"; string internalNetworkName = "example-internalnetwork"; ResourceIdentifier networkFabricInternalNetworkResourceId = NetworkFabricInternalNetworkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName); NetworkFabricInternalNetworkResource networkFabricInternalNetwork = client.GetNetworkFabricInternalNetworkResource(networkFabricInternalNetworkResourceId); @@ -98,63 +98,83 @@ public async Task Update_InternalNetworksUpdateMaximumSetGen() // invoke the operation NetworkFabricInternalNetworkPatch patch = new NetworkFabricInternalNetworkPatch { - Annotation = "annotation", - Mtu = 1500, - ConnectedIPv4Subnets = {new ConnectedSubnet("10.0.0.0/24") + Properties = new InternalNetworkPatchProperties + { + Annotation = "annotation", + Mtu = 1500, + ConnectedIPv4Subnets = {new ConnectedSubnetPatch("10.0.0.0/24") { Annotation = "annotation", }}, - ConnectedIPv6Subnets = {new ConnectedSubnet("3FFE:FFFF:0:CD30::a0/29") + ConnectedIPv6Subnets = {new ConnectedSubnetPatch("10.0.0.0/24") { Annotation = "annotation", }}, - ImportRoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ExportRoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ImportRoutePolicy = new ImportRoutePolicy - { - ImportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ImportIPv6RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - }, - ExportRoutePolicy = new ExportRoutePolicy - { - ExportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ExportIPv6RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - }, - IngressAclId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - EgressAclId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - IsMonitoringEnabled = IsMonitoringEnabled.True, - BgpConfiguration = new BgpConfiguration - { - BfdConfiguration = new BfdConfiguration + ImportRoutePolicy = new ImportRoutePolicy + { + ImportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + ImportIPv6RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + }, + ExportRoutePolicy = new ExportRoutePolicy { - IntervalInMilliSeconds = 300, - Multiplier = 5, + ExportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + ExportIPv6RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), }, - DefaultRouteOriginate = NetworkFabricBooleanValue.True, - AllowAS = 10, - AllowASOverride = AllowASOverride.Enable, - PeerAsn = 61234L, - IPv4ListenRangePrefixes = { "10.1.0.0/25" }, - IPv6ListenRangePrefixes = { "2fff::/66" }, - IPv4NeighborAddress = {new NeighborAddress + IngressAclId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + EgressAclId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + IsMonitoringEnabled = IsMonitoringEnabled.True, + BgpConfiguration = new BgpPatchConfiguration + { + Annotation = "annotation", + BfdConfiguration = new BfdPatchConfiguration + { + IntervalInMilliSeconds = 300, + Multiplier = 10, + }, + DefaultRouteOriginate = NetworkFabricBooleanValue.True, + AllowAS = 10, + AllowASOverride = AllowASOverride.Enable, + PeerAsn = 61234L, + IPv4ListenRangePrefixes = { "10.1.0.0/25" }, + IPv6ListenRangePrefixes = { "2fff::/66" }, + IPv4NeighborAddress = {new NeighborAddressPatch { Address = "10.1.0.0", }}, - IPv6NeighborAddress = {new NeighborAddress + IPv6NeighborAddress = {new NeighborAddressPatch { -Address = "2fff::", +Address = "10.1.0.0", }}, - Annotation = "annotation", - }, - StaticRouteConfiguration = new StaticRouteConfiguration - { - BfdConfiguration = new BfdConfiguration + BmpConfiguration = new InternalNetworkBmpPatchProperties + { + NeighborIPExclusions = { "10.0.0.10" }, + BmpConfigurationState = BmpConfigurationState.Enabled, + }, + V4OverV6BgpSession = V4OverV6BgpSessionState.Enabled, + V6OverV4BgpSession = V6OverV4BgpSessionState.Enabled, + }, + StaticRouteConfiguration = new StaticRoutePatchConfiguration { - IntervalInMilliSeconds = 300, - Multiplier = 15, + BfdConfiguration = new BfdPatchConfiguration + { + IntervalInMilliSeconds = 300, + Multiplier = 10, + }, + IPv4Routes = { new StaticRoutePatchProperties("jffgck", new string[] { "10.0.0.1" }) }, + IPv6Routes = { new StaticRoutePatchProperties("jffgck", new string[] { "10.0.0.1" }) }, }, - IPv4Routes = { new StaticRouteProperties("20.20.20.20/25", new string[] { "10.0.0.1" }) }, - IPv6Routes = { new StaticRouteProperties("2fff::/64", new string[] { "3ffe::1" }) }, + NativeIPv4PrefixLimits = {new PrefixLimitPatchProperties +{ +MaximumRoutes = 24, +Threshold = 6, +IdleTimeExpiry = 20, +}}, + NativeIPv6PrefixLimits = {new PrefixLimitPatchProperties +{ +MaximumRoutes = 24, +Threshold = 6, +IdleTimeExpiry = 20, +}}, }, }; ArmOperation lro = await networkFabricInternalNetwork.UpdateAsync(WaitUntil.Completed, patch); @@ -171,7 +191,7 @@ public async Task Update_InternalNetworksUpdateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task UpdateAdministrativeState_InternalNetworksUpdateAdministrativeStateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_UpdateAdministrativeState_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternalNetworks_UpdateAdministrativeState.json // this example is just showing the usage of "InternalNetworks_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -181,9 +201,9 @@ public async Task UpdateAdministrativeState_InternalNetworksUpdateAdministrative // this example assumes you already have this NetworkFabricInternalNetworkResource created on azure // for more information of creating NetworkFabricInternalNetworkResource, please refer to the document of NetworkFabricInternalNetworkResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l3IsolationDomainName = "example-l3domain"; + string l3IsolationDomainName = "example-l3isd"; string internalNetworkName = "example-internalnetwork"; ResourceIdentifier networkFabricInternalNetworkResourceId = NetworkFabricInternalNetworkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName); NetworkFabricInternalNetworkResource networkFabricInternalNetwork = client.GetNetworkFabricInternalNetworkResource(networkFabricInternalNetworkResourceId); @@ -191,8 +211,8 @@ public async Task UpdateAdministrativeState_InternalNetworksUpdateAdministrative // invoke the operation UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent { + ResourceIds = { "" }, State = AdministrativeEnableState.Enable, - ResourceIds = { new ResourceIdentifier("") }, }; ArmOperation lro = await networkFabricInternalNetwork.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); StateUpdateCommonPostActionResult result = lro.Value; @@ -202,10 +222,10 @@ public async Task UpdateAdministrativeState_InternalNetworksUpdateAdministrative [Test] [Ignore("Only validating compilation of examples")] - public async Task UpdateBgpAdministrativeState_InternalNetworksUpdateBgpAdministrativeStateMaximumSetGen() + public async Task UpdateBfdAdministrativeState_InternalNetworksUpdateBfdAdministrativeState() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_UpdateBgpAdministrativeState_MaximumSet_Gen.json - // this example is just showing the usage of "InternalNetworks_UpdateBgpAdministrativeState" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternalNetworks_UpdateBfdAdministrativeState.json + // this example is just showing the usage of "InternalNetworks_UpdateBfdAdministrativeState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -214,31 +234,32 @@ public async Task UpdateBgpAdministrativeState_InternalNetworksUpdateBgpAdminist // this example assumes you already have this NetworkFabricInternalNetworkResource created on azure // for more information of creating NetworkFabricInternalNetworkResource, please refer to the document of NetworkFabricInternalNetworkResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l3IsolationDomainName = "example-l3domain"; - string internalNetworkName = "example-internalNetwork"; + string l3IsolationDomainName = "example-l3isd"; + string internalNetworkName = "example-internalnetwork"; ResourceIdentifier networkFabricInternalNetworkResourceId = NetworkFabricInternalNetworkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName); NetworkFabricInternalNetworkResource networkFabricInternalNetwork = client.GetNetworkFabricInternalNetworkResource(networkFabricInternalNetworkResourceId); // invoke the operation - UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent + InternalNetworkBfdAdministrativeStateContent content = new InternalNetworkBfdAdministrativeStateContent { - State = AdministrativeEnableState.Enable, - ResourceIds = { new ResourceIdentifier("") }, + RouteType = InternalNetworkRouteType.Static, + NeighborAddress = "10.10.1.10", + AdministrativeState = new BfdAdministrativeState("Enable"), }; - ArmOperation lro = await networkFabricInternalNetwork.UpdateBgpAdministrativeStateAsync(WaitUntil.Completed, content); - StateUpdateCommonPostActionResult result = lro.Value; + ArmOperation lro = await networkFabricInternalNetwork.UpdateBfdAdministrativeStateAsync(WaitUntil.Completed, content); + InternalNetworkBfdAdministrativeStateResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task UpdateStaticRouteBfdAdministrativeState_InternalNetworksUpdateStaticRouteBfdAdministrativeStateMaximumSetGen() + public async Task UpdateBgpAdministrativeState_InternalNetworksUpdateBgpAdministrativeStateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_UpdateStaticRouteBfdAdministrativeState_MaximumSet_Gen.json - // this example is just showing the usage of "InternalNetworks_UpdateStaticRouteBfdAdministrativeState" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternalNetworks_UpdateBgpAdministrativeState.json + // this example is just showing the usage of "InternalNetworks_UpdateBgpAdministrativeState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -247,21 +268,21 @@ public async Task UpdateStaticRouteBfdAdministrativeState_InternalNetworksUpdate // this example assumes you already have this NetworkFabricInternalNetworkResource created on azure // for more information of creating NetworkFabricInternalNetworkResource, please refer to the document of NetworkFabricInternalNetworkResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l3IsolationDomainName = "example-l3domain"; - string internalNetworkName = "example-internalNetwork"; + string l3IsolationDomainName = "example-l3isd"; + string internalNetworkName = "example-internalnetwork"; ResourceIdentifier networkFabricInternalNetworkResourceId = NetworkFabricInternalNetworkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName, internalNetworkName); NetworkFabricInternalNetworkResource networkFabricInternalNetwork = client.GetNetworkFabricInternalNetworkResource(networkFabricInternalNetworkResourceId); // invoke the operation - UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent + InternalNetworkBgpAdministrativeStateContent content = new InternalNetworkBgpAdministrativeStateContent { - State = AdministrativeEnableState.Enable, - ResourceIds = { new ResourceIdentifier("") }, + NeighborAddress = "10.10.10.10", + AdministrativeState = new BgpAdministrativeState("Enable"), }; - ArmOperation lro = await networkFabricInternalNetwork.UpdateStaticRouteBfdAdministrativeStateAsync(WaitUntil.Completed, content); - StateUpdateCommonPostActionResult result = lro.Value; + ArmOperation lro = await networkFabricInternalNetwork.UpdateBgpAdministrativeStateAsync(WaitUntil.Completed, content); + InternalNetworkBgpAdministrativeStateResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternetGatewayCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternetGatewayCollection.cs index 86980114f7ef..99237d9f0a86 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternetGatewayCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternetGatewayCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkFabricInternetGatewayCollection [Ignore("Only validating compilation of examples")] public async Task Get_InternetGatewaysGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternetGateways_Get.json // this example is just showing the usage of "InternetGateways_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_InternetGatewaysGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -53,7 +53,7 @@ public async Task Get_InternetGatewaysGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_InternetGatewaysListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternetGateways_ListByResourceGroup.json // this example is just showing the usage of "InternetGateways_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task GetAll_InternetGatewaysListByResourceGroupMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -88,7 +88,7 @@ public async Task GetAll_InternetGatewaysListByResourceGroupMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_InternetGatewaysGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternetGateways_Get.json // this example is just showing the usage of "InternetGateways_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +98,7 @@ public async Task Exists_InternetGatewaysGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -117,7 +117,7 @@ public async Task Exists_InternetGatewaysGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_InternetGatewaysGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternetGateways_Get.json // this example is just showing the usage of "InternetGateways_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +127,7 @@ public async Task GetIfExists_InternetGatewaysGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternetGatewayResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternetGatewayResource.cs index 5f3eeca9e7b4..d92e73eaa5ba 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternetGatewayResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternetGatewayResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkFabricInternetGatewayResource [Ignore("Only validating compilation of examples")] public async Task Get_InternetGatewaysGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternetGateways_Get.json // this example is just showing the usage of "InternetGateways_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_InternetGatewaysGetMaximumSetGen() // this example assumes you already have this NetworkFabricInternetGatewayResource created on azure // for more information of creating NetworkFabricInternetGatewayResource, please refer to the document of NetworkFabricInternetGatewayResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string internetGatewayName = "example-internetGateway"; ResourceIdentifier networkFabricInternetGatewayResourceId = NetworkFabricInternetGatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, internetGatewayName); @@ -50,7 +50,7 @@ public async Task Get_InternetGatewaysGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_InternetGatewaysUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternetGateways_Update.json // this example is just showing the usage of "InternetGateways_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task Update_InternetGatewaysUpdateMaximumSetGen() // this example assumes you already have this NetworkFabricInternetGatewayResource created on azure // for more information of creating NetworkFabricInternetGatewayResource, please refer to the document of NetworkFabricInternetGatewayResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string internetGatewayName = "example-internetGateway"; ResourceIdentifier networkFabricInternetGatewayResourceId = NetworkFabricInternetGatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, internetGatewayName); @@ -69,11 +69,11 @@ public async Task Update_InternetGatewaysUpdateMaximumSetGen() // invoke the operation NetworkFabricInternetGatewayPatch patch = new NetworkFabricInternetGatewayPatch { - InternetGatewayRuleId = new ResourceIdentifier("/subscriptions/xxxx-xxxx-xxxx-xxxx/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetGatewayRule"), Tags = { -["key81"] = "2345" +["keyId"] = "KeyValue" }, + InternetGatewayRuleId = new ResourceIdentifier("/subscriptions/xxxx-xxxx-xxxx-xxxx/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetGatewayRule"), }; ArmOperation lro = await networkFabricInternetGateway.UpdateAsync(WaitUntil.Completed, patch); NetworkFabricInternetGatewayResource result = lro.Value; diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternetGatewayRuleCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternetGatewayRuleCollection.cs index 0ad233cf0d42..d82ec36251c2 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternetGatewayRuleCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternetGatewayRuleCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_NetworkFabricInternetGatewayRuleCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_InternetGatewayRulesCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternetGatewayRules_Create.json // this example is just showing the usage of "InternetGatewayRules_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task CreateOrUpdate_InternetGatewayRulesCreateMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -41,12 +41,25 @@ public async Task CreateOrUpdate_InternetGatewayRulesCreateMaximumSetGen() // invoke the operation string internetGatewayRuleName = "example-internetGatewayRule"; - NetworkFabricInternetGatewayRuleData data = new NetworkFabricInternetGatewayRuleData(new AzureLocation("eastus"), new InternetGatewayRules(InternetGatewayRuleAction.Allow, new string[] { "10.10.10.10" })) + NetworkFabricInternetGatewayRuleData data = new NetworkFabricInternetGatewayRuleData(new AzureLocation("eastus"), new InternetGatewayRuleProperties(new InternetGatewayRules(InternetGatewayRuleAction.Allow) + { + AddressList = { "10.10.10.10" }, + Condition = RuleCondition.Or, + DestinationAddressList = { "11.11.10.11" }, + SourceAddressList = { "10.10.10.10" }, + HeaderAddressList = {new HeaderAddressProperties +{ +HeaderName = "abcHeader", +AddressList = {"10.10.10.10"}, +}}, + }) { Annotation = "annotationValue", + }) + { Tags = { -["keyID"] = "keyValue" +["KeyID"] = "KeyValue" }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, internetGatewayRuleName, data); @@ -63,7 +76,7 @@ public async Task CreateOrUpdate_InternetGatewayRulesCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_InternetGatewayRulesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternetGatewayRules_Get.json // this example is just showing the usage of "InternetGatewayRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -73,7 +86,7 @@ public async Task Get_InternetGatewayRulesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -96,7 +109,7 @@ public async Task Get_InternetGatewayRulesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_InternetGatewayRulesListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternetGatewayRules_ListByResourceGroup.json // this example is just showing the usage of "InternetGatewayRules_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -106,7 +119,7 @@ public async Task GetAll_InternetGatewayRulesListByResourceGroupMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-internetGatewayRule"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -131,7 +144,7 @@ public async Task GetAll_InternetGatewayRulesListByResourceGroupMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_InternetGatewayRulesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternetGatewayRules_Get.json // this example is just showing the usage of "InternetGatewayRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -141,7 +154,7 @@ public async Task Exists_InternetGatewayRulesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -160,7 +173,7 @@ public async Task Exists_InternetGatewayRulesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_InternetGatewayRulesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternetGatewayRules_Get.json // this example is just showing the usage of "InternetGatewayRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +183,7 @@ public async Task GetIfExists_InternetGatewayRulesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternetGatewayRuleResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternetGatewayRuleResource.cs index 0694250a5527..3df79faca7e0 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternetGatewayRuleResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricInternetGatewayRuleResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkFabricInternetGatewayRuleResource [Ignore("Only validating compilation of examples")] public async Task Get_InternetGatewayRulesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternetGatewayRules_Get.json // this example is just showing the usage of "InternetGatewayRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_InternetGatewayRulesGetMaximumSetGen() // this example assumes you already have this NetworkFabricInternetGatewayRuleResource created on azure // for more information of creating NetworkFabricInternetGatewayRuleResource, please refer to the document of NetworkFabricInternetGatewayRuleResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string internetGatewayRuleName = "example-internetGatewayRule"; ResourceIdentifier networkFabricInternetGatewayRuleResourceId = NetworkFabricInternetGatewayRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, internetGatewayRuleName); @@ -50,7 +50,7 @@ public async Task Get_InternetGatewayRulesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_InternetGatewayRulesDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternetGatewayRules_Delete.json // this example is just showing the usage of "InternetGatewayRules_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task Delete_InternetGatewayRulesDeleteMaximumSetGen() // this example assumes you already have this NetworkFabricInternetGatewayRuleResource created on azure // for more information of creating NetworkFabricInternetGatewayRuleResource, please refer to the document of NetworkFabricInternetGatewayRuleResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string internetGatewayRuleName = "example-internetGatewayRule"; ResourceIdentifier networkFabricInternetGatewayRuleResourceId = NetworkFabricInternetGatewayRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, internetGatewayRuleName); @@ -76,7 +76,7 @@ public async Task Delete_InternetGatewayRulesDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_InternetGatewayRulesUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternetGatewayRules_Update.json // this example is just showing the usage of "InternetGatewayRules_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Update_InternetGatewayRulesUpdateMaximumSetGen() // this example assumes you already have this NetworkFabricInternetGatewayRuleResource created on azure // for more information of creating NetworkFabricInternetGatewayRuleResource, please refer to the document of NetworkFabricInternetGatewayRuleResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string internetGatewayRuleName = "example-internetGatewayRule"; ResourceIdentifier networkFabricInternetGatewayRuleResourceId = NetworkFabricInternetGatewayRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, internetGatewayRuleName); @@ -97,7 +97,7 @@ public async Task Update_InternetGatewayRulesUpdateMaximumSetGen() { Tags = { -["key3311"] = "1234" +["KeyID"] = "KeyValue1" }, }; ArmOperation lro = await networkFabricInternetGatewayRule.UpdateAsync(WaitUntil.Completed, patch); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricL2IsolationDomainCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricL2IsolationDomainCollection.cs index f72b107b6d43..855eaa81cf0e 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricL2IsolationDomainCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricL2IsolationDomainCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.ManagedNetworkFabric.Models; using Azure.ResourceManager.Resources; using NUnit.Framework; @@ -20,7 +21,7 @@ public partial class Sample_NetworkFabricL2IsolationDomainCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_L2IsolationDomainsCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L2IsolationDomains_Create.json // this example is just showing the usage of "L2IsolationDomains_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +31,7 @@ public async Task CreateOrUpdate_L2IsolationDomainsCreateMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -40,13 +41,17 @@ public async Task CreateOrUpdate_L2IsolationDomainsCreateMaximumSetGen() // invoke the operation string l2IsolationDomainName = "example-l2domain"; - NetworkFabricL2IsolationDomainData data = new NetworkFabricL2IsolationDomainData(new AzureLocation("eastus"), new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), 501) + NetworkFabricL2IsolationDomainData data = new NetworkFabricL2IsolationDomainData(new AzureLocation("eastus"), new L2IsolationDomainProperties(new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), 501) { Annotation = "annotation", Mtu = 1500, + ExtendedVlan = ExtendedVlan.Enabled, + NetworkToNetworkInterconnectId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + }) + { Tags = { -["keyID"] = "keyValue" +["KeyId"] = "KeyValue" }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, l2IsolationDomainName, data); @@ -63,7 +68,7 @@ public async Task CreateOrUpdate_L2IsolationDomainsCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_L2IsolationDomainsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L2IsolationDomains_Get.json // this example is just showing the usage of "L2IsolationDomains_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -73,7 +78,7 @@ public async Task Get_L2IsolationDomainsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -82,7 +87,7 @@ public async Task Get_L2IsolationDomainsGetMaximumSetGen() NetworkFabricL2IsolationDomainCollection collection = resourceGroupResource.GetNetworkFabricL2IsolationDomains(); // invoke the operation - string l2IsolationDomainName = "example-l2Domain"; + string l2IsolationDomainName = "example-l2domain"; NetworkFabricL2IsolationDomainResource result = await collection.GetAsync(l2IsolationDomainName); // the variable result is a resource, you could call other operations on this instance as well @@ -96,7 +101,7 @@ public async Task Get_L2IsolationDomainsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_L2IsolationDomainsListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L2IsolationDomains_ListByResourceGroup.json // this example is just showing the usage of "L2IsolationDomains_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -106,7 +111,7 @@ public async Task GetAll_L2IsolationDomainsListByResourceGroupMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -131,7 +136,7 @@ public async Task GetAll_L2IsolationDomainsListByResourceGroupMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_L2IsolationDomainsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L2IsolationDomains_Get.json // this example is just showing the usage of "L2IsolationDomains_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -141,7 +146,7 @@ public async Task Exists_L2IsolationDomainsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -150,7 +155,7 @@ public async Task Exists_L2IsolationDomainsGetMaximumSetGen() NetworkFabricL2IsolationDomainCollection collection = resourceGroupResource.GetNetworkFabricL2IsolationDomains(); // invoke the operation - string l2IsolationDomainName = "example-l2Domain"; + string l2IsolationDomainName = "example-l2domain"; bool result = await collection.ExistsAsync(l2IsolationDomainName); Console.WriteLine($"Succeeded: {result}"); @@ -160,7 +165,7 @@ public async Task Exists_L2IsolationDomainsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_L2IsolationDomainsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L2IsolationDomains_Get.json // this example is just showing the usage of "L2IsolationDomains_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +175,7 @@ public async Task GetIfExists_L2IsolationDomainsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -179,7 +184,7 @@ public async Task GetIfExists_L2IsolationDomainsGetMaximumSetGen() NetworkFabricL2IsolationDomainCollection collection = resourceGroupResource.GetNetworkFabricL2IsolationDomains(); // invoke the operation - string l2IsolationDomainName = "example-l2Domain"; + string l2IsolationDomainName = "example-l2domain"; NullableResponse response = await collection.GetIfExistsAsync(l2IsolationDomainName); NetworkFabricL2IsolationDomainResource result = response.HasValue ? response.Value : null; diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricL2IsolationDomainResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricL2IsolationDomainResource.cs index f2799aada0b7..411496efdfb7 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricL2IsolationDomainResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricL2IsolationDomainResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkFabricL2IsolationDomainResource [Ignore("Only validating compilation of examples")] public async Task Get_L2IsolationDomainsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L2IsolationDomains_Get.json // this example is just showing the usage of "L2IsolationDomains_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,9 +30,9 @@ public async Task Get_L2IsolationDomainsGetMaximumSetGen() // this example assumes you already have this NetworkFabricL2IsolationDomainResource created on azure // for more information of creating NetworkFabricL2IsolationDomainResource, please refer to the document of NetworkFabricL2IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l2IsolationDomainName = "example-l2Domain"; + string l2IsolationDomainName = "example-l2domain"; ResourceIdentifier networkFabricL2IsolationDomainResourceId = NetworkFabricL2IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l2IsolationDomainName); NetworkFabricL2IsolationDomainResource networkFabricL2IsolationDomain = client.GetNetworkFabricL2IsolationDomainResource(networkFabricL2IsolationDomainResourceId); @@ -50,7 +50,7 @@ public async Task Get_L2IsolationDomainsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_L2IsolationDomainsDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L2IsolationDomains_Delete.json // this example is just showing the usage of "L2IsolationDomains_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,9 +60,9 @@ public async Task Delete_L2IsolationDomainsDeleteMaximumSetGen() // this example assumes you already have this NetworkFabricL2IsolationDomainResource created on azure // for more information of creating NetworkFabricL2IsolationDomainResource, please refer to the document of NetworkFabricL2IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l2IsolationDomainName = "example-l2Domain"; + string l2IsolationDomainName = "example-l2domain"; ResourceIdentifier networkFabricL2IsolationDomainResourceId = NetworkFabricL2IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l2IsolationDomainName); NetworkFabricL2IsolationDomainResource networkFabricL2IsolationDomain = client.GetNetworkFabricL2IsolationDomainResource(networkFabricL2IsolationDomainResourceId); @@ -76,7 +76,7 @@ public async Task Delete_L2IsolationDomainsDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_L2IsolationDomainsUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L2IsolationDomains_Update.json // this example is just showing the usage of "L2IsolationDomains_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,21 +86,25 @@ public async Task Update_L2IsolationDomainsUpdateMaximumSetGen() // this example assumes you already have this NetworkFabricL2IsolationDomainResource created on azure // for more information of creating NetworkFabricL2IsolationDomainResource, please refer to the document of NetworkFabricL2IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l2IsolationDomainName = "example-l2Domain"; + string l2IsolationDomainName = "example-l2domain"; ResourceIdentifier networkFabricL2IsolationDomainResourceId = NetworkFabricL2IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l2IsolationDomainName); NetworkFabricL2IsolationDomainResource networkFabricL2IsolationDomain = client.GetNetworkFabricL2IsolationDomainResource(networkFabricL2IsolationDomainResourceId); // invoke the operation NetworkFabricL2IsolationDomainPatch patch = new NetworkFabricL2IsolationDomainPatch { - Annotation = "annotation1", - Mtu = 6000, Tags = { -["keyID"] = "keyValue" +["KeyId"] = "KeyValue" }, + Properties = new L2IsolationDomainPatchProperties + { + Annotation = "annotation1", + Mtu = 6000, + NetworkToNetworkInterconnectId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + }, }; ArmOperation lro = await networkFabricL2IsolationDomain.UpdateAsync(WaitUntil.Completed, patch); NetworkFabricL2IsolationDomainResource result = lro.Value; @@ -114,10 +118,10 @@ public async Task Update_L2IsolationDomainsUpdateMaximumSetGen() [Test] [Ignore("Only validating compilation of examples")] - public async Task UpdateAdministrativeState_L2IsolationDomainsUpdateAdministrativeStateMaximumSetGen() + public async Task CommitConfiguration_L2IsolationDomainsCommitConfigurationMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_updateAdministrativeState_MaximumSet_Gen.json - // this example is just showing the usage of "L2IsolationDomains_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L2IsolationDomains_CommitConfiguration.json + // this example is just showing the usage of "L2IsolationDomains_CommitConfiguration" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -126,30 +130,25 @@ public async Task UpdateAdministrativeState_L2IsolationDomainsUpdateAdministrati // this example assumes you already have this NetworkFabricL2IsolationDomainResource created on azure // for more information of creating NetworkFabricL2IsolationDomainResource, please refer to the document of NetworkFabricL2IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string l2IsolationDomainName = "example-l2Domain"; + string l2IsolationDomainName = "example-l2domain"; ResourceIdentifier networkFabricL2IsolationDomainResourceId = NetworkFabricL2IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l2IsolationDomainName); NetworkFabricL2IsolationDomainResource networkFabricL2IsolationDomain = client.GetNetworkFabricL2IsolationDomainResource(networkFabricL2IsolationDomainResourceId); // invoke the operation - UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent - { - State = AdministrativeEnableState.Enable, - ResourceIds = { new ResourceIdentifier("") }, - }; - ArmOperation lro = await networkFabricL2IsolationDomain.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); - DeviceUpdateCommonPostActionResult result = lro.Value; + ArmOperation lro = await networkFabricL2IsolationDomain.CommitConfigurationAsync(WaitUntil.Completed); + StateUpdateCommonPostActionResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task ValidateConfiguration_L2IsolationDomainsValidateConfigurationMaximumSetGen() + public async Task UpdateAdministrativeState_L2IsolationDomainsUpdateAdministrativeStateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_ValidateConfiguration_MaximumSet_Gen.json - // this example is just showing the usage of "L2IsolationDomains_ValidateConfiguration" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L2IsolationDomains_UpdateAdministrativeState.json + // this example is just showing the usage of "L2IsolationDomains_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -158,25 +157,30 @@ public async Task ValidateConfiguration_L2IsolationDomainsValidateConfigurationM // this example assumes you already have this NetworkFabricL2IsolationDomainResource created on azure // for more information of creating NetworkFabricL2IsolationDomainResource, please refer to the document of NetworkFabricL2IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string l2IsolationDomainName = "example-l2domain"; ResourceIdentifier networkFabricL2IsolationDomainResourceId = NetworkFabricL2IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l2IsolationDomainName); NetworkFabricL2IsolationDomainResource networkFabricL2IsolationDomain = client.GetNetworkFabricL2IsolationDomainResource(networkFabricL2IsolationDomainResourceId); // invoke the operation - ArmOperation lro = await networkFabricL2IsolationDomain.ValidateConfigurationAsync(WaitUntil.Completed); - ValidateConfigurationResult result = lro.Value; + UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent + { + ResourceIds = { "" }, + State = AdministrativeEnableState.Enable, + }; + ArmOperation lro = await networkFabricL2IsolationDomain.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); + DeviceUpdateCommonPostActionResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task CommitConfiguration_L2IsolationDomainsCommitConfigurationMaximumSetGen() + public async Task ValidateConfiguration_L2IsolationDomainsValidateConfigurationMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_CommitConfiguration_MaximumSet_Gen.json - // this example is just showing the usage of "L2IsolationDomains_CommitConfiguration" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L2IsolationDomains_ValidateConfiguration.json + // this example is just showing the usage of "L2IsolationDomains_ValidateConfiguration" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -185,15 +189,15 @@ public async Task CommitConfiguration_L2IsolationDomainsCommitConfigurationMaxim // this example assumes you already have this NetworkFabricL2IsolationDomainResource created on azure // for more information of creating NetworkFabricL2IsolationDomainResource, please refer to the document of NetworkFabricL2IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string l2IsolationDomainName = "example-l2domain"; ResourceIdentifier networkFabricL2IsolationDomainResourceId = NetworkFabricL2IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l2IsolationDomainName); NetworkFabricL2IsolationDomainResource networkFabricL2IsolationDomain = client.GetNetworkFabricL2IsolationDomainResource(networkFabricL2IsolationDomainResourceId); // invoke the operation - ArmOperation lro = await networkFabricL2IsolationDomain.CommitConfigurationAsync(WaitUntil.Completed); - StateUpdateCommonPostActionResult result = lro.Value; + ArmOperation lro = await networkFabricL2IsolationDomain.ValidateConfigurationAsync(WaitUntil.Completed); + ValidateConfigurationResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricL3IsolationDomainCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricL3IsolationDomainCollection.cs index 7a42dd78ddf2..018bd2fc935f 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricL3IsolationDomainCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricL3IsolationDomainCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_NetworkFabricL3IsolationDomainCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_L3IsolationDomainsCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L3IsolationDomains_Create.json // this example is just showing the usage of "L3IsolationDomains_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task CreateOrUpdate_L3IsolationDomainsCreateMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -41,28 +41,36 @@ public async Task CreateOrUpdate_L3IsolationDomainsCreateMaximumSetGen() // invoke the operation string l3IsolationDomainName = "example-l3domain"; - NetworkFabricL3IsolationDomainData data = new NetworkFabricL3IsolationDomainData(new AzureLocation("eastus"), new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric")) + NetworkFabricL3IsolationDomainData data = new NetworkFabricL3IsolationDomainData(new AzureLocation("eastus"), new L3IsolationDomainProperties(new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric")) { Annotation = "annotation", RedistributeConnectedSubnets = RedistributeConnectedSubnet.True, - RedistributeStaticRoutes = RedistributeStaticRoute.False, + RedistributeStaticRoutes = RedistributeStaticRoute.True, AggregateRouteConfiguration = new AggregateRouteConfiguration { IPv4Routes = { new AggregateRoute("10.0.0.0/24") }, IPv6Routes = { new AggregateRoute("3FFE:FFFF:0:CD30::a0/29") }, }, - ConnectedSubnetRoutePolicy = new ConnectedSubnetRoutePolicy + ConnectedExportRoutePolicy = new L3ExportRoutePolicy { - ExportRoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ExportRoutePolicy = new L3ExportRoutePolicy - { - ExportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - ExportIPv6RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - }, + ExportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + ExportIPv6RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), }, + ExportRoutePolicy = new L3ExportRoutePolicy + { + ExportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + ExportIPv6RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + }, + RoutePrefixLimit = new RoutePrefixLimitProperties + { + HardLimit = 1, + Threshold = 90, + }, + }) + { Tags = { -["keyID"] = "KeyValue" +["KeyId"] = "KeyValue" }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, l3IsolationDomainName, data); @@ -79,7 +87,7 @@ public async Task CreateOrUpdate_L3IsolationDomainsCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_L3IsolationDomainsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L3IsolationDomains_Get.json // this example is just showing the usage of "L3IsolationDomains_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +97,7 @@ public async Task Get_L3IsolationDomainsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -112,7 +120,7 @@ public async Task Get_L3IsolationDomainsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_L3IsolationDomainsListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L3IsolationDomains_ListByResourceGroup.json // this example is just showing the usage of "L3IsolationDomains_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +130,7 @@ public async Task GetAll_L3IsolationDomainsListByResourceGroupMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -147,7 +155,7 @@ public async Task GetAll_L3IsolationDomainsListByResourceGroupMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_L3IsolationDomainsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L3IsolationDomains_Get.json // this example is just showing the usage of "L3IsolationDomains_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -157,7 +165,7 @@ public async Task Exists_L3IsolationDomainsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -176,7 +184,7 @@ public async Task Exists_L3IsolationDomainsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_L3IsolationDomainsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L3IsolationDomains_Get.json // this example is just showing the usage of "L3IsolationDomains_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -186,7 +194,7 @@ public async Task GetIfExists_L3IsolationDomainsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricL3IsolationDomainResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricL3IsolationDomainResource.cs index ac1a7b833f86..64e963806648 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricL3IsolationDomainResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricL3IsolationDomainResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkFabricL3IsolationDomainResource [Ignore("Only validating compilation of examples")] public async Task Get_L3IsolationDomainsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L3IsolationDomains_Get.json // this example is just showing the usage of "L3IsolationDomains_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_L3IsolationDomainsGetMaximumSetGen() // this example assumes you already have this NetworkFabricL3IsolationDomainResource created on azure // for more information of creating NetworkFabricL3IsolationDomainResource, please refer to the document of NetworkFabricL3IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string l3IsolationDomainName = "example-l3domain"; ResourceIdentifier networkFabricL3IsolationDomainResourceId = NetworkFabricL3IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName); @@ -50,7 +50,7 @@ public async Task Get_L3IsolationDomainsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_L3IsolationDomainsDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L3IsolationDomains_Delete.json // this example is just showing the usage of "L3IsolationDomains_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task Delete_L3IsolationDomainsDeleteMaximumSetGen() // this example assumes you already have this NetworkFabricL3IsolationDomainResource created on azure // for more information of creating NetworkFabricL3IsolationDomainResource, please refer to the document of NetworkFabricL3IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string l3IsolationDomainName = "example-l3domain"; ResourceIdentifier networkFabricL3IsolationDomainResourceId = NetworkFabricL3IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName); @@ -76,7 +76,7 @@ public async Task Delete_L3IsolationDomainsDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_L3IsolationDomainsUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L3IsolationDomains_Update.json // this example is just showing the usage of "L3IsolationDomains_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Update_L3IsolationDomainsUpdateMaximumSetGen() // this example assumes you already have this NetworkFabricL3IsolationDomainResource created on azure // for more information of creating NetworkFabricL3IsolationDomainResource, please refer to the document of NetworkFabricL3IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string l3IsolationDomainName = "example-l3domain"; ResourceIdentifier networkFabricL3IsolationDomainResourceId = NetworkFabricL3IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName); @@ -95,27 +95,36 @@ public async Task Update_L3IsolationDomainsUpdateMaximumSetGen() // invoke the operation NetworkFabricL3IsolationDomainPatch patch = new NetworkFabricL3IsolationDomainPatch { - Annotation = "annotation1", - RedistributeConnectedSubnets = RedistributeConnectedSubnet.True, - RedistributeStaticRoutes = RedistributeStaticRoute.False, - AggregateRouteConfiguration = new AggregateRouteConfiguration - { - IPv4Routes = { new AggregateRoute("10.0.0.0/24") }, - IPv6Routes = { new AggregateRoute("3FFE:FFFF:0:CD30::a0/29") }, - }, - ConnectedSubnetRoutePolicy = new ConnectedSubnetRoutePolicy + Tags = +{ +["KeyId"] = "KeyValue" +}, + Properties = new L3IsolationDomainPatchProperties { - ExportRoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ExportRoutePolicy = new L3ExportRoutePolicy + Annotation = "annotation1", + RedistributeConnectedSubnets = RedistributeConnectedSubnet.True, + RedistributeStaticRoutes = RedistributeStaticRoute.True, + AggregateRouteConfiguration = new AggregateRoutePatchConfiguration + { + IPv4Routes = { new AggregateRoute("10.0.0.0/24") }, + IPv6Routes = { new AggregateRoute("3FFE:FFFF:0:CD30::a0/29") }, + }, + ConnectedExportRoutePolicy = new L3ExportRoutePolicyPatch + { + ExportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + ExportIPv6RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + }, + ExportRoutePolicy = new L3ExportRoutePolicyPatch { - ExportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), - ExportIPv6RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), + ExportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + ExportIPv6RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + }, + RoutePrefixLimit = new RoutePrefixLimitPatchProperties + { + HardLimit = 28, + Threshold = 50, }, }, - Tags = -{ -["key4953"] = "1234" -}, }; ArmOperation lro = await networkFabricL3IsolationDomain.UpdateAsync(WaitUntil.Completed, patch); NetworkFabricL3IsolationDomainResource result = lro.Value; @@ -129,10 +138,10 @@ public async Task Update_L3IsolationDomainsUpdateMaximumSetGen() [Test] [Ignore("Only validating compilation of examples")] - public async Task UpdateAdministrativeState_L3IsolationDomainsUpdateAdministrativeStateMaximumSetGen() + public async Task CommitConfiguration_L3IsolationDomainsCommitConfigurationMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_updateAdministrativeState_MaximumSet_Gen.json - // this example is just showing the usage of "L3IsolationDomains_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L3IsolationDomains_CommitConfiguration.json + // this example is just showing the usage of "L3IsolationDomains_CommitConfiguration" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -141,30 +150,25 @@ public async Task UpdateAdministrativeState_L3IsolationDomainsUpdateAdministrati // this example assumes you already have this NetworkFabricL3IsolationDomainResource created on azure // for more information of creating NetworkFabricL3IsolationDomainResource, please refer to the document of NetworkFabricL3IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string l3IsolationDomainName = "example-l3domain"; ResourceIdentifier networkFabricL3IsolationDomainResourceId = NetworkFabricL3IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName); NetworkFabricL3IsolationDomainResource networkFabricL3IsolationDomain = client.GetNetworkFabricL3IsolationDomainResource(networkFabricL3IsolationDomainResourceId); // invoke the operation - UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent - { - State = AdministrativeEnableState.Enable, - ResourceIds = { new ResourceIdentifier("") }, - }; - ArmOperation lro = await networkFabricL3IsolationDomain.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); - DeviceUpdateCommonPostActionResult result = lro.Value; + ArmOperation lro = await networkFabricL3IsolationDomain.CommitConfigurationAsync(WaitUntil.Completed); + StateUpdateCommonPostActionResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task ValidateConfiguration_L3IsolationDomainsValidateConfigurationMaximumSetGen() + public async Task UpdateAdministrativeState_L3IsolationDomainsUpdateAdministrativeStateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_ValidateConfiguration_MaximumSet_Gen.json - // this example is just showing the usage of "L3IsolationDomains_ValidateConfiguration" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L3IsolationDomains_UpdateAdministrativeState.json + // this example is just showing the usage of "L3IsolationDomains_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -173,25 +177,30 @@ public async Task ValidateConfiguration_L3IsolationDomainsValidateConfigurationM // this example assumes you already have this NetworkFabricL3IsolationDomainResource created on azure // for more information of creating NetworkFabricL3IsolationDomainResource, please refer to the document of NetworkFabricL3IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string l3IsolationDomainName = "example-l3domain"; ResourceIdentifier networkFabricL3IsolationDomainResourceId = NetworkFabricL3IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName); NetworkFabricL3IsolationDomainResource networkFabricL3IsolationDomain = client.GetNetworkFabricL3IsolationDomainResource(networkFabricL3IsolationDomainResourceId); // invoke the operation - ArmOperation lro = await networkFabricL3IsolationDomain.ValidateConfigurationAsync(WaitUntil.Completed); - ValidateConfigurationResult result = lro.Value; + UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent + { + ResourceIds = { "" }, + State = AdministrativeEnableState.Enable, + }; + ArmOperation lro = await networkFabricL3IsolationDomain.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); + DeviceUpdateCommonPostActionResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task CommitConfiguration_L3IsolationDomainsCommitConfigurationMaximumSetGen() + public async Task ValidateConfiguration_L3IsolationDomainsValidateConfigurationMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_CommitConfiguration_MaximumSet_Gen.json - // this example is just showing the usage of "L3IsolationDomains_CommitConfiguration" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L3IsolationDomains_ValidateConfiguration.json + // this example is just showing the usage of "L3IsolationDomains_ValidateConfiguration" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -200,15 +209,15 @@ public async Task CommitConfiguration_L3IsolationDomainsCommitConfigurationMaxim // this example assumes you already have this NetworkFabricL3IsolationDomainResource created on azure // for more information of creating NetworkFabricL3IsolationDomainResource, please refer to the document of NetworkFabricL3IsolationDomainResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string l3IsolationDomainName = "example-l3domain"; ResourceIdentifier networkFabricL3IsolationDomainResourceId = NetworkFabricL3IsolationDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, l3IsolationDomainName); NetworkFabricL3IsolationDomainResource networkFabricL3IsolationDomain = client.GetNetworkFabricL3IsolationDomainResource(networkFabricL3IsolationDomainResourceId); // invoke the operation - ArmOperation lro = await networkFabricL3IsolationDomain.CommitConfigurationAsync(WaitUntil.Completed); - StateUpdateCommonPostActionResult result = lro.Value; + ArmOperation lro = await networkFabricL3IsolationDomain.ValidateConfigurationAsync(WaitUntil.Completed); + ValidateConfigurationResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricNeighborGroupCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricNeighborGroupCollection.cs index 989041b70e0f..a2ccc7084a34 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricNeighborGroupCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricNeighborGroupCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_NetworkFabricNeighborGroupCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_NeighborGroupsCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NeighborGroups_Create.json // this example is just showing the usage of "NeighborGroups_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -32,7 +32,7 @@ public async Task CreateOrUpdate_NeighborGroupsCreateMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -42,17 +42,18 @@ public async Task CreateOrUpdate_NeighborGroupsCreateMaximumSetGen() // invoke the operation string neighborGroupName = "example-neighborGroup"; - NetworkFabricNeighborGroupData data = new NetworkFabricNeighborGroupData(new AzureLocation("eastus")) + NetworkFabricNeighborGroupData data = new NetworkFabricNeighborGroupData(new AzureLocation("eastus"), new NeighborGroupProperties(new NeighborGroupDestination + { + IPv4Addresses = { IPAddress.Parse("10.10.10.10"), IPAddress.Parse("20.10.10.10"), IPAddress.Parse("30.10.10.10"), IPAddress.Parse("40.10.10.10"), IPAddress.Parse("50.10.10.10"), IPAddress.Parse("60.10.10.10"), IPAddress.Parse("70.10.10.10"), IPAddress.Parse("80.10.10.10"), IPAddress.Parse("90.10.10.10") }, + IPv6Addresses = { "2F::/100" }, + }) { Annotation = "annotation", - Destination = new NeighborGroupDestination - { - IPv4Addresses = { IPAddress.Parse("10.10.10.10"), IPAddress.Parse("20.10.10.10"), IPAddress.Parse("30.10.10.10"), IPAddress.Parse("40.10.10.10"), IPAddress.Parse("50.10.10.10"), IPAddress.Parse("60.10.10.10"), IPAddress.Parse("70.10.10.10"), IPAddress.Parse("80.10.10.10"), IPAddress.Parse("90.10.10.10") }, - IPv6Addresses = { "2F::/100" }, - }, + }) + { Tags = { -["key8107"] = "1234" +["KeyId"] = "KeyValue" }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, neighborGroupName, data); @@ -69,7 +70,7 @@ public async Task CreateOrUpdate_NeighborGroupsCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_NeighborGroupsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NeighborGroups_Get.json // this example is just showing the usage of "NeighborGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -79,7 +80,7 @@ public async Task Get_NeighborGroupsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -102,7 +103,7 @@ public async Task Get_NeighborGroupsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_NeighborGroupsListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NeighborGroups_ListByResourceGroup.json // this example is just showing the usage of "NeighborGroups_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -112,7 +113,7 @@ public async Task GetAll_NeighborGroupsListByResourceGroupMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -137,7 +138,7 @@ public async Task GetAll_NeighborGroupsListByResourceGroupMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_NeighborGroupsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NeighborGroups_Get.json // this example is just showing the usage of "NeighborGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -147,7 +148,7 @@ public async Task Exists_NeighborGroupsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -166,7 +167,7 @@ public async Task Exists_NeighborGroupsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_NeighborGroupsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NeighborGroups_Get.json // this example is just showing the usage of "NeighborGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -176,7 +177,7 @@ public async Task GetIfExists_NeighborGroupsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricNeighborGroupResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricNeighborGroupResource.cs index ce9953c2b1a3..b248668beebc 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricNeighborGroupResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricNeighborGroupResource.cs @@ -6,7 +6,6 @@ #nullable disable using System; -using System.Net; using System.Threading.Tasks; using Azure.Core; using Azure.Identity; @@ -21,7 +20,7 @@ public partial class Sample_NetworkFabricNeighborGroupResource [Ignore("Only validating compilation of examples")] public async Task Get_NeighborGroupsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NeighborGroups_Get.json // this example is just showing the usage of "NeighborGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +30,7 @@ public async Task Get_NeighborGroupsGetMaximumSetGen() // this example assumes you already have this NetworkFabricNeighborGroupResource created on azure // for more information of creating NetworkFabricNeighborGroupResource, please refer to the document of NetworkFabricNeighborGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string neighborGroupName = "example-neighborGroup"; ResourceIdentifier networkFabricNeighborGroupResourceId = NetworkFabricNeighborGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, neighborGroupName); @@ -51,7 +50,7 @@ public async Task Get_NeighborGroupsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_NeighborGroupsDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NeighborGroups_Delete.json // this example is just showing the usage of "NeighborGroups_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +60,7 @@ public async Task Delete_NeighborGroupsDeleteMaximumSetGen() // this example assumes you already have this NetworkFabricNeighborGroupResource created on azure // for more information of creating NetworkFabricNeighborGroupResource, please refer to the document of NetworkFabricNeighborGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string neighborGroupName = "example-neighborGroup"; ResourceIdentifier networkFabricNeighborGroupResourceId = NetworkFabricNeighborGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, neighborGroupName); @@ -77,7 +76,7 @@ public async Task Delete_NeighborGroupsDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_NeighborGroupsUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NeighborGroups_Update.json // this example is just showing the usage of "NeighborGroups_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,7 +86,7 @@ public async Task Update_NeighborGroupsUpdateMaximumSetGen() // this example assumes you already have this NetworkFabricNeighborGroupResource created on azure // for more information of creating NetworkFabricNeighborGroupResource, please refer to the document of NetworkFabricNeighborGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string neighborGroupName = "example-neighborGroup"; ResourceIdentifier networkFabricNeighborGroupResourceId = NetworkFabricNeighborGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, neighborGroupName); @@ -96,16 +95,19 @@ public async Task Update_NeighborGroupsUpdateMaximumSetGen() // invoke the operation NetworkFabricNeighborGroupPatch patch = new NetworkFabricNeighborGroupPatch { - Annotation = "Updating", - Destination = new NeighborGroupDestination - { - IPv4Addresses = { IPAddress.Parse("10.10.10.10"), IPAddress.Parse("20.10.10.10"), IPAddress.Parse("30.10.10.10"), IPAddress.Parse("40.10.10.10"), IPAddress.Parse("50.10.10.10"), IPAddress.Parse("60.10.10.10"), IPAddress.Parse("70.10.10.10"), IPAddress.Parse("80.10.10.10"), IPAddress.Parse("90.10.10.10") }, - IPv6Addresses = { "2F::/100" }, - }, Tags = { -["key8107"] = "2345" +["KeyId"] = "KeyValue" }, + Properties = new NeighborGroupPatchProperties + { + Annotation = "Updating", + Destination = new NeighborGroupDestinationPatch + { + IPv4Addresses = { "10.10.10.10", "20.10.10.10", "30.10.10.10", "40.10.10.10", "50.10.10.10", "60.10.10.10", "70.10.10.10", "80.10.10.10", "90.10.10.10" }, + IPv6Addresses = { "2F::/100" }, + }, + }, }; ArmOperation lro = await networkFabricNeighborGroup.UpdateAsync(WaitUntil.Completed, patch); NetworkFabricNeighborGroupResource result = lro.Value; diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricResource.cs index 77eff1186c1f..1a8a3d3ec881 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricResource.cs @@ -10,6 +10,7 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.ManagedNetworkFabric.Models; +using Azure.ResourceManager.Models; using NUnit.Framework; namespace Azure.ResourceManager.ManagedNetworkFabric.Samples @@ -20,7 +21,7 @@ public partial class Sample_NetworkFabricResource [Ignore("Only validating compilation of examples")] public async Task Get_NetworkFabricsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_Get.json // this example is just showing the usage of "NetworkFabrics_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +31,7 @@ public async Task Get_NetworkFabricsGetMaximumSetGen() // this example assumes you already have this NetworkFabricResource created on azure // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkFabricName = "example-fabric"; ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); @@ -50,7 +51,7 @@ public async Task Get_NetworkFabricsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_NetworkFabricsDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_Delete.json // this example is just showing the usage of "NetworkFabrics_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +61,7 @@ public async Task Delete_NetworkFabricsDeleteMaximumSetGen() // this example assumes you already have this NetworkFabricResource created on azure // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkFabricName = "example-fabric"; ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); @@ -76,7 +77,7 @@ public async Task Delete_NetworkFabricsDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_NetworkFabricsUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_Update.json // this example is just showing the usage of "NetworkFabrics_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +87,7 @@ public async Task Update_NetworkFabricsUpdateMaximumSetGen() // this example assumes you already have this NetworkFabricResource created on azure // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkFabricName = "example-fabric"; ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); @@ -95,93 +96,121 @@ public async Task Update_NetworkFabricsUpdateMaximumSetGen() // invoke the operation NetworkFabricPatch patch = new NetworkFabricPatch { - Annotation = "annotation1", - RackCount = 6, - ServerCountPerRack = 10, - IPv4Prefix = "10.18.0.0/17", - IPv6Prefix = "3FFE:FFFF:0:CD40::/60", - FabricAsn = 12345L, - TerminalServerConfiguration = new NetworkFabricPatchablePropertiesTerminalServerConfiguration - { - PrimaryIPv4Prefix = "10.0.0.12/30", - PrimaryIPv6Prefix = "4FFE:FFFF:0:CD30::a8/127", - SecondaryIPv4Prefix = "40.0.0.14/30", - SecondaryIPv6Prefix = "6FFE:FFFF:0:CD30::ac/127", - Username = "username1", - Password = "xxxxxxxx", - SerialNumber = "1234567", - }, - ManagementNetworkConfiguration = new ManagementNetworkConfigurationPatchableProperties + Tags = +{ +["keyId"] = "keyValue" +}, + Properties = new NetworkFabricPatchProperties { - InfrastructureVpnConfiguration = new VpnConfigurationPatchableProperties + Annotation = "annotation1", + RackCount = 6, + ServerCountPerRack = 10, + IPv4Prefix = "10.18.0.0/17", + IPv6Prefix = "3FFE:FFFF:0:CD40::/60", + FabricAsn = 12345L, + StorageAccountConfiguration = new StorageAccountPatchConfiguration { - NetworkToNetworkInterconnectId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - PeeringOption = PeeringOption.OptionB, - OptionBProperties = new OptionBProperties - { - ImportRouteTargets = { "65046:10050" }, - ExportRouteTargets = { "65046:10050" }, - RouteTargets = new RouteTargetInformation - { - ImportIPv4RouteTargets = { "65046:10050" }, - ImportIPv6RouteTargets = { "65046:10050" }, - ExportIPv4RouteTargets = { "65046:10050" }, - ExportIPv6RouteTargets = { "65046:10050" }, - }, - }, - OptionAProperties = new VpnConfigurationPatchableOptionAProperties + StorageAccountId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Storage/storageAccounts/nfStorage"), + StorageAccountIdentity = new IdentitySelectorPatch { - PrimaryIPv4Prefix = "10.0.0.12/30", - PrimaryIPv6Prefix = "4FFE:FFFF:0:CD30::a8/127", - SecondaryIPv4Prefix = "20.0.0.13/30", - SecondaryIPv6Prefix = "6FFE:FFFF:0:CD30::ac/127", - Mtu = 1501, - VlanId = 3001, - PeerAsn = 1235L, - BfdConfiguration = new BfdConfiguration - { - IntervalInMilliSeconds = 300, - Multiplier = 10, - }, + IdentityType = ManagedServiceIdentitySelectorType.UserAssignedIdentity, + UserAssignedIdentityResourceId = new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789abc/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-id"), }, }, - WorkloadVpnConfiguration = new VpnConfigurationPatchableProperties + TerminalServerConfiguration = new TerminalServerPatchConfiguration { - NetworkToNetworkInterconnectId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - PeeringOption = PeeringOption.OptionA, - OptionBProperties = new OptionBProperties + Username = "username1", + Password = "xxxxxxxx", + SerialNumber = "1234567", + PrimaryIPv4Prefix = "10.0.0.12/30", + PrimaryIPv6Prefix = "4FFE:FFFF:0:CD30::a8/127", + SecondaryIPv4Prefix = "40.0.0.14/30", + SecondaryIPv6Prefix = "6FFE:FFFF:0:CD30::ac/127", + }, + ManagementNetworkConfiguration = new ManagementNetworkPatchConfiguration + { + InfrastructureVpnConfiguration = new VpnConfigurationPatchableProperties { - ImportRouteTargets = { "65046:10050" }, - ExportRouteTargets = { "65046:10050" }, - RouteTargets = new RouteTargetInformation + NetworkToNetworkInterconnectId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + PeeringOption = PeeringOption.OptionA, + OptionBProperties = new VpnOptionBPatchProperties + { + ImportRouteTargets = { "65046:10050" }, + ExportRouteTargets = { "65046:10050" }, + RouteTargets = new RouteTargetPatchInformation + { + ImportIPv4RouteTargets = { "65046:10050" }, + ImportIPv6RouteTargets = { "65046:10050" }, + ExportIPv4RouteTargets = { "65046:10050" }, + ExportIPv6RouteTargets = { "65046:10050" }, + }, + }, + OptionAProperties = new VpnOptionAPatchProperties { - ImportIPv4RouteTargets = { "65046:10050" }, - ImportIPv6RouteTargets = { "65046:10050" }, - ExportIPv4RouteTargets = { "65046:10050" }, - ExportIPv6RouteTargets = { "65046:10050" }, + Mtu = 1501, + VlanId = 3001, + PeerAsn = 1235L, + BfdConfiguration = new BfdPatchConfiguration + { + IntervalInMilliSeconds = 300, + Multiplier = 10, + }, + PrimaryIPv4Prefix = "10.0.0.12/30", + PrimaryIPv6Prefix = "4FFE:FFFF:0:CD30::a8/127", + SecondaryIPv4Prefix = "20.0.0.13/30", + SecondaryIPv6Prefix = "6FFE:FFFF:0:CD30::ac/127", }, }, - OptionAProperties = new VpnConfigurationPatchableOptionAProperties + WorkloadVpnConfiguration = new VpnConfigurationPatchableProperties { - PrimaryIPv4Prefix = "10.0.0.14/30", - PrimaryIPv6Prefix = "2FFE:FFFF:0:CD30::a7/126", - SecondaryIPv4Prefix = "10.0.0.15/30", - SecondaryIPv6Prefix = "2FFE:FFFF:0:CD30::ac/126", - Mtu = 1500, - VlanId = 3000, - PeerAsn = 61234L, - BfdConfiguration = new BfdConfiguration + NetworkToNetworkInterconnectId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + PeeringOption = PeeringOption.OptionA, + OptionBProperties = new VpnOptionBPatchProperties { - IntervalInMilliSeconds = 300, - Multiplier = 5, + ImportRouteTargets = { "65046:10050" }, + ExportRouteTargets = { "65046:10050" }, + RouteTargets = new RouteTargetPatchInformation + { + ImportIPv4RouteTargets = { "65046:10050" }, + ImportIPv6RouteTargets = { "65046:10050" }, + ExportIPv4RouteTargets = { "65046:10050" }, + ExportIPv6RouteTargets = { "65046:10050" }, + }, + }, + OptionAProperties = new VpnOptionAPatchProperties + { + Mtu = 1500, + VlanId = 3000, + PeerAsn = 61234L, + BfdConfiguration = new BfdPatchConfiguration + { + IntervalInMilliSeconds = 300, + Multiplier = 10, + }, + PrimaryIPv4Prefix = "10.0.0.14/30", + PrimaryIPv6Prefix = "2FFE:FFFF:0:CD30::a7/126", + SecondaryIPv4Prefix = "10.0.0.15/30", + SecondaryIPv6Prefix = "2FFE:FFFF:0:CD30::ac/126", }, }, }, + HardwareAlertThreshold = 43, + ControlPlaneAcls = { new ResourceIdentifier("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl") }, + TrustedIPPrefixes = { new ResourceIdentifier("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-prefix") }, + UniqueRdConfiguration = new UniqueRouteDistinguisherPatchProperties + { + UniqueRdConfigurationState = UniqueRouteDistinguisherConfigurationState.Enabled, + NniDerivedUniqueRdConfigurationState = NNIDerivedUniqueRouteDistinguisherConfigurationState.Enabled, + }, }, - Tags = + Identity = new ManagedServiceIdentityPatch + { + IdentityType = Models.ManagedServiceIdentityType.None, + UserAssignedIdentities = { -["keyID"] = "KeyValue" +["key872"] = new UserAssignedIdentity() }, + }, }; ArmOperation lro = await networkFabric.UpdateAsync(WaitUntil.Completed, patch); NetworkFabricResource result = lro.Value; @@ -195,10 +224,10 @@ public async Task Update_NetworkFabricsUpdateMaximumSetGen() [Test] [Ignore("Only validating compilation of examples")] - public async Task Provision_NetworkFabricsProvisionMaximumSetGen() + public async Task ArmConfigurationDiff_NetworkFabricsArmConfigurationDiffMaximumSet() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_provision_MaximumSet_Gen.json - // this example is just showing the usage of "NetworkFabrics_Provision" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_ArmConfigurationDiff.json + // this example is just showing the usage of "NetworkFabrics_ArmConfigurationDiff" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -207,15 +236,73 @@ public async Task Provision_NetworkFabricsProvisionMaximumSetGen() // this example assumes you already have this NetworkFabricResource created on azure // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkFabricName = "example-fabric"; ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); NetworkFabricResource networkFabric = client.GetNetworkFabricResource(networkFabricResourceId); // invoke the operation - ArmOperation lro = await networkFabric.ProvisionAsync(WaitUntil.Completed); - DeviceUpdateCommonPostActionResult result = lro.Value; + ArmOperation lro = await networkFabric.ArmConfigurationDiffAsync(WaitUntil.Completed); + ArmConfigurationDiffResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CommitBatchStatus_NetworkFabricsCommitBatchStatusMaximumSet() + { + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_CommitBatchStatus.json + // this example is just showing the usage of "NetworkFabrics_CommitBatchStatus" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NetworkFabricResource created on azure + // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; + string resourceGroupName = "example-rg"; + string networkFabricName = "example-fabric"; + ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); + NetworkFabricResource networkFabric = client.GetNetworkFabricResource(networkFabricResourceId); + + // invoke the operation + CommitBatchStatusContent content = new CommitBatchStatusContent + { + CommitBatchId = "batch-id", + }; + ArmOperation lro = await networkFabric.CommitBatchStatusAsync(WaitUntil.Completed, content); + CommitBatchStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CommitConfiguration_NetworkFabricsCommitConfigurationMaximumSetGen() + { + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_CommitConfiguration.json + // this example is just showing the usage of "NetworkFabrics_CommitConfiguration" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NetworkFabricResource created on azure + // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; + string resourceGroupName = "example-rg"; + string networkFabricName = "example-networkFabric"; + ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); + NetworkFabricResource networkFabric = client.GetNetworkFabricResource(networkFabricResourceId); + + // invoke the operation + ArmOperation lro = await networkFabric.CommitConfigurationAsync(WaitUntil.Completed); + StateUpdateCommonPostActionResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } @@ -224,7 +311,7 @@ public async Task Provision_NetworkFabricsProvisionMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Deprovision_NetworkFabricsDeprovisionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_deprovision_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_Deprovision.json // this example is just showing the usage of "NetworkFabrics_Deprovision" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -234,7 +321,7 @@ public async Task Deprovision_NetworkFabricsDeprovisionMaximumSetGen() // this example assumes you already have this NetworkFabricResource created on azure // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkFabricName = "example-fabric"; ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); @@ -249,10 +336,41 @@ public async Task Deprovision_NetworkFabricsDeprovisionMaximumSetGen() [Test] [Ignore("Only validating compilation of examples")] - public async Task Upgrade_NetworkFabricsUpgradeMaximumSetGen() + public async Task DiscardCommitBatch_NetworkFabricsDiscardCommitBatch() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_upgrade_MaximumSet_Gen.json - // this example is just showing the usage of "NetworkFabrics_Upgrade" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_DiscardCommitBatch.json + // this example is just showing the usage of "NetworkFabrics_DiscardCommitBatch" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NetworkFabricResource created on azure + // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; + string resourceGroupName = "example-rg"; + string networkFabricName = "example-fabric"; + ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); + NetworkFabricResource networkFabric = client.GetNetworkFabricResource(networkFabricResourceId); + + // invoke the operation + DiscardCommitBatchContent content = new DiscardCommitBatchContent + { + CommitBatchId = "batchId1", + }; + ArmOperation lro = await networkFabric.DiscardCommitBatchAsync(WaitUntil.Completed, content); + DiscardCommitBatchResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetTopology_NetworkFabricsGetTopologyMaximumSetGen() + { + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_GetTopology.json + // this example is just showing the usage of "NetworkFabrics_GetTopology" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -261,28 +379,83 @@ public async Task Upgrade_NetworkFabricsUpgradeMaximumSetGen() // this example assumes you already have this NetworkFabricResource created on azure // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkFabricName = "example-fabric"; ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); NetworkFabricResource networkFabric = client.GetNetworkFabricResource(networkFabricResourceId); // invoke the operation - NetworkFabricUpdateVersionContent content = new NetworkFabricUpdateVersionContent + ArmOperation lro = await networkFabric.GetTopologyAsync(WaitUntil.Completed); + ValidateConfigurationResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task LockFabric_NetworkFabricsLockFabricMaximumSet() + { + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_LockFabric.json + // this example is just showing the usage of "NetworkFabrics_LockFabric" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NetworkFabricResource created on azure + // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; + string resourceGroupName = "example-rg"; + string networkFabricName = "example-networkFabric"; + ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); + NetworkFabricResource networkFabric = client.GetNetworkFabricResource(networkFabricResourceId); + + // invoke the operation + NetworkFabricLockContent content = new NetworkFabricLockContent { - Version = "version1", + LockType = NetworkFabricLockType.Administrative, + Action = NetworkFabricLockAction.Lock, }; - ArmOperation lro = await networkFabric.UpgradeAsync(WaitUntil.Completed, content); + ArmOperation lro = await networkFabric.LockFabricAsync(WaitUntil.Completed, content); StateUpdateCommonPostActionResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Provision_NetworkFabricsProvisionMaximumSetGen() + { + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_Provision.json + // this example is just showing the usage of "NetworkFabrics_Provision" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NetworkFabricResource created on azure + // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; + string resourceGroupName = "example-rg"; + string networkFabricName = "example-fabric"; + ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); + NetworkFabricResource networkFabric = client.GetNetworkFabricResource(networkFabricResourceId); + + // invoke the operation + ArmOperation lro = await networkFabric.ProvisionAsync(WaitUntil.Completed); + DeviceUpdateCommonPostActionResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task RefreshConfiguration_NetworkFabricsRefreshConfigurationMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_refreshConfiguration_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_RefreshConfiguration.json // this example is just showing the usage of "NetworkFabrics_RefreshConfiguration" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -292,7 +465,7 @@ public async Task RefreshConfiguration_NetworkFabricsRefreshConfigurationMaximum // this example assumes you already have this NetworkFabricResource created on azure // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkFabricName = "example-fabric"; ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); @@ -307,10 +480,10 @@ public async Task RefreshConfiguration_NetworkFabricsRefreshConfigurationMaximum [Test] [Ignore("Only validating compilation of examples")] - public async Task UpdateWorkloadManagementBfdConfiguration_NetworkFabricsUpdateWorkloadManagementBfdConfigurationMaximumSetGen() + public async Task UpdateInfraManagementBfdConfiguration_NetworkFabricsUpdateInfraManagementBfdConfigurationMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_UpdateWorkloadManagementBfdConfiguration_MaximumSet_Gen.json - // this example is just showing the usage of "NetworkFabrics_UpdateWorkloadManagementBfdConfiguration" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_UpdateInfraManagementBfdConfiguration.json + // this example is just showing the usage of "NetworkFabrics_UpdateInfraManagementBfdConfiguration" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -319,7 +492,7 @@ public async Task UpdateWorkloadManagementBfdConfiguration_NetworkFabricsUpdateW // this example assumes you already have this NetworkFabricResource created on azure // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkFabricName = "example-fabric"; ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); @@ -328,10 +501,10 @@ public async Task UpdateWorkloadManagementBfdConfiguration_NetworkFabricsUpdateW // invoke the operation UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent { + ResourceIds = { "" }, State = AdministrativeEnableState.Enable, - ResourceIds = { new ResourceIdentifier("") }, }; - ArmOperation lro = await networkFabric.UpdateWorkloadManagementBfdConfigurationAsync(WaitUntil.Completed, content); + ArmOperation lro = await networkFabric.UpdateInfraManagementBfdConfigurationAsync(WaitUntil.Completed, content); StateUpdateCommonPostActionResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); @@ -339,10 +512,10 @@ public async Task UpdateWorkloadManagementBfdConfiguration_NetworkFabricsUpdateW [Test] [Ignore("Only validating compilation of examples")] - public async Task UpdateInfraManagementBfdConfiguration_NetworkFabricsUpdateInfraManagementBfdConfigurationMaximumSetGen() + public async Task UpdateWorkloadManagementBfdConfiguration_NetworkFabricsUpdateWorkloadManagementBfdConfigurationMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_UpdateInfraManagementBfdConfiguration_MaximumSet_Gen.json - // this example is just showing the usage of "NetworkFabrics_UpdateInfraManagementBfdConfiguration" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_UpdateWorkloadManagementBfdConfiguration.json + // this example is just showing the usage of "NetworkFabrics_UpdateWorkloadManagementBfdConfiguration" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -351,7 +524,7 @@ public async Task UpdateInfraManagementBfdConfiguration_NetworkFabricsUpdateInfr // this example assumes you already have this NetworkFabricResource created on azure // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkFabricName = "example-fabric"; ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); @@ -360,10 +533,10 @@ public async Task UpdateInfraManagementBfdConfiguration_NetworkFabricsUpdateInfr // invoke the operation UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent { + ResourceIds = { "" }, State = AdministrativeEnableState.Enable, - ResourceIds = { new ResourceIdentifier("") }, }; - ArmOperation lro = await networkFabric.UpdateInfraManagementBfdConfigurationAsync(WaitUntil.Completed, content); + ArmOperation lro = await networkFabric.UpdateWorkloadManagementBfdConfigurationAsync(WaitUntil.Completed, content); StateUpdateCommonPostActionResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); @@ -371,10 +544,10 @@ public async Task UpdateInfraManagementBfdConfiguration_NetworkFabricsUpdateInfr [Test] [Ignore("Only validating compilation of examples")] - public async Task ValidateConfiguration_NetworkFabricsValidateConfigurationMaximumSetGen() + public async Task Upgrade_NetworkFabricsUpgradeMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_ValidateConfiguration_MaximumSet_Gen.json - // this example is just showing the usage of "NetworkFabrics_ValidateConfiguration" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_Upgrade.json + // this example is just showing the usage of "NetworkFabrics_Upgrade" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -383,29 +556,30 @@ public async Task ValidateConfiguration_NetworkFabricsValidateConfigurationMaxim // this example assumes you already have this NetworkFabricResource created on azure // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkFabricName = "example-fabric"; ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); NetworkFabricResource networkFabric = client.GetNetworkFabricResource(networkFabricResourceId); // invoke the operation - ValidateConfigurationContent content = new ValidateConfigurationContent + UpgradeNetworkFabricProperties body = new UpgradeNetworkFabricProperties { - ValidateAction = NetworkFabricValidateAction.Cabling, + Version = "3.x.x", + Action = NetworkFabricUpgradeAction.Start, }; - ArmOperation lro = await networkFabric.ValidateConfigurationAsync(WaitUntil.Completed, content); - ValidateConfigurationResult result = lro.Value; + ArmOperation lro = await networkFabric.UpgradeAsync(WaitUntil.Completed, body); + StateUpdateCommonPostActionResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task GetTopology_NetworkFabricsGetTopologyMaximumSetGen() + public async Task ValidateConfiguration_NetworkFabricsValidateConfigurationMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_GetTopology_MaximumSet_Gen.json - // this example is just showing the usage of "NetworkFabrics_GetTopology" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_ValidateConfiguration.json + // this example is just showing the usage of "NetworkFabrics_ValidateConfiguration" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -414,14 +588,18 @@ public async Task GetTopology_NetworkFabricsGetTopologyMaximumSetGen() // this example assumes you already have this NetworkFabricResource created on azure // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkFabricName = "example-fabric"; ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); NetworkFabricResource networkFabric = client.GetNetworkFabricResource(networkFabricResourceId); // invoke the operation - ArmOperation lro = await networkFabric.GetTopologyAsync(WaitUntil.Completed); + ValidateConfigurationContent content = new ValidateConfigurationContent + { + ValidateAction = NetworkFabricValidateAction.Cabling, + }; + ArmOperation lro = await networkFabric.ValidateConfigurationAsync(WaitUntil.Completed, content); ValidateConfigurationResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); @@ -429,10 +607,10 @@ public async Task GetTopology_NetworkFabricsGetTopologyMaximumSetGen() [Test] [Ignore("Only validating compilation of examples")] - public async Task CommitConfiguration_NetworkFabricsCommitConfigurationMaximumSetGen() + public async Task ViewDeviceConfiguration_NetworkFabricsViewDeviceConfigurationMaximumSet() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_CommitConfiguration_MaximumSet_Gen.json - // this example is just showing the usage of "NetworkFabrics_CommitConfiguration" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_ViewDeviceConfiguration.json + // this example is just showing the usage of "NetworkFabrics_ViewDeviceConfiguration" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -441,15 +619,15 @@ public async Task CommitConfiguration_NetworkFabricsCommitConfigurationMaximumSe // this example assumes you already have this NetworkFabricResource created on azure // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkFabricName = "example-fabric"; ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); NetworkFabricResource networkFabric = client.GetNetworkFabricResource(networkFabricResourceId); // invoke the operation - ArmOperation lro = await networkFabric.CommitConfigurationAsync(WaitUntil.Completed); - StateUpdateCommonPostActionResult result = lro.Value; + ArmOperation lro = await networkFabric.ViewDeviceConfigurationAsync(WaitUntil.Completed); + ViewDeviceConfigurationResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricRoutePolicyCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricRoutePolicyCollection.cs index b25f381cb194..ca829f6c256b 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricRoutePolicyCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricRoutePolicyCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_NetworkFabricRoutePolicyCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_RoutePoliciesCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/RoutePolicies_Create.json // this example is just showing the usage of "RoutePolicies_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task CreateOrUpdate_RoutePoliciesCreateMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -41,39 +41,43 @@ public async Task CreateOrUpdate_RoutePoliciesCreateMaximumSetGen() // invoke the operation string routePolicyName = "example-routePolicy"; - NetworkFabricRoutePolicyData data = new NetworkFabricRoutePolicyData(new AzureLocation("eastus"), new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric")) + NetworkFabricRoutePolicyData data = new NetworkFabricRoutePolicyData(new AzureLocation("eastus"), new RoutePolicyProperties(new RoutePolicyStatementProperties[] { - Annotation = "annotation", - DefaultAction = CommunityActionType.Deny, - Statements = {new RoutePolicyStatementProperties(7L, new StatementConditionProperties +new RoutePolicyStatementProperties(7L, new StatementConditionProperties { +IPCommunityIds = {"/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity"}, +IPExtendedCommunityIds = {"/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity"}, RoutePolicyConditionType = RoutePolicyConditionType.Or, IPPrefixId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), -IPExtendedCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, -IPCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, }, new StatementActionProperties(RoutePolicyActionType.Permit) { LocalPreference = 20L, IPCommunityProperties = new ActionIPCommunityProperties { +AddIPCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, DeleteIPCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, SetIPCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, -AddIPCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, }, IPExtendedCommunityProperties = new ActionIPExtendedCommunityProperties { +AddIPExtendedCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, DeleteIPExtendedCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, SetIPExtendedCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, -AddIPExtendedCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, }, }) { Annotation = "annotation", -}}, +} + }, new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric")) + { + Annotation = "annotation", + DefaultAction = CommunityActionType.Permit, AddressFamilyType = AddressFamilyType.IPv4, + }) + { Tags = { -["keyID"] = "keyValue" +["keyId"] = "keyValue" }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, routePolicyName, data); @@ -90,7 +94,7 @@ public async Task CreateOrUpdate_RoutePoliciesCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_RoutePoliciesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/RoutePolicies_Get.json // this example is just showing the usage of "RoutePolicies_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +104,7 @@ public async Task Get_RoutePoliciesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -123,7 +127,7 @@ public async Task Get_RoutePoliciesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_RoutePoliciesListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/RoutePolicies_ListByResourceGroup.json // this example is just showing the usage of "RoutePolicies_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -133,7 +137,7 @@ public async Task GetAll_RoutePoliciesListByResourceGroupMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -158,7 +162,7 @@ public async Task GetAll_RoutePoliciesListByResourceGroupMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_RoutePoliciesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/RoutePolicies_Get.json // this example is just showing the usage of "RoutePolicies_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +172,7 @@ public async Task Exists_RoutePoliciesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -187,7 +191,7 @@ public async Task Exists_RoutePoliciesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RoutePoliciesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/RoutePolicies_Get.json // this example is just showing the usage of "RoutePolicies_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -197,7 +201,7 @@ public async Task GetIfExists_RoutePoliciesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricRoutePolicyResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricRoutePolicyResource.cs index d5a0cd5628d0..384c3283f4dd 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricRoutePolicyResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricRoutePolicyResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkFabricRoutePolicyResource [Ignore("Only validating compilation of examples")] public async Task Get_RoutePoliciesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/RoutePolicies_Get.json // this example is just showing the usage of "RoutePolicies_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_RoutePoliciesGetMaximumSetGen() // this example assumes you already have this NetworkFabricRoutePolicyResource created on azure // for more information of creating NetworkFabricRoutePolicyResource, please refer to the document of NetworkFabricRoutePolicyResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string routePolicyName = "example-routePolicy"; ResourceIdentifier networkFabricRoutePolicyResourceId = NetworkFabricRoutePolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, routePolicyName); @@ -50,7 +50,7 @@ public async Task Get_RoutePoliciesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_RoutePoliciesDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/RoutePolicies_Delete.json // this example is just showing the usage of "RoutePolicies_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task Delete_RoutePoliciesDeleteMaximumSetGen() // this example assumes you already have this NetworkFabricRoutePolicyResource created on azure // for more information of creating NetworkFabricRoutePolicyResource, please refer to the document of NetworkFabricRoutePolicyResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string routePolicyName = "example-routePolicy"; ResourceIdentifier networkFabricRoutePolicyResourceId = NetworkFabricRoutePolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, routePolicyName); @@ -76,7 +76,7 @@ public async Task Delete_RoutePoliciesDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_RoutePoliciesUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/RoutePolicies_Update.json // this example is just showing the usage of "RoutePolicies_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Update_RoutePoliciesUpdateMaximumSetGen() // this example assumes you already have this NetworkFabricRoutePolicyResource created on azure // for more information of creating NetworkFabricRoutePolicyResource, please refer to the document of NetworkFabricRoutePolicyResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string routePolicyName = "example-routePolicy"; ResourceIdentifier networkFabricRoutePolicyResourceId = NetworkFabricRoutePolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, routePolicyName); @@ -95,36 +95,39 @@ public async Task Update_RoutePoliciesUpdateMaximumSetGen() // invoke the operation NetworkFabricRoutePolicyPatch patch = new NetworkFabricRoutePolicyPatch { - DefaultAction = CommunityActionType.Deny, - Statements = {new RoutePolicyStatementProperties(7L, new StatementConditionProperties + Tags = +{ +["keyId"] = "keyValue" +}, + Properties = new RoutePolicyPatchableProperties + { + DefaultAction = CommunityActionType.Permit, + Statements = {new RoutePolicyStatementPatchProperties(7L, new StatementConditionPatchProperties { +IPCommunityIds = {"/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity"}, +IPExtendedCommunityIds = {"/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity"}, RoutePolicyConditionType = RoutePolicyConditionType.Or, -IPPrefixId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), -IPExtendedCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, -IPCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, -}, new StatementActionProperties(RoutePolicyActionType.Permit) +IPPrefixId = "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix", +}, new StatementActionPatchProperties(RoutePolicyActionType.Permit) { LocalPreference = 20L, -IPCommunityProperties = new ActionIPCommunityProperties +IPCommunityProperties = new ActionIPCommunityPatchProperties { +AddIPCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, DeleteIPCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, SetIPCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, -AddIPCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, }, -IPExtendedCommunityProperties = new ActionIPExtendedCommunityProperties +IPExtendedCommunityProperties = new ActionIPExtendedCommunityPatchProperties { +AddIPExtendedCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, DeleteIPExtendedCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, SetIPExtendedCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, -AddIPExtendedCommunityIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, }, }) { Annotation = "annotation", }}, - Tags = -{ -["keyID"] = "keyValue" -}, + }, }; ArmOperation lro = await networkFabricRoutePolicy.UpdateAsync(WaitUntil.Completed, patch); NetworkFabricRoutePolicyResource result = lro.Value; @@ -138,10 +141,10 @@ public async Task Update_RoutePoliciesUpdateMaximumSetGen() [Test] [Ignore("Only validating compilation of examples")] - public async Task UpdateAdministrativeState_RoutePoliciesUpdateAdministrativeStateMaximumSetGen() + public async Task CommitConfiguration_RoutePoliciesCommitConfigurationMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_UpdateAdministrativeState_MaximumSet_Gen.json - // this example is just showing the usage of "RoutePolicies_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/RoutePolicies_CommitConfiguration.json + // this example is just showing the usage of "RoutePolicies_CommitConfiguration" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -150,30 +153,25 @@ public async Task UpdateAdministrativeState_RoutePoliciesUpdateAdministrativeSta // this example assumes you already have this NetworkFabricRoutePolicyResource created on azure // for more information of creating NetworkFabricRoutePolicyResource, please refer to the document of NetworkFabricRoutePolicyResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string routePolicyName = "example-routePolicy"; ResourceIdentifier networkFabricRoutePolicyResourceId = NetworkFabricRoutePolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, routePolicyName); NetworkFabricRoutePolicyResource networkFabricRoutePolicy = client.GetNetworkFabricRoutePolicyResource(networkFabricRoutePolicyResourceId); // invoke the operation - UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent - { - State = AdministrativeEnableState.Enable, - ResourceIds = { new ResourceIdentifier("") }, - }; - ArmOperation lro = await networkFabricRoutePolicy.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); - DeviceUpdateCommonPostActionResult result = lro.Value; + ArmOperation lro = await networkFabricRoutePolicy.CommitConfigurationAsync(WaitUntil.Completed); + StateUpdateCommonPostActionResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task ValidateConfiguration_RoutePoliciesValidateConfigurationMaximumSetGen() + public async Task UpdateAdministrativeState_RoutePoliciesUpdateAdministrativeStateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_ValidateConfiguration_MaximumSet_Gen.json - // this example is just showing the usage of "RoutePolicies_ValidateConfiguration" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/RoutePolicies_UpdateAdministrativeState.json + // this example is just showing the usage of "RoutePolicies_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -182,25 +180,30 @@ public async Task ValidateConfiguration_RoutePoliciesValidateConfigurationMaximu // this example assumes you already have this NetworkFabricRoutePolicyResource created on azure // for more information of creating NetworkFabricRoutePolicyResource, please refer to the document of NetworkFabricRoutePolicyResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string routePolicyName = "example-routePolicy"; ResourceIdentifier networkFabricRoutePolicyResourceId = NetworkFabricRoutePolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, routePolicyName); NetworkFabricRoutePolicyResource networkFabricRoutePolicy = client.GetNetworkFabricRoutePolicyResource(networkFabricRoutePolicyResourceId); // invoke the operation - ArmOperation lro = await networkFabricRoutePolicy.ValidateConfigurationAsync(WaitUntil.Completed); - ValidateConfigurationResult result = lro.Value; + UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent + { + ResourceIds = { "" }, + State = AdministrativeEnableState.Enable, + }; + ArmOperation lro = await networkFabricRoutePolicy.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); + DeviceUpdateCommonPostActionResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task CommitConfiguration_RoutePoliciesCommitConfigurationMaximumSetGen() + public async Task ValidateConfiguration_RoutePoliciesValidateConfigurationMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_CommitConfiguration_MaximumSet_Gen.json - // this example is just showing the usage of "RoutePolicies_CommitConfiguration" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/RoutePolicies_ValidateConfiguration.json + // this example is just showing the usage of "RoutePolicies_ValidateConfiguration" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -209,15 +212,15 @@ public async Task CommitConfiguration_RoutePoliciesCommitConfigurationMaximumSet // this example assumes you already have this NetworkFabricRoutePolicyResource created on azure // for more information of creating NetworkFabricRoutePolicyResource, please refer to the document of NetworkFabricRoutePolicyResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string routePolicyName = "example-routePolicy"; ResourceIdentifier networkFabricRoutePolicyResourceId = NetworkFabricRoutePolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, routePolicyName); NetworkFabricRoutePolicyResource networkFabricRoutePolicy = client.GetNetworkFabricRoutePolicyResource(networkFabricRoutePolicyResourceId); // invoke the operation - ArmOperation lro = await networkFabricRoutePolicy.CommitConfigurationAsync(WaitUntil.Completed); - StateUpdateCommonPostActionResult result = lro.Value; + ArmOperation lro = await networkFabricRoutePolicy.ValidateConfigurationAsync(WaitUntil.Completed); + ValidateConfigurationResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricSkuCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricSkuCollection.cs index 136b69ac4ddc..d46dac7c60f9 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricSkuCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricSkuCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkFabricSkuCollection [Ignore("Only validating compilation of examples")] public async Task Get_NetworkFabricSkusGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricSkus_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabricSkus_Get.json // this example is just showing the usage of "NetworkFabricSkus_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_NetworkFabricSkusGetMaximumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -38,7 +38,7 @@ public async Task Get_NetworkFabricSkusGetMaximumSetGen() NetworkFabricSkuCollection collection = subscriptionResource.GetNetworkFabricSkus(); // invoke the operation - string networkFabricSkuName = "example-fabricsku"; + string networkFabricSkuName = "wxample-fabricsku"; NetworkFabricSkuResource result = await collection.GetAsync(networkFabricSkuName); // the variable result is a resource, you could call other operations on this instance as well @@ -52,7 +52,7 @@ public async Task Get_NetworkFabricSkusGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_NetworkFabricSkusListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricSkus_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabricSkus_ListBySubscription.json // this example is just showing the usage of "NetworkFabricSkus_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,7 +62,7 @@ public async Task GetAll_NetworkFabricSkusListBySubscriptionMaximumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -86,7 +86,7 @@ public async Task GetAll_NetworkFabricSkusListBySubscriptionMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_NetworkFabricSkusGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricSkus_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabricSkus_Get.json // this example is just showing the usage of "NetworkFabricSkus_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Exists_NetworkFabricSkusGetMaximumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -104,7 +104,7 @@ public async Task Exists_NetworkFabricSkusGetMaximumSetGen() NetworkFabricSkuCollection collection = subscriptionResource.GetNetworkFabricSkus(); // invoke the operation - string networkFabricSkuName = "example-fabricsku"; + string networkFabricSkuName = "wxample-fabricsku"; bool result = await collection.ExistsAsync(networkFabricSkuName); Console.WriteLine($"Succeeded: {result}"); @@ -114,7 +114,7 @@ public async Task Exists_NetworkFabricSkusGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_NetworkFabricSkusGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricSkus_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabricSkus_Get.json // this example is just showing the usage of "NetworkFabricSkus_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +124,7 @@ public async Task GetIfExists_NetworkFabricSkusGetMaximumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -132,7 +132,7 @@ public async Task GetIfExists_NetworkFabricSkusGetMaximumSetGen() NetworkFabricSkuCollection collection = subscriptionResource.GetNetworkFabricSkus(); // invoke the operation - string networkFabricSkuName = "example-fabricsku"; + string networkFabricSkuName = "wxample-fabricsku"; NullableResponse response = await collection.GetIfExistsAsync(networkFabricSkuName); NetworkFabricSkuResource result = response.HasValue ? response.Value : null; diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricSkuResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricSkuResource.cs index 4cfb78f615f1..484a3543e9ab 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricSkuResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkFabricSkuResource.cs @@ -19,7 +19,7 @@ public partial class Sample_NetworkFabricSkuResource [Ignore("Only validating compilation of examples")] public async Task Get_NetworkFabricSkusGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricSkus_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabricSkus_Get.json // this example is just showing the usage of "NetworkFabricSkus_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -29,8 +29,8 @@ public async Task Get_NetworkFabricSkusGetMaximumSetGen() // this example assumes you already have this NetworkFabricSkuResource created on azure // for more information of creating NetworkFabricSkuResource, please refer to the document of NetworkFabricSkuResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; - string networkFabricSkuName = "example-fabricsku"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; + string networkFabricSkuName = "wxample-fabricsku"; ResourceIdentifier networkFabricSkuResourceId = NetworkFabricSkuResource.CreateResourceIdentifier(subscriptionId, networkFabricSkuName); NetworkFabricSkuResource networkFabricSku = client.GetNetworkFabricSkuResource(networkFabricSkuResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkMonitorCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkMonitorCollection.cs new file mode 100644 index 000000000000..bce4bd4bf046 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkMonitorCollection.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ManagedNetworkFabric.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Samples +{ + public partial class Sample_NetworkMonitorCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_NetworkMonitorsCreate() + { + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkMonitors_Create.json + // this example is just showing the usage of "NetworkMonitors_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string resourceGroupName = "example-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this NetworkMonitorResource + NetworkMonitorCollection collection = resourceGroupResource.GetNetworkMonitors(); + + // invoke the operation + string networkMonitorName = "example-monitor"; + NetworkMonitorData data = new NetworkMonitorData(new AzureLocation("eastus"), new NetworkMonitorProperties + { + Annotation = "annotation", + BmpConfiguration = new BmpConfigurationProperties + { + StationConfigurationState = StationConfigurationState.Enabled, + ScopeResourceId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), + StationName = "name", + StationIP = "10.0.0.1", + StationPort = 62695, + StationConnectionMode = StationConnectionMode.Active, + StationConnectionProperties = new StationConnectionProperties + { + KeepaliveIdleTime = 49, + ProbeInterval = 3558, + ProbeCount = 43, + }, + StationNetwork = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/internalNetworks/example-internalnetwork"), + MonitoredNetworks = { new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain") }, + ExportPolicy = BmpExportPolicy.PrePolicy, + MonitoredAddressFamilies = { BmpMonitoredAddressFamily.IPv4Unicast }, + }, + }) + { + Tags = +{ +["key"] = "value" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, networkMonitorName, data); + NetworkMonitorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NetworkMonitorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_NetworkMonitorsGetMaximumSet() + { + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkMonitors_Get.json + // this example is just showing the usage of "NetworkMonitors_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string resourceGroupName = "example-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this NetworkMonitorResource + NetworkMonitorCollection collection = resourceGroupResource.GetNetworkMonitors(); + + // invoke the operation + string networkMonitorName = "example-monitor"; + NetworkMonitorResource result = await collection.GetAsync(networkMonitorName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NetworkMonitorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_NetworkMonitorsListByResourceGroup() + { + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkMonitors_ListByResourceGroup.json + // this example is just showing the usage of "NetworkMonitors_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string resourceGroupName = "example-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this NetworkMonitorResource + NetworkMonitorCollection collection = resourceGroupResource.GetNetworkMonitors(); + + // invoke the operation and iterate over the result + await foreach (NetworkMonitorResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NetworkMonitorData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_NetworkMonitorsGetMaximumSet() + { + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkMonitors_Get.json + // this example is just showing the usage of "NetworkMonitors_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string resourceGroupName = "example-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this NetworkMonitorResource + NetworkMonitorCollection collection = resourceGroupResource.GetNetworkMonitors(); + + // invoke the operation + string networkMonitorName = "example-monitor"; + bool result = await collection.ExistsAsync(networkMonitorName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_NetworkMonitorsGetMaximumSet() + { + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkMonitors_Get.json + // this example is just showing the usage of "NetworkMonitors_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string resourceGroupName = "example-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this NetworkMonitorResource + NetworkMonitorCollection collection = resourceGroupResource.GetNetworkMonitors(); + + // invoke the operation + string networkMonitorName = "example-monitor"; + NullableResponse response = await collection.GetIfExistsAsync(networkMonitorName); + NetworkMonitorResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NetworkMonitorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkMonitorResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkMonitorResource.cs new file mode 100644 index 000000000000..4b9058046c65 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkMonitorResource.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ManagedNetworkFabric.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Samples +{ + public partial class Sample_NetworkMonitorResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_NetworkMonitorsGetMaximumSet() + { + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkMonitors_Get.json + // this example is just showing the usage of "NetworkMonitors_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NetworkMonitorResource created on azure + // for more information of creating NetworkMonitorResource, please refer to the document of NetworkMonitorResource + string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string resourceGroupName = "example-rg"; + string networkMonitorName = "example-monitor"; + ResourceIdentifier networkMonitorResourceId = NetworkMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkMonitorName); + NetworkMonitorResource networkMonitor = client.GetNetworkMonitorResource(networkMonitorResourceId); + + // invoke the operation + NetworkMonitorResource result = await networkMonitor.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NetworkMonitorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_NetworkMonitorsDeleteMaximumSet() + { + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkMonitors_Delete.json + // this example is just showing the usage of "NetworkMonitors_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NetworkMonitorResource created on azure + // for more information of creating NetworkMonitorResource, please refer to the document of NetworkMonitorResource + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; + string resourceGroupName = "rgmanagednetworkfabric"; + string networkMonitorName = "example-monitor"; + ResourceIdentifier networkMonitorResourceId = NetworkMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkMonitorName); + NetworkMonitorResource networkMonitor = client.GetNetworkMonitorResource(networkMonitorResourceId); + + // invoke the operation + await networkMonitor.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_NetworkMonitorsUpdate() + { + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkMonitors_Update.json + // this example is just showing the usage of "NetworkMonitors_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NetworkMonitorResource created on azure + // for more information of creating NetworkMonitorResource, please refer to the document of NetworkMonitorResource + string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string resourceGroupName = "example-rg"; + string networkMonitorName = "example-monitor"; + ResourceIdentifier networkMonitorResourceId = NetworkMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkMonitorName); + NetworkMonitorResource networkMonitor = client.GetNetworkMonitorResource(networkMonitorResourceId); + + // invoke the operation + NetworkMonitorPatch patch = new NetworkMonitorPatch + { + Tags = +{ +["key"] = "value" +}, + NetworkMonitorPatchBmpConfiguration = new BmpConfigurationPatchProperties + { + StationConfigurationState = StationConfigurationState.Enabled, + ScopeResourceId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), + StationName = "name", + StationIP = "10.0.0.1", + StationPort = 64685, + StationConnectionMode = StationConnectionMode.Active, + StationConnectionProperties = new StationConnectionPatchProperties + { + KeepaliveIdleTime = 49, + ProbeInterval = 3558, + ProbeCount = 43, + }, + StationNetwork = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/internalNetworks/example-internalnetwork"), + MonitoredNetworks = { new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain") }, + ExportPolicy = BmpExportPolicy.PrePolicy, + MonitoredAddressFamilies = { BmpMonitoredAddressFamily.IPv4Unicast }, + }, + }; + ArmOperation lro = await networkMonitor.UpdateAsync(WaitUntil.Completed, patch); + NetworkMonitorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NetworkMonitorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task UpdateAdministrativeState_NetworkMonitorsUpdateAdministrativeState() + { + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkMonitors_UpdateAdministrativeState.json + // this example is just showing the usage of "NetworkMonitors_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NetworkMonitorResource created on azure + // for more information of creating NetworkMonitorResource, please refer to the document of NetworkMonitorResource + string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string resourceGroupName = "example-rg"; + string networkMonitorName = "example-monitor"; + ResourceIdentifier networkMonitorResourceId = NetworkMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkMonitorName); + NetworkMonitorResource networkMonitor = client.GetNetworkMonitorResource(networkMonitorResourceId); + + // invoke the operation + UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent + { + ResourceIds = { "" }, + State = AdministrativeEnableState.Enable, + }; + ArmOperation lro = await networkMonitor.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); + DeviceUpdateCommonPostActionResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkPacketBrokerCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkPacketBrokerCollection.cs index ceeb67c50821..0fd0057eebe2 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkPacketBrokerCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkPacketBrokerCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.ManagedNetworkFabric.Models; using Azure.ResourceManager.Resources; using NUnit.Framework; @@ -20,7 +21,7 @@ public partial class Sample_NetworkPacketBrokerCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_NetworkPacketBrokersCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkPacketBrokers_Create.json // this example is just showing the usage of "NetworkPacketBrokers_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +31,7 @@ public async Task CreateOrUpdate_NetworkPacketBrokersCreateMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -40,11 +41,11 @@ public async Task CreateOrUpdate_NetworkPacketBrokersCreateMaximumSetGen() // invoke the operation string networkPacketBrokerName = "example-networkPacketBroker"; - NetworkPacketBrokerData data = new NetworkPacketBrokerData(new AzureLocation("eastuseuap"), new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric")) + NetworkPacketBrokerData data = new NetworkPacketBrokerData(new AzureLocation("eastuseuap"), new NetworkPacketBrokerProperties(new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"))) { Tags = { -["key2806"] = "key" +["keyId"] = "keyValue" }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, networkPacketBrokerName, data); @@ -61,7 +62,7 @@ public async Task CreateOrUpdate_NetworkPacketBrokersCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_NetworkPacketBrokersGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkPacketBrokers_Get.json // this example is just showing the usage of "NetworkPacketBrokers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -71,7 +72,7 @@ public async Task Get_NetworkPacketBrokersGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -94,7 +95,7 @@ public async Task Get_NetworkPacketBrokersGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_NetworkPacketBrokersListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkPacketBrokers_ListByResourceGroup.json // this example is just showing the usage of "NetworkPacketBrokers_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -104,7 +105,7 @@ public async Task GetAll_NetworkPacketBrokersListByResourceGroupMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -129,7 +130,7 @@ public async Task GetAll_NetworkPacketBrokersListByResourceGroupMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_NetworkPacketBrokersGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkPacketBrokers_Get.json // this example is just showing the usage of "NetworkPacketBrokers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -139,7 +140,7 @@ public async Task Exists_NetworkPacketBrokersGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -158,7 +159,7 @@ public async Task Exists_NetworkPacketBrokersGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_NetworkPacketBrokersGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkPacketBrokers_Get.json // this example is just showing the usage of "NetworkPacketBrokers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +169,7 @@ public async Task GetIfExists_NetworkPacketBrokersGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkPacketBrokerResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkPacketBrokerResource.cs index 72b2cf16d1ab..9b755be3355b 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkPacketBrokerResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkPacketBrokerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkPacketBrokerResource [Ignore("Only validating compilation of examples")] public async Task Get_NetworkPacketBrokersGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkPacketBrokers_Get.json // this example is just showing the usage of "NetworkPacketBrokers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_NetworkPacketBrokersGetMaximumSetGen() // this example assumes you already have this NetworkPacketBrokerResource created on azure // for more information of creating NetworkPacketBrokerResource, please refer to the document of NetworkPacketBrokerResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkPacketBrokerName = "example-networkPacketBroker"; ResourceIdentifier networkPacketBrokerResourceId = NetworkPacketBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkPacketBrokerName); @@ -50,7 +50,7 @@ public async Task Get_NetworkPacketBrokersGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_NetworkPacketBrokersDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkPacketBrokers_Delete.json // this example is just showing the usage of "NetworkPacketBrokers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task Delete_NetworkPacketBrokersDeleteMaximumSetGen() // this example assumes you already have this NetworkPacketBrokerResource created on azure // for more information of creating NetworkPacketBrokerResource, please refer to the document of NetworkPacketBrokerResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkPacketBrokerName = "example-networkPacketBroker"; ResourceIdentifier networkPacketBrokerResourceId = NetworkPacketBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkPacketBrokerName); @@ -76,7 +76,7 @@ public async Task Delete_NetworkPacketBrokersDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_NetworkPacketBrokersUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkPacketBrokers_Update.json // this example is just showing the usage of "NetworkPacketBrokers_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Update_NetworkPacketBrokersUpdateMaximumSetGen() // this example assumes you already have this NetworkPacketBrokerResource created on azure // for more information of creating NetworkPacketBrokerResource, please refer to the document of NetworkPacketBrokerResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkPacketBrokerName = "example-networkPacketBroker"; ResourceIdentifier networkPacketBrokerResourceId = NetworkPacketBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkPacketBrokerName); @@ -97,7 +97,7 @@ public async Task Update_NetworkPacketBrokersUpdateMaximumSetGen() { Tags = { -["key8772"] = "1234" +["keyId"] = "keyValue" }, }; ArmOperation lro = await networkPacketBroker.UpdateAsync(WaitUntil.Completed, patch); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkRackCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkRackCollection.cs index 7b9d65d67f9d..28b830c0a295 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkRackCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkRackCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_NetworkRackCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_NetworkRacksCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkRacks_Create.json // this example is just showing the usage of "NetworkRacks_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task CreateOrUpdate_NetworkRacksCreateMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -41,13 +41,15 @@ public async Task CreateOrUpdate_NetworkRacksCreateMaximumSetGen() // invoke the operation string networkRackName = "example-rack"; - NetworkRackData data = new NetworkRackData(new AzureLocation("eastuseuap"), new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric")) + NetworkRackData data = new NetworkRackData(new AzureLocation("eastuseuap"), new NetworkRackProperties(new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric")) { Annotation = "annotation", NetworkRackType = NetworkRackType.Aggregate, + }) + { Tags = { -["keyID"] = "keyValue" +["keyId"] = "keyValue" }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, networkRackName, data); @@ -64,7 +66,7 @@ public async Task CreateOrUpdate_NetworkRacksCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_NetworkRacksGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkRacks_Get.json // this example is just showing the usage of "NetworkRacks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -74,7 +76,7 @@ public async Task Get_NetworkRacksGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -97,7 +99,7 @@ public async Task Get_NetworkRacksGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_NetworkRacksListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkRacks_ListByResourceGroup.json // this example is just showing the usage of "NetworkRacks_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -107,7 +109,7 @@ public async Task GetAll_NetworkRacksListByResourceGroupMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -132,7 +134,7 @@ public async Task GetAll_NetworkRacksListByResourceGroupMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_NetworkRacksGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkRacks_Get.json // this example is just showing the usage of "NetworkRacks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -142,7 +144,7 @@ public async Task Exists_NetworkRacksGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -161,7 +163,7 @@ public async Task Exists_NetworkRacksGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_NetworkRacksGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkRacks_Get.json // this example is just showing the usage of "NetworkRacks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -171,7 +173,7 @@ public async Task GetIfExists_NetworkRacksGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkRackResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkRackResource.cs index 8f46a9163feb..41b1516296f7 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkRackResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkRackResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkRackResource [Ignore("Only validating compilation of examples")] public async Task Get_NetworkRacksGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkRacks_Get.json // this example is just showing the usage of "NetworkRacks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_NetworkRacksGetMaximumSetGen() // this example assumes you already have this NetworkRackResource created on azure // for more information of creating NetworkRackResource, please refer to the document of NetworkRackResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkRackName = "example-rack"; ResourceIdentifier networkRackResourceId = NetworkRackResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkRackName); @@ -50,7 +50,7 @@ public async Task Get_NetworkRacksGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_NetworkRacksDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkRacks_Delete.json // this example is just showing the usage of "NetworkRacks_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task Delete_NetworkRacksDeleteMaximumSetGen() // this example assumes you already have this NetworkRackResource created on azure // for more information of creating NetworkRackResource, please refer to the document of NetworkRackResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkRackName = "example-rack"; ResourceIdentifier networkRackResourceId = NetworkRackResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkRackName); @@ -76,7 +76,7 @@ public async Task Delete_NetworkRacksDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_NetworkRacksUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkRacks_Update.json // this example is just showing the usage of "NetworkRacks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Update_NetworkRacksUpdateMaximumSetGen() // this example assumes you already have this NetworkRackResource created on azure // for more information of creating NetworkRackResource, please refer to the document of NetworkRackResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkRackName = "example-rack"; ResourceIdentifier networkRackResourceId = NetworkRackResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkRackName); @@ -97,7 +97,7 @@ public async Task Update_NetworkRacksUpdateMaximumSetGen() { Tags = { -["keyID"] = "keyValue" +["keyId"] = "keyValue" }, }; ArmOperation lro = await networkRack.UpdateAsync(WaitUntil.Completed, patch); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkTapCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkTapCollection.cs index 229663bb3b12..e367880c88ba 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkTapCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkTapCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_NetworkTapCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_NetworkTapsCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTaps_Create.json // this example is just showing the usage of "NetworkTaps_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task CreateOrUpdate_NetworkTapsCreateMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -41,13 +41,10 @@ public async Task CreateOrUpdate_NetworkTapsCreateMaximumSetGen() // invoke the operation string networkTapName = "example-networkTap"; - NetworkTapData data = new NetworkTapData(new AzureLocation("eastuseuap"), new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), new NetworkTapPropertiesDestinationsItem[] + NetworkTapData data = new NetworkTapData(new AzureLocation("eastuseuap"), new NetworkTapProperties(new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), new NetworkTapDestinationProperties[] { -new NetworkTapPropertiesDestinationsItem +new NetworkTapDestinationProperties("example-destinaionName", NetworkTapDestinationType.IsolationDomain, new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsloationDomains/example-l3Domain/internalNetworks/example-internalNetwork")) { -Name = "example-destinaionName", -DestinationType = NetworkTapDestinationType.IsolationDomain, -DestinationId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsloationDomains/example-l3Domain/internalNetworks/example-internalNetwork"), IsolationDomainProperties = new IsolationDomainProperties { Encapsulation = IsolationDomainEncapsulationType.None, @@ -59,9 +56,11 @@ public async Task CreateOrUpdate_NetworkTapsCreateMaximumSetGen() { Annotation = "annotation", PollingType = NetworkTapPollingType.Pull, + }) + { Tags = { -["key6024"] = "1234" +["keyId"] = "keyValue" }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, networkTapName, data); @@ -78,7 +77,7 @@ public async Task CreateOrUpdate_NetworkTapsCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_NetworkTapsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTaps_Get.json // this example is just showing the usage of "NetworkTaps_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +87,7 @@ public async Task Get_NetworkTapsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -111,7 +110,7 @@ public async Task Get_NetworkTapsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_NetworkTapsListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTaps_ListByResourceGroup.json // this example is just showing the usage of "NetworkTaps_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -121,7 +120,7 @@ public async Task GetAll_NetworkTapsListByResourceGroupMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -146,7 +145,7 @@ public async Task GetAll_NetworkTapsListByResourceGroupMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_NetworkTapsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTaps_Get.json // this example is just showing the usage of "NetworkTaps_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,7 +155,7 @@ public async Task Exists_NetworkTapsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -175,7 +174,7 @@ public async Task Exists_NetworkTapsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_NetworkTapsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTaps_Get.json // this example is just showing the usage of "NetworkTaps_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -185,7 +184,7 @@ public async Task GetIfExists_NetworkTapsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkTapResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkTapResource.cs index 9bbb40e4f108..c8238d718da4 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkTapResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkTapResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkTapResource [Ignore("Only validating compilation of examples")] public async Task Get_NetworkTapsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTaps_Get.json // this example is just showing the usage of "NetworkTaps_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_NetworkTapsGetMaximumSetGen() // this example assumes you already have this NetworkTapResource created on azure // for more information of creating NetworkTapResource, please refer to the document of NetworkTapResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkTapName = "example-networkTap"; ResourceIdentifier networkTapResourceId = NetworkTapResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkTapName); @@ -50,7 +50,7 @@ public async Task Get_NetworkTapsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_NetworkTapsDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTaps_Delete.json // this example is just showing the usage of "NetworkTaps_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task Delete_NetworkTapsDeleteMaximumSetGen() // this example assumes you already have this NetworkTapResource created on azure // for more information of creating NetworkTapResource, please refer to the document of NetworkTapResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkTapName = "example-networkTap"; ResourceIdentifier networkTapResourceId = NetworkTapResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkTapName); @@ -76,7 +76,7 @@ public async Task Delete_NetworkTapsDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_NetworkTapsUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTaps_Update.json // this example is just showing the usage of "NetworkTaps_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Update_NetworkTapsUpdateMaximumSetGen() // this example assumes you already have this NetworkTapResource created on azure // for more information of creating NetworkTapResource, please refer to the document of NetworkTapResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkTapName = "example-networkTap"; ResourceIdentifier networkTapResourceId = NetworkTapResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkTapName); @@ -95,24 +95,27 @@ public async Task Update_NetworkTapsUpdateMaximumSetGen() // invoke the operation NetworkTapPatch patch = new NetworkTapPatch { - Annotation = "annotation1", - PollingType = NetworkTapPollingType.Pull, - Destinations = {new NetworkTapPatchableParametersDestinationsItem + Tags = +{ +["keyId"] = "keyValue" +}, + Properties = new NetworkTapPatchProperties + { + Annotation = "annotation1", + PollingType = NetworkTapPollingType.Pull, + Destinations = {new DestinationPatchProperties { Name = "example-destinaionName", DestinationType = NetworkTapDestinationType.IsolationDomain, DestinationId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsloationDomains/example-l3Domain/internalNetworks/example-internalNetwork"), -IsolationDomainProperties = new IsolationDomainProperties +IsolationDomainProperties = new IsolationDomainPatchProperties { Encapsulation = IsolationDomainEncapsulationType.None, NeighborGroupIds = {new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, }, DestinationTapRuleId = new ResourceIdentifier("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-destinationTapRule"), }}, - Tags = -{ -["key6024"] = "1234" -}, + }, }; ArmOperation lro = await networkTap.UpdateAsync(WaitUntil.Completed, patch); NetworkTapResource result = lro.Value; @@ -126,10 +129,10 @@ public async Task Update_NetworkTapsUpdateMaximumSetGen() [Test] [Ignore("Only validating compilation of examples")] - public async Task UpdateAdministrativeState_NetworkTapsUpdateAdministrativeStateMaximumSetGen() + public async Task Resync_NetworkTapsResyncMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_UpdateAdministrativeState_MaximumSet_Gen.json - // this example is just showing the usage of "NetworkTaps_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTaps_Resync.json + // this example is just showing the usage of "NetworkTaps_Resync" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -138,30 +141,25 @@ public async Task UpdateAdministrativeState_NetworkTapsUpdateAdministrativeState // this example assumes you already have this NetworkTapResource created on azure // for more information of creating NetworkTapResource, please refer to the document of NetworkTapResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkTapName = "example-networkTap"; ResourceIdentifier networkTapResourceId = NetworkTapResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkTapName); NetworkTapResource networkTap = client.GetNetworkTapResource(networkTapResourceId); // invoke the operation - UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent - { - State = AdministrativeEnableState.Enable, - ResourceIds = { new ResourceIdentifier("") }, - }; - ArmOperation lro = await networkTap.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); - DeviceUpdateCommonPostActionResult result = lro.Value; + ArmOperation lro = await networkTap.ResyncAsync(WaitUntil.Completed); + StateUpdateCommonPostActionResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Resync_NetworkTapsResyncMaximumSetGen() + public async Task UpdateAdministrativeState_NetworkTapsUpdateAdministrativeStateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Resync_MaximumSet_Gen.json - // this example is just showing the usage of "NetworkTaps_Resync" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTaps_UpdateAdministrativeState.json + // this example is just showing the usage of "NetworkTaps_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -170,15 +168,20 @@ public async Task Resync_NetworkTapsResyncMaximumSetGen() // this example assumes you already have this NetworkTapResource created on azure // for more information of creating NetworkTapResource, please refer to the document of NetworkTapResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkTapName = "example-networkTap"; ResourceIdentifier networkTapResourceId = NetworkTapResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkTapName); NetworkTapResource networkTap = client.GetNetworkTapResource(networkTapResourceId); // invoke the operation - ArmOperation lro = await networkTap.ResyncAsync(WaitUntil.Completed); - StateUpdateCommonPostActionResult result = lro.Value; + UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent + { + ResourceIds = { "" }, + State = AdministrativeEnableState.Enable, + }; + ArmOperation lro = await networkTap.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); + DeviceUpdateCommonPostActionResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkTapRuleCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkTapRuleCollection.cs index bac8ce7e5d9d..02c9160b4c6d 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkTapRuleCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkTapRuleCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_NetworkTapRuleCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_NetworkTapRulesCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTapRules_Create.json // this example is just showing the usage of "NetworkTapRules_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task CreateOrUpdate_NetworkTapRulesCreateMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -41,10 +41,9 @@ public async Task CreateOrUpdate_NetworkTapRulesCreateMaximumSetGen() // invoke the operation string networkTapRuleName = "example-tapRule"; - NetworkTapRuleData data = new NetworkTapRuleData(new AzureLocation("eastus")) + NetworkTapRuleData data = new NetworkTapRuleData(new AzureLocation("eastuseuap"), new NetworkTapRuleProperties(NetworkFabricConfigurationType.File) { Annotation = "annotation", - ConfigurationType = NetworkFabricConfigurationType.File, TapRulesUri = new Uri("https://microsoft.com/a"), MatchConfigurations = {new NetworkTapRuleMatchConfiguration { @@ -53,27 +52,27 @@ public async Task CreateOrUpdate_NetworkTapRulesCreateMaximumSetGen() IPAddressType = NetworkFabricIPAddressType.IPv4, MatchConditions = {new NetworkTapRuleMatchCondition { -EncapsulationType = NetworkTapEncapsulationType.None, -PortCondition = new NetworkFabricPortCondition(Layer4Protocol.Tcp) -{ -PortType = NetworkFabricPortType.SourcePort, -Ports = {"100"}, -PortGroupNames = {"example-portGroup1"}, -}, ProtocolTypes = {"TCP"}, VlanMatchCondition = new VlanMatchCondition { -Vlans = {"10"}, -InnerVlans = {"11-20"}, -VlanGroupNames = {"exmaple-vlanGroup"}, +Vlans = {"20-30"}, +InnerVlans = {"30"}, +VlanGroupNames = {"example-vlanGroup"}, }, IPCondition = new IPMatchCondition { SourceDestinationType = SourceDestinationType.SourceIP, PrefixType = IPMatchConditionPrefixType.Prefix, -IPPrefixValues = {"10.10.10.10/20"}, +IPPrefixValues = {"10.20.20.20/12"}, IPGroupNames = {"example-ipGroup"}, }, +EncapsulationType = NetworkTapEncapsulationType.None, +PortCondition = new NetworkFabricPortCondition(Layer4Protocol.Tcp) +{ +PortType = NetworkFabricPortType.SourcePort, +Ports = {"100"}, +PortGroupNames = {"example-portGroup1"}, +}, }}, Actions = {new NetworkTapRuleAction { @@ -88,29 +87,32 @@ public async Task CreateOrUpdate_NetworkTapRulesCreateMaximumSetGen() { IPGroups = {new MatchConfigurationIPGroupProperties { -Name = "example-ipGroup1", +Name = "example-ipGroup", IPAddressType = NetworkFabricIPAddressType.IPv4, -IPPrefixes = {"10.10.10.10/30"}, +IPPrefixes = {"10.20.3.1/20"}, }}, VlanGroups = {new VlanGroupProperties { -Name = "exmaple-vlanGroup", -Vlans = {"10", "100-200"}, +Name = "example-vlanGroup", +Vlans = {"20-30"}, }}, PortGroups = {new PortGroupProperties { -Name = "example-portGroup1", +Name = "example-portGroup", Ports = {"100-200"}, -}, new PortGroupProperties -{ -Name = "example-portGroup2", -Ports = {"900", "1000-2000"}, }}, }}, PollingIntervalInSeconds = PollingIntervalInSecond.Thirty, + GlobalNetworkTapRuleActions = new GlobalNetworkTapRuleActionProperties + { + EnableCount = NetworkFabricBooleanValue.True, + Truncate = "truncate-name", + }, + }) + { Tags = { -["keyID"] = "keyValue" +["keyId"] = "keyValue" }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, networkTapRuleName, data); @@ -127,7 +129,7 @@ public async Task CreateOrUpdate_NetworkTapRulesCreateMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Get_NetworkTapRulesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTapRules_Get.json // this example is just showing the usage of "NetworkTapRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -137,7 +139,7 @@ public async Task Get_NetworkTapRulesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -160,7 +162,7 @@ public async Task Get_NetworkTapRulesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_NetworkTapRulesListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTapRules_ListByResourceGroup.json // this example is just showing the usage of "NetworkTapRules_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +172,7 @@ public async Task GetAll_NetworkTapRulesListByResourceGroupMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -195,7 +197,7 @@ public async Task GetAll_NetworkTapRulesListByResourceGroupMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Exists_NetworkTapRulesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTapRules_Get.json // this example is just showing the usage of "NetworkTapRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -205,7 +207,7 @@ public async Task Exists_NetworkTapRulesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -224,7 +226,7 @@ public async Task Exists_NetworkTapRulesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_NetworkTapRulesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTapRules_Get.json // this example is just showing the usage of "NetworkTapRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -234,7 +236,7 @@ public async Task GetIfExists_NetworkTapRulesGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkTapRuleResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkTapRuleResource.cs index 5ffc1a0a99af..524baf983cba 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkTapRuleResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkTapRuleResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkTapRuleResource [Ignore("Only validating compilation of examples")] public async Task Get_NetworkTapRulesGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTapRules_Get.json // this example is just showing the usage of "NetworkTapRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_NetworkTapRulesGetMaximumSetGen() // this example assumes you already have this NetworkTapRuleResource created on azure // for more information of creating NetworkTapRuleResource, please refer to the document of NetworkTapRuleResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkTapRuleName = "example-tapRule"; ResourceIdentifier networkTapRuleResourceId = NetworkTapRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkTapRuleName); @@ -50,7 +50,7 @@ public async Task Get_NetworkTapRulesGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_NetworkTapRulesDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTapRules_Delete.json // this example is just showing the usage of "NetworkTapRules_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task Delete_NetworkTapRulesDeleteMaximumSetGen() // this example assumes you already have this NetworkTapRuleResource created on azure // for more information of creating NetworkTapRuleResource, please refer to the document of NetworkTapRuleResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkTapRuleName = "example-tapRule"; ResourceIdentifier networkTapRuleResourceId = NetworkTapRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkTapRuleName); @@ -76,7 +76,7 @@ public async Task Delete_NetworkTapRulesDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_NetworkTapRulesUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTapRules_Update.json // this example is just showing the usage of "NetworkTapRules_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Update_NetworkTapRulesUpdateMaximumSetGen() // this example assumes you already have this NetworkTapRuleResource created on azure // for more information of creating NetworkTapRuleResource, please refer to the document of NetworkTapRuleResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkTapRuleName = "example-tapRule"; ResourceIdentifier networkTapRuleResourceId = NetworkTapRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkTapRuleName); @@ -95,70 +95,79 @@ public async Task Update_NetworkTapRulesUpdateMaximumSetGen() // invoke the operation NetworkTapRulePatch patch = new NetworkTapRulePatch { - Annotation = "annotation", - ConfigurationType = NetworkFabricConfigurationType.File, - TapRulesUri = new Uri("https://microsoft.com/amdsdx"), - MatchConfigurations = {new NetworkTapRuleMatchConfiguration + Tags = +{ +["keyId"] = "keyValue" +}, + Properties = new NetworkTapRulePatchProperties + { + Annotation = "annotation", + ConfigurationType = NetworkFabricConfigurationType.File, + TapRulesUri = new Uri("https://microsoft.com/amdsdx"), + GlobalNetworkTapRuleActions = new GlobalNetworkTapRuleActionPatchProperties + { + EnableCount = NetworkFabricBooleanValue.True, + Truncate = "truncate-name", + }, + MatchConfigurations = {new NetworkTapRuleMatchConfigurationPatch { MatchConfigurationName = "config1", SequenceNumber = 10L, IPAddressType = NetworkFabricIPAddressType.IPv4, -MatchConditions = {new NetworkTapRuleMatchCondition -{ -EncapsulationType = NetworkTapEncapsulationType.None, -PortCondition = new NetworkFabricPortCondition(Layer4Protocol.Tcp) +MatchConditions = {new NetworkTapRuleMatchConditionPatch { -PortType = NetworkFabricPortType.SourcePort, -Ports = {"100"}, -PortGroupNames = {"example-portGroup1"}, -}, ProtocolTypes = {"TCP"}, -VlanMatchCondition = new VlanMatchCondition +VlanMatchCondition = new VlanMatchConditionPatch { -Vlans = {"10"}, -InnerVlans = {"11-20"}, -VlanGroupNames = {"exmaple-vlanGroup"}, +Vlans = {"20-30"}, +InnerVlans = {"30"}, +VlanGroupNames = {"example-vlanGroup"}, }, -IPCondition = new IPMatchCondition +IPCondition = new IPMatchConditionPatch { SourceDestinationType = SourceDestinationType.SourceIP, PrefixType = IPMatchConditionPrefixType.Prefix, -IPPrefixValues = {"10.10.10.10/20"}, +IPPrefixValues = {"10.20.20.20/12"}, IPGroupNames = {"example-ipGroup"}, }, +EncapsulationType = NetworkTapEncapsulationType.None, +PortCondition = new PortConditionPatch +{ +PortType = NetworkFabricPortType.SourcePort, +Layer4Protocol = Layer4Protocol.Tcp, +Ports = {"100"}, +PortGroupNames = {"example-portGroup1"}, +}, }}, -Actions = {new NetworkTapRuleAction +Actions = {new NetworkTapRuleActionPatch { -TapRuleActionType = TapRuleActionType.Goto, +TapRuleActionType = TapRuleActionType.Drop, Truncate = "100", IsTimestampEnabled = NetworkFabricBooleanValue.True, DestinationId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), MatchConfigurationName = "match1", }}, }}, - DynamicMatchConfigurations = {new CommonDynamicMatchConfiguration + DynamicMatchConfigurations = {new CommonDynamicMatchConfigurationPatch { -IPGroups = {new MatchConfigurationIPGroupProperties +IPGroups = {new IPGroupPatchProperties { -Name = "example-ipGroup1", +Name = "example-ipGroup", IPAddressType = NetworkFabricIPAddressType.IPv4, -IPPrefixes = {"10.10.10.10/30"}, +IPPrefixes = {"10.20.3.1/20"}, }}, -VlanGroups = {new VlanGroupProperties +VlanGroups = {new VlanGroupPatchProperties { -Name = "exmaple-vlanGroup", -Vlans = {"10", "100-200"}, +Name = "example-vlanGroup", +Vlans = {"20-30"}, }}, -PortGroups = {new PortGroupProperties +PortGroups = {new PortGroupPatchProperties { -Name = "example-portGroup1", +Name = "example-portGroup", Ports = {"100-200"}, }}, }}, - Tags = -{ -["keyID"] = "keyValue" -}, + }, }; ArmOperation lro = await networkTapRule.UpdateAsync(WaitUntil.Completed, patch); NetworkTapRuleResource result = lro.Value; @@ -172,10 +181,10 @@ public async Task Update_NetworkTapRulesUpdateMaximumSetGen() [Test] [Ignore("Only validating compilation of examples")] - public async Task UpdateAdministrativeState_NetworkTapRulesUpdateAdministrativeStateMaximumSetGen() + public async Task Resync_NetworkTapRulesResyncMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_UpdateAdministrativeState_MaximumSet_Gen.json - // this example is just showing the usage of "NetworkTapRules_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTapRules_Resync.json + // this example is just showing the usage of "NetworkTapRules_Resync" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -184,19 +193,14 @@ public async Task UpdateAdministrativeState_NetworkTapRulesUpdateAdministrativeS // this example assumes you already have this NetworkTapRuleResource created on azure // for more information of creating NetworkTapRuleResource, please refer to the document of NetworkTapRuleResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkTapRuleName = "example-tapRule"; ResourceIdentifier networkTapRuleResourceId = NetworkTapRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkTapRuleName); NetworkTapRuleResource networkTapRule = client.GetNetworkTapRuleResource(networkTapRuleResourceId); // invoke the operation - UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent - { - State = AdministrativeEnableState.Enable, - ResourceIds = { new ResourceIdentifier("") }, - }; - ArmOperation lro = await networkTapRule.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); + ArmOperation lro = await networkTapRule.ResyncAsync(WaitUntil.Completed); StateUpdateCommonPostActionResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); @@ -204,10 +208,10 @@ public async Task UpdateAdministrativeState_NetworkTapRulesUpdateAdministrativeS [Test] [Ignore("Only validating compilation of examples")] - public async Task Resync_NetworkTapRulesResyncMaximumSetGen() + public async Task UpdateAdministrativeState_NetworkTapRulesUpdateAdministrativeStateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Resync_MaximumSet_Gen.json - // this example is just showing the usage of "NetworkTapRules_Resync" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTapRules_UpdateAdministrativeState.json + // this example is just showing the usage of "NetworkTapRules_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -216,14 +220,19 @@ public async Task Resync_NetworkTapRulesResyncMaximumSetGen() // this example assumes you already have this NetworkTapRuleResource created on azure // for more information of creating NetworkTapRuleResource, please refer to the document of NetworkTapRuleResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkTapRuleName = "example-tapRule"; ResourceIdentifier networkTapRuleResourceId = NetworkTapRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkTapRuleName); NetworkTapRuleResource networkTapRule = client.GetNetworkTapRuleResource(networkTapRuleResourceId); // invoke the operation - ArmOperation lro = await networkTapRule.ResyncAsync(WaitUntil.Completed); + UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent + { + ResourceIds = { "" }, + State = AdministrativeEnableState.Enable, + }; + ArmOperation lro = await networkTapRule.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); StateUpdateCommonPostActionResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); @@ -233,7 +242,7 @@ public async Task Resync_NetworkTapRulesResyncMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task ValidateConfiguration_NetworkTapRulesValidateConfigurationMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_ValidateConfiguration_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTapRules_ValidateConfiguration.json // this example is just showing the usage of "NetworkTapRules_ValidateConfiguration" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -243,7 +252,7 @@ public async Task ValidateConfiguration_NetworkTapRulesValidateConfigurationMaxi // this example assumes you already have this NetworkTapRuleResource created on azure // for more information of creating NetworkTapRuleResource, please refer to the document of NetworkTapRuleResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; string networkTapRuleName = "example-tapRule"; ResourceIdentifier networkTapRuleResourceId = NetworkTapRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkTapRuleName); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkToNetworkInterconnectCollection.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkToNetworkInterconnectCollection.cs index dd37479e377d..3d41f0e424b3 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkToNetworkInterconnectCollection.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkToNetworkInterconnectCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkToNetworkInterconnectCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_NetworkToNetworkInterconnectsCreateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Create_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkToNetworkInterconnects_Create.json // this example is just showing the usage of "NetworkToNetworkInterconnects_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,9 +30,9 @@ public async Task CreateOrUpdate_NetworkToNetworkInterconnectsCreateMaximumSetGe // this example assumes you already have this NetworkFabricResource created on azure // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string networkFabricName = "example-fabric"; + string networkFabricName = "example-nf"; ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); NetworkFabricResource networkFabric = client.GetNetworkFabricResource(networkFabricResourceId); @@ -41,7 +41,7 @@ public async Task CreateOrUpdate_NetworkToNetworkInterconnectsCreateMaximumSetGe // invoke the operation string networkToNetworkInterconnectName = "example-nni"; - NetworkToNetworkInterconnectData data = new NetworkToNetworkInterconnectData(NetworkFabricBooleanValue.True) + NetworkToNetworkInterconnectData data = new NetworkToNetworkInterconnectData(new NetworkToNetworkInterconnectProperties(NetworkFabricBooleanValue.True) { NniType = NniType.CE, IsManagementType = IsManagementType.True, @@ -50,24 +50,40 @@ public async Task CreateOrUpdate_NetworkToNetworkInterconnectsCreateMaximumSetGe Mtu = 1500, Interfaces = { new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface") }, }, - OptionBLayer3Configuration = new NetworkToNetworkInterconnectOptionBLayer3Configuration + OptionBLayer3Configuration = new OptionBLayer3Configuration { - PeerAsn = 61234L, - VlanId = 1234, PrimaryIPv4Prefix = "10.0.0.12/30", PrimaryIPv6Prefix = "4FFE:FFFF:0:CD30::a8/127", SecondaryIPv4Prefix = "40.0.0.14/30", SecondaryIPv6Prefix = "6FFE:FFFF:0:CD30::ac/127", + PeerAsn = 61234L, + VlanId = 1234, + PeLoopbackIPAddress = { "10.0.0.1" }, + BmpConfigurationState = BmpConfigurationState.Enabled, + PrefixLimits = {new OptionBLayer3PrefixLimitProperties +{ +MaximumRoutes = 24, +}}, }, NpbStaticRouteConfiguration = new NpbStaticRouteConfiguration { BfdConfiguration = new BfdConfiguration { IntervalInMilliSeconds = 300, - Multiplier = 25, + Multiplier = 10, }, - IPv4Routes = { new StaticRouteProperties("20.0.0.12/30", new string[] { "21.20.20.20" }) }, - IPv6Routes = { new StaticRouteProperties("3FFE:FFFF:0:CD30::ac/127", new string[] { "4FFE:FFFF:0:CD30::ac" }) }, + IPv4Routes = { new StaticRouteProperties("jffgck", new string[] { "10.0.0.1" }) }, + IPv6Routes = { new StaticRouteProperties("jffgck", new string[] { "10.0.0.1" }) }, + }, + StaticRouteConfiguration = new NniStaticRouteConfiguration + { + BfdConfiguration = new BfdConfiguration + { + IntervalInMilliSeconds = 300, + Multiplier = 10, + }, + IPv4Routes = { new StaticRouteProperties("jffgck", new string[] { "10.0.0.1" }) }, + IPv6Routes = { new StaticRouteProperties("2fff::/64", new string[] { "3ffe::1" }) }, }, ImportRoutePolicy = new ImportRoutePolicyInformation { @@ -81,7 +97,13 @@ public async Task CreateOrUpdate_NetworkToNetworkInterconnectsCreateMaximumSetGe }, EgressAclId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), IngressAclId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - }; + MicroBfdState = MicroBfdState.Enabled, + ConditionalDefaultRouteConfiguration = new ConditionalDefaultRouteProperties + { + IPv4Routes = { new StaticRouteProperties("10.0.0.1/24", new string[] { "10.0.0.1" }) }, + IPv6Routes = { new StaticRouteProperties("fe08:00/64", new string[] { "fe01::1" }) }, + }, + }); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, networkToNetworkInterconnectName, data); NetworkToNetworkInterconnectResource result = lro.Value; @@ -96,7 +118,7 @@ public async Task CreateOrUpdate_NetworkToNetworkInterconnectsCreateMaximumSetGe [Ignore("Only validating compilation of examples")] public async Task Get_NetworkToNetworkInterconnectsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkToNetworkInterconnects_Get.json // this example is just showing the usage of "NetworkToNetworkInterconnects_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -106,9 +128,9 @@ public async Task Get_NetworkToNetworkInterconnectsGetMaximumSetGen() // this example assumes you already have this NetworkFabricResource created on azure // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string networkFabricName = "example-fabric"; + string networkFabricName = "example-nf"; ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); NetworkFabricResource networkFabric = client.GetNetworkFabricResource(networkFabricResourceId); @@ -130,7 +152,7 @@ public async Task Get_NetworkToNetworkInterconnectsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetAll_NetworkToNetworkInterconnectsListByNetworkFabricMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_ListByNetworkFabric_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkToNetworkInterconnects_ListByNetworkFabric.json // this example is just showing the usage of "NetworkToNetworkInterconnects_ListByNetworkFabric" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -140,9 +162,9 @@ public async Task GetAll_NetworkToNetworkInterconnectsListByNetworkFabricMaximum // this example assumes you already have this NetworkFabricResource created on azure // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string networkFabricName = "example-fabric"; + string networkFabricName = "example-nf"; ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); NetworkFabricResource networkFabric = client.GetNetworkFabricResource(networkFabricResourceId); @@ -166,7 +188,7 @@ public async Task GetAll_NetworkToNetworkInterconnectsListByNetworkFabricMaximum [Ignore("Only validating compilation of examples")] public async Task Exists_NetworkToNetworkInterconnectsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkToNetworkInterconnects_Get.json // this example is just showing the usage of "NetworkToNetworkInterconnects_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -176,9 +198,9 @@ public async Task Exists_NetworkToNetworkInterconnectsGetMaximumSetGen() // this example assumes you already have this NetworkFabricResource created on azure // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string networkFabricName = "example-fabric"; + string networkFabricName = "example-nf"; ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); NetworkFabricResource networkFabric = client.GetNetworkFabricResource(networkFabricResourceId); @@ -196,7 +218,7 @@ public async Task Exists_NetworkToNetworkInterconnectsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_NetworkToNetworkInterconnectsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkToNetworkInterconnects_Get.json // this example is just showing the usage of "NetworkToNetworkInterconnects_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -206,9 +228,9 @@ public async Task GetIfExists_NetworkToNetworkInterconnectsGetMaximumSetGen() // this example assumes you already have this NetworkFabricResource created on azure // for more information of creating NetworkFabricResource, please refer to the document of NetworkFabricResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string networkFabricName = "example-fabric"; + string networkFabricName = "example-nf"; ResourceIdentifier networkFabricResourceId = NetworkFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName); NetworkFabricResource networkFabric = client.GetNetworkFabricResource(networkFabricResourceId); diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkToNetworkInterconnectResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkToNetworkInterconnectResource.cs index 4b3a579bd0c1..a1883f5e8a13 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkToNetworkInterconnectResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_NetworkToNetworkInterconnectResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkToNetworkInterconnectResource [Ignore("Only validating compilation of examples")] public async Task Get_NetworkToNetworkInterconnectsGetMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Get_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkToNetworkInterconnects_Get.json // this example is just showing the usage of "NetworkToNetworkInterconnects_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,9 +30,9 @@ public async Task Get_NetworkToNetworkInterconnectsGetMaximumSetGen() // this example assumes you already have this NetworkToNetworkInterconnectResource created on azure // for more information of creating NetworkToNetworkInterconnectResource, please refer to the document of NetworkToNetworkInterconnectResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string networkFabricName = "example-fabric"; + string networkFabricName = "example-nf"; string networkToNetworkInterconnectName = "example-nni"; ResourceIdentifier networkToNetworkInterconnectResourceId = NetworkToNetworkInterconnectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName); NetworkToNetworkInterconnectResource networkToNetworkInterconnect = client.GetNetworkToNetworkInterconnectResource(networkToNetworkInterconnectResourceId); @@ -51,7 +51,7 @@ public async Task Get_NetworkToNetworkInterconnectsGetMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Delete_NetworkToNetworkInterconnectsDeleteMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkToNetworkInterconnects_Delete.json // this example is just showing the usage of "NetworkToNetworkInterconnects_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,9 +61,9 @@ public async Task Delete_NetworkToNetworkInterconnectsDeleteMaximumSetGen() // this example assumes you already have this NetworkToNetworkInterconnectResource created on azure // for more information of creating NetworkToNetworkInterconnectResource, please refer to the document of NetworkToNetworkInterconnectResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string networkFabricName = "example-fabric"; + string networkFabricName = "example-nf"; string networkToNetworkInterconnectName = "example-nni"; ResourceIdentifier networkToNetworkInterconnectResourceId = NetworkToNetworkInterconnectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName); NetworkToNetworkInterconnectResource networkToNetworkInterconnect = client.GetNetworkToNetworkInterconnectResource(networkToNetworkInterconnectResourceId); @@ -78,7 +78,7 @@ public async Task Delete_NetworkToNetworkInterconnectsDeleteMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task Update_NetworkToNetworkInterconnectsUpdateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Update_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkToNetworkInterconnects_Update.json // this example is just showing the usage of "NetworkToNetworkInterconnects_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,9 +88,9 @@ public async Task Update_NetworkToNetworkInterconnectsUpdateMaximumSetGen() // this example assumes you already have this NetworkToNetworkInterconnectResource created on azure // for more information of creating NetworkToNetworkInterconnectResource, please refer to the document of NetworkToNetworkInterconnectResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string networkFabricName = "example-fabric"; + string networkFabricName = "example-nf"; string networkToNetworkInterconnectName = "example-nni"; ResourceIdentifier networkToNetworkInterconnectResourceId = NetworkToNetworkInterconnectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName); NetworkToNetworkInterconnectResource networkToNetworkInterconnect = client.GetNetworkToNetworkInterconnectResource(networkToNetworkInterconnectResourceId); @@ -98,42 +98,62 @@ public async Task Update_NetworkToNetworkInterconnectsUpdateMaximumSetGen() // invoke the operation NetworkToNetworkInterconnectPatch patch = new NetworkToNetworkInterconnectPatch { - Layer2Configuration = new Layer2Configuration + Properties = new NetworkToNetworkInterconnectPatchProperties { - Mtu = 1500, - Interfaces = { new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface") }, - }, - OptionBLayer3Configuration = new OptionBLayer3Configuration - { - PeerAsn = 2345L, - VlanId = 1235, - PrimaryIPv4Prefix = "20.0.0.12/29", - PrimaryIPv6Prefix = "4FFE:FFFF:0:CD30::a8/127", - SecondaryIPv4Prefix = "20.0.0.14/29", - SecondaryIPv6Prefix = "6FFE:FFFF:0:CD30::ac/127", - }, - NpbStaticRouteConfiguration = new NpbStaticRouteConfiguration - { - BfdConfiguration = new BfdConfiguration + Layer2Configuration = new Layer2ConfigurationPatch { - IntervalInMilliSeconds = 310, - Multiplier = 15, + Mtu = 1500, + Interfaces = { new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface") }, }, - IPv4Routes = { new StaticRouteProperties("20.0.0.11/30", new string[] { "21.20.20.10" }) }, - IPv6Routes = { new StaticRouteProperties("4FFE:FFFF:0:CD30::ac/127", new string[] { "5FFE:FFFF:0:CD30::ac" }) }, - }, - ImportRoutePolicy = new ImportRoutePolicyInformation - { - ImportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), - ImportIPv6RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), - }, - ExportRoutePolicy = new ExportRoutePolicyInformation - { - ExportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), - ExportIPv6RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), + OptionBLayer3Configuration = new OptionBLayer3ConfigurationPatchProperties + { + PrimaryIPv4Prefix = "20.0.0.12/29", + PrimaryIPv6Prefix = "4FFE:FFFF:0:CD30::a8/127", + SecondaryIPv4Prefix = "20.0.0.14/29", + SecondaryIPv6Prefix = "6FFE:FFFF:0:CD30::ac/127", + PeerAsn = 2345L, + VlanId = 1235, + PeLoopbackIPAddress = { "10.0.0.1" }, + BmpConfigurationState = BmpConfigurationState.Enabled, + PrefixLimits = {new OptionBLayer3PrefixLimitPatchProperties +{ +MaximumRoutes = 1, +}}, + }, + NpbStaticRouteConfiguration = new NpbStaticRouteConfigurationPatch + { + BfdConfiguration = new BfdPatchConfiguration + { + IntervalInMilliSeconds = 300, + Multiplier = 10, + }, + IPv4Routes = { new StaticRoutePatchProperties("10.0.0.1/24", new string[] { "10.0.0.1" }) }, + IPv6Routes = { new StaticRoutePatchProperties("fe80::/64", new string[] { "fe80::1" }) }, + }, + StaticRouteConfiguration = new NniStaticRoutePatchConfiguration + { + BfdConfiguration = new BfdPatchConfiguration + { + IntervalInMilliSeconds = 300, + Multiplier = 10, + }, + IPv4Routes = { new StaticRoutePatchProperties("10.0.0.1", new string[] { "10.0.0.1" }) }, + IPv6Routes = { new StaticRoutePatchProperties("2fff::/64", new string[] { "3ffe::1" }) }, + }, + ImportRoutePolicy = new ImportRoutePolicyInformationPatch + { + ImportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + ImportIPv6RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + }, + ExportRoutePolicy = new ExportRoutePolicyInformationPatch + { + ExportIPv4RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + ExportIPv6RoutePolicyId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + }, + EgressAclId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + IngressAclId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + MicroBfdState = MicroBfdState.Enabled, }, - EgressAclId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - IngressAclId = new ResourceIdentifier("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), }; ArmOperation lro = await networkToNetworkInterconnect.UpdateAsync(WaitUntil.Completed, patch); NetworkToNetworkInterconnectResource result = lro.Value; @@ -147,10 +167,10 @@ public async Task Update_NetworkToNetworkInterconnectsUpdateMaximumSetGen() [Test] [Ignore("Only validating compilation of examples")] - public async Task UpdateNpbStaticRouteBfdAdministrativeState_NetworkToNetworkInterconnectsUpdateNpbStaticRouteBfdAdministrativeStateMaximumSetGen() + public async Task UpdateAdministrativeState_NetworkToNetworkInterconnectsUpdateAdministrativeStateMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_updateNpbStaticRouteBfdAdministrativeState_MaximumSet_Gen.json - // this example is just showing the usage of "NetworkToNetworkInterconnects_UpdateNpbStaticRouteBfdAdministrativeState" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkToNetworkInterconnects_UpdateAdministrativeState.json + // this example is just showing the usage of "NetworkToNetworkInterconnects_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -159,9 +179,9 @@ public async Task UpdateNpbStaticRouteBfdAdministrativeState_NetworkToNetworkInt // this example assumes you already have this NetworkToNetworkInterconnectResource created on azure // for more information of creating NetworkToNetworkInterconnectResource, please refer to the document of NetworkToNetworkInterconnectResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string networkFabricName = "example-fabric"; + string networkFabricName = "example-nf"; string networkToNetworkInterconnectName = "example-nni"; ResourceIdentifier networkToNetworkInterconnectResourceId = NetworkToNetworkInterconnectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName); NetworkToNetworkInterconnectResource networkToNetworkInterconnect = client.GetNetworkToNetworkInterconnectResource(networkToNetworkInterconnectResourceId); @@ -169,10 +189,10 @@ public async Task UpdateNpbStaticRouteBfdAdministrativeState_NetworkToNetworkInt // invoke the operation UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent { + ResourceIds = { "" }, State = AdministrativeEnableState.Enable, - ResourceIds = { new ResourceIdentifier("") }, }; - ArmOperation lro = await networkToNetworkInterconnect.UpdateNpbStaticRouteBfdAdministrativeStateAsync(WaitUntil.Completed, content); + ArmOperation lro = await networkToNetworkInterconnect.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); StateUpdateCommonPostActionResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); @@ -180,10 +200,10 @@ public async Task UpdateNpbStaticRouteBfdAdministrativeState_NetworkToNetworkInt [Test] [Ignore("Only validating compilation of examples")] - public async Task UpdateAdministrativeState_NetworkToNetworkInterconnectsUpdateAdministrativeStateMaximumSetGen() + public async Task UpdateBfdAdministrativeState_NetworkToNetworkInterconnectsUpdateBfdAdministrativeState() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_updateAdministrativeState_MaximumSet_Gen.json - // this example is just showing the usage of "NetworkToNetworkInterconnects_UpdateAdministrativeState" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkToNetworkInterconnects_UpdateBfdAdministrativeState.json + // this example is just showing the usage of "NetworkToNetworkInterconnects_UpdateBfdAdministrativeState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -192,21 +212,21 @@ public async Task UpdateAdministrativeState_NetworkToNetworkInterconnectsUpdateA // this example assumes you already have this NetworkToNetworkInterconnectResource created on azure // for more information of creating NetworkToNetworkInterconnectResource, please refer to the document of NetworkToNetworkInterconnectResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; string resourceGroupName = "example-rg"; - string networkFabricName = "example-fabric"; + string networkFabricName = "example-nf"; string networkToNetworkInterconnectName = "example-nni"; ResourceIdentifier networkToNetworkInterconnectResourceId = NetworkToNetworkInterconnectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkFabricName, networkToNetworkInterconnectName); NetworkToNetworkInterconnectResource networkToNetworkInterconnect = client.GetNetworkToNetworkInterconnectResource(networkToNetworkInterconnectResourceId); // invoke the operation - UpdateAdministrativeStateContent content = new UpdateAdministrativeStateContent + NniBfdAdministrativeStateContent content = new NniBfdAdministrativeStateContent { - State = AdministrativeEnableState.Enable, - ResourceIds = { new ResourceIdentifier("") }, + RouteType = RouteType.Static, + AdministrativeState = new BfdAdministrativeState("Enable"), }; - ArmOperation lro = await networkToNetworkInterconnect.UpdateAdministrativeStateAsync(WaitUntil.Completed, content); - StateUpdateCommonPostActionResult result = lro.Value; + ArmOperation lro = await networkToNetworkInterconnect.UpdateBfdAdministrativeStateAsync(WaitUntil.Completed, content); + NniBfdAdministrativeStateResult result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index f98f51846a3e..f372f8e4c8a4 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -20,7 +20,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetNetworkFabricAccessControlLists_AccessControlListsListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/AccessControlLists_ListBySubscription.json // this example is just showing the usage of "AccessControlLists_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task GetNetworkFabricAccessControlLists_AccessControlListsListBySub // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -49,10 +49,10 @@ public async Task GetNetworkFabricAccessControlLists_AccessControlListsListBySub [Test] [Ignore("Only validating compilation of examples")] - public async Task GetNetworkFabricInternetGateways_InternetGatewaysListBySubscriptionMaximumSetGen() + public async Task GetNetworkFabricInternetGatewayRules_InternetGatewayRulesListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_ListBySubscription_MaximumSet_Gen.json - // this example is just showing the usage of "InternetGateways_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternetGatewayRules_ListBySubscription.json + // this example is just showing the usage of "InternetGatewayRules_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -61,16 +61,16 @@ public async Task GetNetworkFabricInternetGateways_InternetGatewaysListBySubscri // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation and iterate over the result - await foreach (NetworkFabricInternetGatewayResource item in subscriptionResource.GetNetworkFabricInternetGatewaysAsync()) + await foreach (NetworkFabricInternetGatewayRuleResource item in subscriptionResource.GetNetworkFabricInternetGatewayRulesAsync()) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - NetworkFabricInternetGatewayData resourceData = item.Data; + NetworkFabricInternetGatewayRuleData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -80,10 +80,10 @@ public async Task GetNetworkFabricInternetGateways_InternetGatewaysListBySubscri [Test] [Ignore("Only validating compilation of examples")] - public async Task GetNetworkFabricInternetGatewayRules_InternetGatewayRulesListBySubscriptionMaximumSetGen() + public async Task GetNetworkFabricInternetGateways_InternetGatewaysListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_ListBySubscription_MaximumSet_Gen.json - // this example is just showing the usage of "InternetGatewayRules_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/InternetGateways_ListBySubscription.json + // this example is just showing the usage of "InternetGateways_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -92,16 +92,16 @@ public async Task GetNetworkFabricInternetGatewayRules_InternetGatewayRulesListB // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation and iterate over the result - await foreach (NetworkFabricInternetGatewayRuleResource item in subscriptionResource.GetNetworkFabricInternetGatewayRulesAsync()) + await foreach (NetworkFabricInternetGatewayResource item in subscriptionResource.GetNetworkFabricInternetGatewaysAsync()) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - NetworkFabricInternetGatewayRuleData resourceData = item.Data; + NetworkFabricInternetGatewayData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -113,7 +113,7 @@ public async Task GetNetworkFabricInternetGatewayRules_InternetGatewayRulesListB [Ignore("Only validating compilation of examples")] public async Task GetNetworkFabricIPCommunities_IpCommunitiesListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpCommunities_ListBySubscription.json // this example is just showing the usage of "IpCommunities_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task GetNetworkFabricIPCommunities_IpCommunitiesListBySubscriptionM // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -144,7 +144,7 @@ public async Task GetNetworkFabricIPCommunities_IpCommunitiesListBySubscriptionM [Ignore("Only validating compilation of examples")] public async Task GetNetworkFabricIPExtendedCommunities_IpExtendedCommunitiesListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpExtendedCommunities_ListBySubscription.json // this example is just showing the usage of "IpExtendedCommunities_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -154,7 +154,7 @@ public async Task GetNetworkFabricIPExtendedCommunities_IpExtendedCommunitiesLis // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -175,7 +175,7 @@ public async Task GetNetworkFabricIPExtendedCommunities_IpExtendedCommunitiesLis [Ignore("Only validating compilation of examples")] public async Task GetNetworkFabricIPPrefixes_IpPrefixesListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/IpPrefixes_ListBySubscription.json // this example is just showing the usage of "IpPrefixes_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -185,7 +185,7 @@ public async Task GetNetworkFabricIPPrefixes_IpPrefixesListBySubscriptionMaximum // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -206,7 +206,7 @@ public async Task GetNetworkFabricIPPrefixes_IpPrefixesListBySubscriptionMaximum [Ignore("Only validating compilation of examples")] public async Task GetNetworkFabricL2IsolationDomains_L2IsolationDomainsListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L2IsolationDomains_ListBySubscription.json // this example is just showing the usage of "L2IsolationDomains_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -216,7 +216,7 @@ public async Task GetNetworkFabricL2IsolationDomains_L2IsolationDomainsListBySub // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -237,7 +237,7 @@ public async Task GetNetworkFabricL2IsolationDomains_L2IsolationDomainsListBySub [Ignore("Only validating compilation of examples")] public async Task GetNetworkFabricL3IsolationDomains_L3IsolationDomainsListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/L3IsolationDomains_ListBySubscription.json // this example is just showing the usage of "L3IsolationDomains_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -247,7 +247,7 @@ public async Task GetNetworkFabricL3IsolationDomains_L3IsolationDomainsListBySub // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -268,7 +268,7 @@ public async Task GetNetworkFabricL3IsolationDomains_L3IsolationDomainsListBySub [Ignore("Only validating compilation of examples")] public async Task GetNetworkFabricNeighborGroups_NeighborGroupsListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NeighborGroups_ListBySubscription.json // this example is just showing the usage of "NeighborGroups_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -278,7 +278,7 @@ public async Task GetNetworkFabricNeighborGroups_NeighborGroupsListBySubscriptio // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -299,7 +299,7 @@ public async Task GetNetworkFabricNeighborGroups_NeighborGroupsListBySubscriptio [Ignore("Only validating compilation of examples")] public async Task GetNetworkDevices_NetworkDevicesListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkDevices_ListBySubscription.json // this example is just showing the usage of "NetworkDevices_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -309,7 +309,7 @@ public async Task GetNetworkDevices_NetworkDevicesListBySubscriptionMaximumSetGe // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -330,7 +330,7 @@ public async Task GetNetworkDevices_NetworkDevicesListBySubscriptionMaximumSetGe [Ignore("Only validating compilation of examples")] public async Task GetNetworkFabricControllers_NetworkFabricControllersListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabricControllers_ListBySubscription.json // this example is just showing the usage of "NetworkFabricControllers_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -340,7 +340,7 @@ public async Task GetNetworkFabricControllers_NetworkFabricControllersListBySubs // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -361,7 +361,7 @@ public async Task GetNetworkFabricControllers_NetworkFabricControllersListBySubs [Ignore("Only validating compilation of examples")] public async Task GetNetworkFabrics_NetworkFabricsListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkFabrics_ListBySubscription.json // this example is just showing the usage of "NetworkFabrics_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -371,7 +371,7 @@ public async Task GetNetworkFabrics_NetworkFabricsListBySubscriptionMaximumSetGe // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -388,11 +388,42 @@ public async Task GetNetworkFabrics_NetworkFabricsListBySubscriptionMaximumSetGe Console.WriteLine("Succeeded"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetNetworkMonitors_NetworkMonitorsListBySubscription() + { + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkMonitors_ListBySubscription.json + // this example is just showing the usage of "NetworkMonitors_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (NetworkMonitorResource item in subscriptionResource.GetNetworkMonitorsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NetworkMonitorData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task GetNetworkPacketBrokers_NetworkPacketBrokersListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkPacketBrokers_ListBySubscription.json // this example is just showing the usage of "NetworkPacketBrokers_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -402,7 +433,7 @@ public async Task GetNetworkPacketBrokers_NetworkPacketBrokersListBySubscription // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -423,7 +454,7 @@ public async Task GetNetworkPacketBrokers_NetworkPacketBrokersListBySubscription [Ignore("Only validating compilation of examples")] public async Task GetNetworkRacks_NetworkRacksListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkRacks_ListBySubscription.json // this example is just showing the usage of "NetworkRacks_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -433,7 +464,7 @@ public async Task GetNetworkRacks_NetworkRacksListBySubscriptionMaximumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -454,7 +485,7 @@ public async Task GetNetworkRacks_NetworkRacksListBySubscriptionMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetNetworkTapRules_NetworkTapRulesListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTapRules_ListBySubscription.json // this example is just showing the usage of "NetworkTapRules_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -464,7 +495,7 @@ public async Task GetNetworkTapRules_NetworkTapRulesListBySubscriptionMaximumSet // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -485,7 +516,7 @@ public async Task GetNetworkTapRules_NetworkTapRulesListBySubscriptionMaximumSet [Ignore("Only validating compilation of examples")] public async Task GetNetworkTaps_NetworkTapsListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/NetworkTaps_ListBySubscription.json // this example is just showing the usage of "NetworkTaps_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -495,7 +526,7 @@ public async Task GetNetworkTaps_NetworkTapsListBySubscriptionMaximumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -516,7 +547,7 @@ public async Task GetNetworkTaps_NetworkTapsListBySubscriptionMaximumSetGen() [Ignore("Only validating compilation of examples")] public async Task GetNetworkFabricRoutePolicies_RoutePoliciesListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2024-06-15-preview/examples/RoutePolicies_ListBySubscription.json // this example is just showing the usage of "RoutePolicies_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -526,7 +557,7 @@ public async Task GetNetworkFabricRoutePolicies_RoutePoliciesListBySubscriptionM // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "1234ABCD-0A1B-1234-5678-123456ABCDEF"; + string subscriptionId = "0000ABCD-0A0B-0000-0000-000000ABCDEF"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);