diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/CHANGELOG.md b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/CHANGELOG.md index 937d8521f4fd..ed177bf8c3ac 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/CHANGELOG.md +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/CHANGELOG.md @@ -1,5 +1,389 @@ # Release History +## 1.0.0 (2023-07-28) +### Breaking Changes + +- Function `*NetworkDevicesClient.BeginReboot` parameter(s) have been changed from `(context.Context, string, string, *NetworkDevicesClientBeginRebootOptions)` to `(context.Context, string, string, RebootProperties, *NetworkDevicesClientBeginRebootOptions)` +- Function `*NetworkFabricsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, NetworkFabricPatchParameters, *NetworkFabricsClientBeginUpdateOptions)` to `(context.Context, string, string, NetworkFabricPatch, *NetworkFabricsClientBeginUpdateOptions)` +- Function `*NetworkRacksClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, NetworkRackPatch, *NetworkRacksClientBeginUpdateOptions)` to `(context.Context, string, string, TagsUpdate, *NetworkRacksClientBeginUpdateOptions)` +- Type of `BfdConfiguration.AdministrativeState` has been changed from `*EnabledDisabledState` to `*BfdAdministrativeState` +- Type of `BgpConfiguration.FabricASN` has been changed from `*int32` to `*int64` +- Type of `BgpConfiguration.PeerASN` has been changed from `*int32` to `*int64` +- Type of `ExternalNetworkPatchProperties.OptionAProperties` has been changed from `*Layer3OptionAProperties` to `*ExternalNetworkPatchPropertiesOptionAProperties` +- Type of `ExternalNetworkPatchProperties.OptionBProperties` has been changed from `*OptionBProperties` to `*L3OptionBProperties` +- Type of `ExternalNetworkProperties.AdministrativeState` has been changed from `*EnabledDisabledState` to `*AdministrativeState` +- Type of `ExternalNetworkProperties.OptionBProperties` has been changed from `*OptionBProperties` to `*L3OptionBProperties` +- Type of `ExternalNetworkPropertiesOptionAProperties.FabricASN` has been changed from `*int32` to `*int64` +- Type of `ExternalNetworkPropertiesOptionAProperties.PeerASN` has been changed from `*int32` to `*int64` +- Type of `IPPrefixProperties.IPPrefixRules` has been changed from `[]*IPPrefixPropertiesIPPrefixRulesItem` to `[]*IPPrefixRule` +- Type of `InternalNetworkProperties.AdministrativeState` has been changed from `*EnabledDisabledState` to `*AdministrativeState` +- Type of `InternalNetworkProperties.BgpConfiguration` has been changed from `*BgpConfiguration` to `*InternalNetworkPropertiesBgpConfiguration` +- Type of `InternalNetworkProperties.StaticRouteConfiguration` has been changed from `*StaticRouteConfiguration` to `*InternalNetworkPropertiesStaticRouteConfiguration` +- Type of `L2IsolationDomainProperties.AdministrativeState` has been changed from `*EnabledDisabledState` to `*AdministrativeState` +- Type of `L3IsolationDomainPatchProperties.ConnectedSubnetRoutePolicy` has been changed from `*L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy` to `*ConnectedSubnetRoutePolicy` +- Type of `L3IsolationDomainProperties.AdministrativeState` has been changed from `*EnabledDisabledState` to `*AdministrativeState` +- Type of `L3IsolationDomainProperties.ConnectedSubnetRoutePolicy` has been changed from `*L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy` to `*ConnectedSubnetRoutePolicy` +- Type of `NetworkDeviceProperties.NetworkDeviceRole` has been changed from `*NetworkDeviceRoleTypes` to `*NetworkDeviceRole` +- Type of `NetworkFabricControllerProperties.InfrastructureServices` has been changed from `*InfrastructureServices` to `*ControllerServices` +- Type of `NetworkFabricControllerProperties.WorkloadServices` has been changed from `*WorkloadServices` to `*ControllerServices` +- Type of `NetworkFabricProperties.FabricASN` has been changed from `*int32` to `*int64` +- Type of `NetworkFabricProperties.ManagementNetworkConfiguration` has been changed from `*ManagementNetworkConfiguration` to `*ManagementNetworkConfigurationProperties` +- Type of `NetworkFabricSKUProperties.Type` has been changed from `*string` to `*FabricSKUType` +- Type of `NetworkInterfaceProperties.AdministrativeState` has been changed from `*EnabledDisabledState` to `*AdministrativeState` +- Type of `NetworkToNetworkInterconnectProperties.AdministrativeState` has been changed from `*EnabledDisabledState` to `*AdministrativeState` +- Type of `NetworkToNetworkInterconnectProperties.IsManagementType` has been changed from `*BooleanEnumProperty` to `*IsManagementType` +- Type of `StatementActionProperties.ActionType` has been changed from `*CommunityActionTypes` to `*RoutePolicyActionType` +- Type of `UpdateAdministrativeState.State` has been changed from `*AdministrativeState` to `*EnableDisableState` +- Type of `VPNConfigurationProperties.AdministrativeState` has been changed from `*EnabledDisabledState` to `*AdministrativeState` +- Type of `VPNConfigurationProperties.OptionAProperties` has been changed from `*OptionAProperties` to `*VPNConfigurationPropertiesOptionAProperties` +- Type of `VPNConfigurationProperties.OptionBProperties` has been changed from `*OptionBPropertiesAutoGenerated` to `*OptionBProperties` +- `AdministrativeStateDisable`, `AdministrativeStateEnable` from enum `AdministrativeState` has been removed +- Enum `AddressFamily` has been removed +- Enum `ConditionActionType` has been removed +- Enum `EnabledDisabledState` has been removed +- Enum `IsCurrentVersion` has been removed +- Enum `IsTestVersion` has been removed +- Enum `NetworkDeviceRackRoleType` has been removed +- Enum `NetworkDeviceRoleTypes` has been removed +- Enum `NetworkFabricControllerOperationalState` has been removed +- Enum `NetworkFabricOperationalState` has been removed +- Enum `NetworkRackRoleName` has been removed +- Enum `OperationalStatus` has been removed +- Enum `PowerCycleState` has been removed +- Enum `PowerEnd` has been removed +- Enum `State` has been removed +- Function `*ClientFactory.NewNetworkRackSKUsClient` has been removed +- Function `*ExternalNetworksClient.BeginClearArpEntries` has been removed +- Function `*ExternalNetworksClient.BeginClearIPv6Neighbors` has been removed +- Function `*ExternalNetworksClient.NewListPager` has been removed +- Function `*ExternalNetworksClient.BeginUpdateBfdForBgpAdministrativeState` has been removed +- Function `*ExternalNetworksClient.BeginUpdateBgpAdministrativeState` has been removed +- Function `*InternalNetworksClient.BeginClearArpEntries` has been removed +- Function `*InternalNetworksClient.BeginClearIPv6Neighbors` has been removed +- Function `*InternalNetworksClient.NewListPager` has been removed +- Function `*InternalNetworksClient.BeginUpdateBfdForBgpAdministrativeState` has been removed +- Function `*InternalNetworksClient.BeginUpdateBfdForStaticRouteAdministrativeState` has been removed +- Function `*L2IsolationDomainsClient.BeginClearArpTable` has been removed +- Function `*L2IsolationDomainsClient.BeginClearNeighborTable` has been removed +- Function `*L2IsolationDomainsClient.BeginGetArpEntries` has been removed +- Function `*L3IsolationDomainsClient.BeginClearArpTable` has been removed +- Function `*L3IsolationDomainsClient.BeginClearNeighborTable` has been removed +- Function `*L3IsolationDomainsClient.BeginUpdateOptionBAdministrativeState` has been removed +- Function `*NetworkDevicesClient.BeginGenerateSupportPackage` has been removed +- Function `*NetworkDevicesClient.BeginGetDynamicInterfaceMaps` has been removed +- Function `*NetworkDevicesClient.BeginGetStaticInterfaceMaps` has been removed +- Function `*NetworkDevicesClient.BeginGetStatus` has been removed +- Function `*NetworkDevicesClient.BeginRestoreConfig` has been removed +- Function `*NetworkDevicesClient.BeginUpdatePowerCycle` has been removed +- Function `*NetworkDevicesClient.BeginUpdateVersion` has been removed +- Function `*NetworkFabricControllersClient.BeginDisableWorkloadManagementNetwork` has been removed +- Function `*NetworkFabricControllersClient.BeginEnableWorkloadManagementNetwork` has been removed +- Function `*NetworkInterfacesClient.BeginGetStatus` has been removed +- Function `*NetworkInterfacesClient.NewListPager` has been removed +- Function `NewNetworkRackSKUsClient` has been removed +- Function `*NetworkRackSKUsClient.Get` has been removed +- Function `*NetworkRackSKUsClient.NewListBySubscriptionPager` has been removed +- Function `*NetworkToNetworkInterconnectsClient.NewListPager` has been removed +- Operation `*AccessControlListsClient.Create` has been changed to LRO, use `*AccessControlListsClient.BeginCreate` instead. +- Operation `*AccessControlListsClient.Delete` has been changed to LRO, use `*AccessControlListsClient.BeginDelete` instead. +- Operation `*AccessControlListsClient.Update` has been changed to LRO, use `*AccessControlListsClient.BeginUpdate` instead. +- Struct `ARPProperties` has been removed +- Struct `AccessControlListConditionProperties` has been removed +- Struct `DeviceLimits` has been removed +- Struct `EnableDisableOnResources` has been removed +- Struct `FabricBfdConfiguration` has been removed +- Struct `GetDeviceStatusProperties` has been removed +- Struct `GetDynamicInterfaceMapsPropertiesItem` has been removed +- Struct `GetStaticInterfaceMapsPropertiesItem` has been removed +- Struct `IPPrefixPropertiesIPPrefixRulesItem` has been removed +- Struct `InfrastructureServices` has been removed +- Struct `InterfaceStatus` has been removed +- Struct `L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy` has been removed +- Struct `Layer3Configuration` has been removed +- Struct `Layer3OptionAProperties` has been removed +- Struct `ManagementNetworkConfiguration` has been removed +- Struct `NetworkDeviceRoleProperties` has been removed +- Struct `NetworkFabricPatchParameters` has been removed +- Struct `NetworkFabricPatchParametersProperties` has been removed +- Struct `NetworkRackPatch` has been removed +- Struct `NetworkRackSKU` has been removed +- Struct `NetworkRackSKUProperties` has been removed +- Struct `NetworkRackSKUsListResult` has been removed +- Struct `OptionAProperties` has been removed +- Struct `OptionBPropertiesAutoGenerated` has been removed +- Struct `SupportPackageProperties` has been removed +- Struct `TerminalServerPatchableProperties` has been removed +- Struct `UpdatePowerCycleProperties` has been removed +- Struct `UpdateVersionProperties` has been removed +- Struct `WorkloadServices` has been removed +- Field `AddressFamily`, `Conditions` of struct `AccessControlListPatchProperties` has been removed +- Field `AddressFamily`, `Conditions` of struct `AccessControlListProperties` has been removed +- Field `Interval` of struct `BfdConfiguration` has been removed +- Field `DisabledOnResources` of struct `ExternalNetworkProperties` has been removed +- Field `Action`, `CommunityMembers`, `WellKnownCommunities` of struct `IPCommunityProperties` has been removed +- Field `Action`, `RouteTargets` of struct `IPExtendedCommunityProperties` has been removed +- Field `BfdDisabledOnResources`, `BfdForStaticRoutesDisabledOnResources`, `BgpDisabledOnResources`, `DisabledOnResources` of struct `InternalNetworkProperties` has been removed +- Field `DisabledOnResources` of struct `L2IsolationDomainProperties` has been removed +- Field `Description` of struct `L3IsolationDomainPatchProperties` has been removed +- Field `Description`, `DisabledOnResources`, `OptionBDisabledOnResources` of struct `L3IsolationDomainProperties` has been removed +- Field `PortCount` of struct `Layer2Configuration` has been removed +- Field `OperationalState` of struct `NeighborAddress` has been removed +- Field `Limits` of struct `NetworkDeviceSKUProperties` has been removed +- Field `OperationalState` of struct `NetworkFabricControllerProperties` has been removed +- Field `OperationalState`, `RouterID` of struct `NetworkFabricProperties` has been removed +- Field `DetailsURI`, `MaxSupportedVer`, `MinSupportedVer` of struct `NetworkFabricSKUProperties` has been removed +- Field `NetworkRackSKU` of struct `NetworkRackProperties` has been removed +- Field `Layer3Configuration` of struct `NetworkToNetworkInterconnectProperties` has been removed +- Field `IsCurrent`, `IsTest` of struct `SupportedVersionProperties` has been removed + +### Features Added + +- New value `AdministrativeStateDisabled`, `AdministrativeStateEnabled`, `AdministrativeStateMAT`, `AdministrativeStateRMA` added to enum type `AdministrativeState` +- New value `ConditionRange` added to enum type `Condition` +- New value `ProvisioningStateAccepted` added to enum type `ProvisioningState` +- New enum type `ACLActionType` with values `ACLActionTypeCount`, `ACLActionTypeDrop`, `ACLActionTypeLog` +- New enum type `Action` with values `ActionAllow`, `ActionDeny` +- New enum type `AddressFamilyType` with values `AddressFamilyTypeIPv4`, `AddressFamilyTypeIPv6` +- New enum type `BfdAdministrativeState` with values `BfdAdministrativeStateDisabled`, `BfdAdministrativeStateEnabled`, `BfdAdministrativeStateMAT`, `BfdAdministrativeStateRMA` +- New enum type `ConfigurationState` with values `ConfigurationStateAccepted`, `ConfigurationStateDeferredControl`, `ConfigurationStateDeprovisioned`, `ConfigurationStateDeprovisioning`, `ConfigurationStateErrorDeprovisioning`, `ConfigurationStateErrorProvisioning`, `ConfigurationStateFailed`, `ConfigurationStateProvisioned`, `ConfigurationStateRejected`, `ConfigurationStateSucceeded` +- New enum type `ConfigurationType` with values `ConfigurationTypeFile`, `ConfigurationTypeInline` +- New enum type `DestinationType` with values `DestinationTypeDirect`, `DestinationTypeIsolationDomain` +- New enum type `DeviceAdministrativeState` with values `DeviceAdministrativeStateGracefulQuarantine`, `DeviceAdministrativeStateQuarantine`, `DeviceAdministrativeStateRMA`, `DeviceAdministrativeStateResync` +- New enum type `EnableDisableState` with values `EnableDisableStateDisable`, `EnableDisableStateEnable` +- New enum type `Encapsulation` with values `EncapsulationGRE`, `EncapsulationNone` +- New enum type `EncapsulationType` with values `EncapsulationTypeGTPv1`, `EncapsulationTypeNone` +- New enum type `Extension` with values `ExtensionNPB`, `ExtensionNoExtension` +- New enum type `FabricSKUType` with values `FabricSKUTypeMultiRack`, `FabricSKUTypeSingleRack` +- New enum type `GatewayType` with values `GatewayTypeInfrastructure`, `GatewayTypeWorkload` +- New enum type `IPAddressType` with values `IPAddressTypeIPv4`, `IPAddressTypeIPv6` +- New enum type `IsManagementType` with values `IsManagementTypeFalse`, `IsManagementTypeTrue` +- New enum type `IsMonitoringEnabled` with values `IsMonitoringEnabledFalse`, `IsMonitoringEnabledTrue` +- New enum type `IsWorkloadManagementNetworkEnabled` with values `IsWorkloadManagementNetworkEnabledFalse`, `IsWorkloadManagementNetworkEnabledTrue` +- New enum type `Layer4Protocol` with values `Layer4ProtocolTCP`, `Layer4ProtocolUDP` +- New enum type `NetworkDeviceRole` with values `NetworkDeviceRoleCE`, `NetworkDeviceRoleManagement`, `NetworkDeviceRoleNPB`, `NetworkDeviceRoleTS`, `NetworkDeviceRoleToR` +- New enum type `NetworkRackType` with values `NetworkRackTypeAggregate`, `NetworkRackTypeCombined`, `NetworkRackTypeCompute` +- New enum type `NfcSKU` with values `NfcSKUBasic`, `NfcSKUHighPerformance`, `NfcSKUStandard` +- New enum type `PollingIntervalInSeconds` with values `PollingIntervalInSecondsNinety`, `PollingIntervalInSecondsOneHundredTwenty`, `PollingIntervalInSecondsSixty`, `PollingIntervalInSecondsThirty` +- New enum type `PollingType` with values `PollingTypePull`, `PollingTypePush` +- New enum type `PortType` with values `PortTypeDestinationPort`, `PortTypeSourcePort` +- New enum type `PrefixType` with values `PrefixTypeLongestPrefix`, `PrefixTypePrefix` +- New enum type `RebootType` with values `RebootTypeGracefulRebootWithZTP`, `RebootTypeGracefulRebootWithoutZTP`, `RebootTypeUngracefulRebootWithZTP`, `RebootTypeUngracefulRebootWithoutZTP` +- New enum type `RoutePolicyActionType` with values `RoutePolicyActionTypeContinue`, `RoutePolicyActionTypeDeny`, `RoutePolicyActionTypePermit` +- New enum type `RoutePolicyConditionType` with values `RoutePolicyConditionTypeAnd`, `RoutePolicyConditionTypeOr` +- New enum type `SourceDestinationType` with values `SourceDestinationTypeDestinationIP`, `SourceDestinationTypeSourceIP` +- New enum type `TapRuleActionType` with values `TapRuleActionTypeCount`, `TapRuleActionTypeDrop`, `TapRuleActionTypeGoto`, `TapRuleActionTypeLog`, `TapRuleActionTypeMirror`, `TapRuleActionTypeRedirect`, `TapRuleActionTypeReplicate` +- New enum type `ValidateAction` with values `ValidateActionCabling`, `ValidateActionConfiguration`, `ValidateActionConnectivity` +- New function `*AccessControlListsClient.BeginResync(context.Context, string, string, *AccessControlListsClientBeginResyncOptions) (*runtime.Poller[AccessControlListsClientResyncResponse], error)` +- New function `*AccessControlListsClient.BeginUpdateAdministrativeState(context.Context, string, string, UpdateAdministrativeState, *AccessControlListsClientBeginUpdateAdministrativeStateOptions) (*runtime.Poller[AccessControlListsClientUpdateAdministrativeStateResponse], error)` +- New function `*AccessControlListsClient.BeginValidateConfiguration(context.Context, string, string, *AccessControlListsClientBeginValidateConfigurationOptions) (*runtime.Poller[AccessControlListsClientValidateConfigurationResponse], error)` +- New function `*ClientFactory.NewInternetGatewayRulesClient() *InternetGatewayRulesClient` +- New function `*ClientFactory.NewInternetGatewaysClient() *InternetGatewaysClient` +- New function `*ClientFactory.NewNeighborGroupsClient() *NeighborGroupsClient` +- New function `*ClientFactory.NewNetworkPacketBrokersClient() *NetworkPacketBrokersClient` +- New function `*ClientFactory.NewNetworkTapRulesClient() *NetworkTapRulesClient` +- New function `*ClientFactory.NewNetworkTapsClient() *NetworkTapsClient` +- New function `*ExternalNetworksClient.NewListByL3IsolationDomainPager(string, string, *ExternalNetworksClientListByL3IsolationDomainOptions) *runtime.Pager[ExternalNetworksClientListByL3IsolationDomainResponse]` +- New function `*ExternalNetworksClient.BeginUpdateStaticRouteBfdAdministrativeState(context.Context, string, string, string, UpdateAdministrativeState, *ExternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions) (*runtime.Poller[ExternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse], error)` +- New function `*InternalNetworksClient.NewListByL3IsolationDomainPager(string, string, *InternalNetworksClientListByL3IsolationDomainOptions) *runtime.Pager[InternalNetworksClientListByL3IsolationDomainResponse]` +- New function `*InternalNetworksClient.BeginUpdateStaticRouteBfdAdministrativeState(context.Context, string, string, string, UpdateAdministrativeState, *InternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions) (*runtime.Poller[InternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse], error)` +- New function `NewInternetGatewayRulesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*InternetGatewayRulesClient, error)` +- New function `*InternetGatewayRulesClient.BeginCreate(context.Context, string, string, InternetGatewayRule, *InternetGatewayRulesClientBeginCreateOptions) (*runtime.Poller[InternetGatewayRulesClientCreateResponse], error)` +- New function `*InternetGatewayRulesClient.BeginDelete(context.Context, string, string, *InternetGatewayRulesClientBeginDeleteOptions) (*runtime.Poller[InternetGatewayRulesClientDeleteResponse], error)` +- New function `*InternetGatewayRulesClient.Get(context.Context, string, string, *InternetGatewayRulesClientGetOptions) (InternetGatewayRulesClientGetResponse, error)` +- New function `*InternetGatewayRulesClient.NewListByResourceGroupPager(string, *InternetGatewayRulesClientListByResourceGroupOptions) *runtime.Pager[InternetGatewayRulesClientListByResourceGroupResponse]` +- New function `*InternetGatewayRulesClient.NewListBySubscriptionPager(*InternetGatewayRulesClientListBySubscriptionOptions) *runtime.Pager[InternetGatewayRulesClientListBySubscriptionResponse]` +- New function `*InternetGatewayRulesClient.BeginUpdate(context.Context, string, string, InternetGatewayRulePatch, *InternetGatewayRulesClientBeginUpdateOptions) (*runtime.Poller[InternetGatewayRulesClientUpdateResponse], error)` +- New function `NewInternetGatewaysClient(string, azcore.TokenCredential, *arm.ClientOptions) (*InternetGatewaysClient, error)` +- New function `*InternetGatewaysClient.BeginCreate(context.Context, string, string, InternetGateway, *InternetGatewaysClientBeginCreateOptions) (*runtime.Poller[InternetGatewaysClientCreateResponse], error)` +- New function `*InternetGatewaysClient.BeginDelete(context.Context, string, string, *InternetGatewaysClientBeginDeleteOptions) (*runtime.Poller[InternetGatewaysClientDeleteResponse], error)` +- New function `*InternetGatewaysClient.Get(context.Context, string, string, *InternetGatewaysClientGetOptions) (InternetGatewaysClientGetResponse, error)` +- New function `*InternetGatewaysClient.NewListByResourceGroupPager(string, *InternetGatewaysClientListByResourceGroupOptions) *runtime.Pager[InternetGatewaysClientListByResourceGroupResponse]` +- New function `*InternetGatewaysClient.NewListBySubscriptionPager(*InternetGatewaysClientListBySubscriptionOptions) *runtime.Pager[InternetGatewaysClientListBySubscriptionResponse]` +- New function `*InternetGatewaysClient.BeginUpdate(context.Context, string, string, InternetGatewayPatch, *InternetGatewaysClientBeginUpdateOptions) (*runtime.Poller[InternetGatewaysClientUpdateResponse], error)` +- New function `*L2IsolationDomainsClient.BeginCommitConfiguration(context.Context, string, string, *L2IsolationDomainsClientBeginCommitConfigurationOptions) (*runtime.Poller[L2IsolationDomainsClientCommitConfigurationResponse], error)` +- New function `*L2IsolationDomainsClient.BeginValidateConfiguration(context.Context, string, string, *L2IsolationDomainsClientBeginValidateConfigurationOptions) (*runtime.Poller[L2IsolationDomainsClientValidateConfigurationResponse], error)` +- New function `*L3IsolationDomainsClient.BeginCommitConfiguration(context.Context, string, string, *L3IsolationDomainsClientBeginCommitConfigurationOptions) (*runtime.Poller[L3IsolationDomainsClientCommitConfigurationResponse], error)` +- New function `*L3IsolationDomainsClient.BeginValidateConfiguration(context.Context, string, string, *L3IsolationDomainsClientBeginValidateConfigurationOptions) (*runtime.Poller[L3IsolationDomainsClientValidateConfigurationResponse], error)` +- New function `*RoutePoliciesClient.BeginCommitConfiguration(context.Context, string, string, *RoutePoliciesClientBeginCommitConfigurationOptions) (*runtime.Poller[RoutePoliciesClientCommitConfigurationResponse], error)` +- New function `*RoutePoliciesClient.BeginUpdateAdministrativeState(context.Context, string, string, UpdateAdministrativeState, *RoutePoliciesClientBeginUpdateAdministrativeStateOptions) (*runtime.Poller[RoutePoliciesClientUpdateAdministrativeStateResponse], error)` +- New function `*RoutePoliciesClient.BeginValidateConfiguration(context.Context, string, string, *RoutePoliciesClientBeginValidateConfigurationOptions) (*runtime.Poller[RoutePoliciesClientValidateConfigurationResponse], error)` +- New function `NewNeighborGroupsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NeighborGroupsClient, error)` +- New function `*NeighborGroupsClient.BeginCreate(context.Context, string, string, NeighborGroup, *NeighborGroupsClientBeginCreateOptions) (*runtime.Poller[NeighborGroupsClientCreateResponse], error)` +- New function `*NeighborGroupsClient.BeginDelete(context.Context, string, string, *NeighborGroupsClientBeginDeleteOptions) (*runtime.Poller[NeighborGroupsClientDeleteResponse], error)` +- New function `*NeighborGroupsClient.Get(context.Context, string, string, *NeighborGroupsClientGetOptions) (NeighborGroupsClientGetResponse, error)` +- New function `*NeighborGroupsClient.NewListByResourceGroupPager(string, *NeighborGroupsClientListByResourceGroupOptions) *runtime.Pager[NeighborGroupsClientListByResourceGroupResponse]` +- New function `*NeighborGroupsClient.NewListBySubscriptionPager(*NeighborGroupsClientListBySubscriptionOptions) *runtime.Pager[NeighborGroupsClientListBySubscriptionResponse]` +- New function `*NeighborGroupsClient.BeginUpdate(context.Context, string, string, NeighborGroupPatch, *NeighborGroupsClientBeginUpdateOptions) (*runtime.Poller[NeighborGroupsClientUpdateResponse], error)` +- New function `*NetworkDevicesClient.BeginRefreshConfiguration(context.Context, string, string, *NetworkDevicesClientBeginRefreshConfigurationOptions) (*runtime.Poller[NetworkDevicesClientRefreshConfigurationResponse], error)` +- New function `*NetworkDevicesClient.BeginUpdateAdministrativeState(context.Context, string, string, UpdateDeviceAdministrativeState, *NetworkDevicesClientBeginUpdateAdministrativeStateOptions) (*runtime.Poller[NetworkDevicesClientUpdateAdministrativeStateResponse], error)` +- New function `*NetworkDevicesClient.BeginUpgrade(context.Context, string, string, UpdateVersion, *NetworkDevicesClientBeginUpgradeOptions) (*runtime.Poller[NetworkDevicesClientUpgradeResponse], error)` +- New function `*NetworkFabricsClient.BeginCommitConfiguration(context.Context, string, string, *NetworkFabricsClientBeginCommitConfigurationOptions) (*runtime.Poller[NetworkFabricsClientCommitConfigurationResponse], error)` +- New function `*NetworkFabricsClient.BeginGetTopology(context.Context, string, string, *NetworkFabricsClientBeginGetTopologyOptions) (*runtime.Poller[NetworkFabricsClientGetTopologyResponse], error)` +- New function `*NetworkFabricsClient.BeginRefreshConfiguration(context.Context, string, string, *NetworkFabricsClientBeginRefreshConfigurationOptions) (*runtime.Poller[NetworkFabricsClientRefreshConfigurationResponse], error)` +- New function `*NetworkFabricsClient.BeginUpdateInfraManagementBfdConfiguration(context.Context, string, string, UpdateAdministrativeState, *NetworkFabricsClientBeginUpdateInfraManagementBfdConfigurationOptions) (*runtime.Poller[NetworkFabricsClientUpdateInfraManagementBfdConfigurationResponse], error)` +- New function `*NetworkFabricsClient.BeginUpdateWorkloadManagementBfdConfiguration(context.Context, string, string, UpdateAdministrativeState, *NetworkFabricsClientBeginUpdateWorkloadManagementBfdConfigurationOptions) (*runtime.Poller[NetworkFabricsClientUpdateWorkloadManagementBfdConfigurationResponse], error)` +- New function `*NetworkFabricsClient.BeginUpgrade(context.Context, string, string, UpdateVersion, *NetworkFabricsClientBeginUpgradeOptions) (*runtime.Poller[NetworkFabricsClientUpgradeResponse], error)` +- New function `*NetworkFabricsClient.BeginValidateConfiguration(context.Context, string, string, ValidateConfigurationProperties, *NetworkFabricsClientBeginValidateConfigurationOptions) (*runtime.Poller[NetworkFabricsClientValidateConfigurationResponse], error)` +- New function `*NetworkInterfacesClient.NewListByNetworkDevicePager(string, string, *NetworkInterfacesClientListByNetworkDeviceOptions) *runtime.Pager[NetworkInterfacesClientListByNetworkDeviceResponse]` +- New function `NewNetworkPacketBrokersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NetworkPacketBrokersClient, error)` +- New function `*NetworkPacketBrokersClient.BeginCreate(context.Context, string, string, NetworkPacketBroker, *NetworkPacketBrokersClientBeginCreateOptions) (*runtime.Poller[NetworkPacketBrokersClientCreateResponse], error)` +- New function `*NetworkPacketBrokersClient.BeginDelete(context.Context, string, string, *NetworkPacketBrokersClientBeginDeleteOptions) (*runtime.Poller[NetworkPacketBrokersClientDeleteResponse], error)` +- New function `*NetworkPacketBrokersClient.Get(context.Context, string, string, *NetworkPacketBrokersClientGetOptions) (NetworkPacketBrokersClientGetResponse, error)` +- New function `*NetworkPacketBrokersClient.NewListByResourceGroupPager(string, *NetworkPacketBrokersClientListByResourceGroupOptions) *runtime.Pager[NetworkPacketBrokersClientListByResourceGroupResponse]` +- New function `*NetworkPacketBrokersClient.NewListBySubscriptionPager(*NetworkPacketBrokersClientListBySubscriptionOptions) *runtime.Pager[NetworkPacketBrokersClientListBySubscriptionResponse]` +- New function `*NetworkPacketBrokersClient.BeginUpdate(context.Context, string, string, NetworkPacketBrokerPatch, *NetworkPacketBrokersClientBeginUpdateOptions) (*runtime.Poller[NetworkPacketBrokersClientUpdateResponse], error)` +- New function `NewNetworkTapRulesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NetworkTapRulesClient, error)` +- New function `*NetworkTapRulesClient.BeginCreate(context.Context, string, string, NetworkTapRule, *NetworkTapRulesClientBeginCreateOptions) (*runtime.Poller[NetworkTapRulesClientCreateResponse], error)` +- New function `*NetworkTapRulesClient.BeginDelete(context.Context, string, string, *NetworkTapRulesClientBeginDeleteOptions) (*runtime.Poller[NetworkTapRulesClientDeleteResponse], error)` +- New function `*NetworkTapRulesClient.Get(context.Context, string, string, *NetworkTapRulesClientGetOptions) (NetworkTapRulesClientGetResponse, error)` +- New function `*NetworkTapRulesClient.NewListByResourceGroupPager(string, *NetworkTapRulesClientListByResourceGroupOptions) *runtime.Pager[NetworkTapRulesClientListByResourceGroupResponse]` +- New function `*NetworkTapRulesClient.NewListBySubscriptionPager(*NetworkTapRulesClientListBySubscriptionOptions) *runtime.Pager[NetworkTapRulesClientListBySubscriptionResponse]` +- New function `*NetworkTapRulesClient.BeginResync(context.Context, string, string, *NetworkTapRulesClientBeginResyncOptions) (*runtime.Poller[NetworkTapRulesClientResyncResponse], error)` +- New function `*NetworkTapRulesClient.BeginUpdate(context.Context, string, string, NetworkTapRulePatch, *NetworkTapRulesClientBeginUpdateOptions) (*runtime.Poller[NetworkTapRulesClientUpdateResponse], error)` +- New function `*NetworkTapRulesClient.BeginUpdateAdministrativeState(context.Context, string, string, UpdateAdministrativeState, *NetworkTapRulesClientBeginUpdateAdministrativeStateOptions) (*runtime.Poller[NetworkTapRulesClientUpdateAdministrativeStateResponse], error)` +- New function `*NetworkTapRulesClient.BeginValidateConfiguration(context.Context, string, string, *NetworkTapRulesClientBeginValidateConfigurationOptions) (*runtime.Poller[NetworkTapRulesClientValidateConfigurationResponse], error)` +- New function `NewNetworkTapsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NetworkTapsClient, error)` +- New function `*NetworkTapsClient.BeginCreate(context.Context, string, string, NetworkTap, *NetworkTapsClientBeginCreateOptions) (*runtime.Poller[NetworkTapsClientCreateResponse], error)` +- New function `*NetworkTapsClient.BeginDelete(context.Context, string, string, *NetworkTapsClientBeginDeleteOptions) (*runtime.Poller[NetworkTapsClientDeleteResponse], error)` +- New function `*NetworkTapsClient.Get(context.Context, string, string, *NetworkTapsClientGetOptions) (NetworkTapsClientGetResponse, error)` +- New function `*NetworkTapsClient.NewListByResourceGroupPager(string, *NetworkTapsClientListByResourceGroupOptions) *runtime.Pager[NetworkTapsClientListByResourceGroupResponse]` +- New function `*NetworkTapsClient.NewListBySubscriptionPager(*NetworkTapsClientListBySubscriptionOptions) *runtime.Pager[NetworkTapsClientListBySubscriptionResponse]` +- New function `*NetworkTapsClient.BeginResync(context.Context, string, string, *NetworkTapsClientBeginResyncOptions) (*runtime.Poller[NetworkTapsClientResyncResponse], error)` +- New function `*NetworkTapsClient.BeginUpdate(context.Context, string, string, NetworkTapPatch, *NetworkTapsClientBeginUpdateOptions) (*runtime.Poller[NetworkTapsClientUpdateResponse], error)` +- New function `*NetworkTapsClient.BeginUpdateAdministrativeState(context.Context, string, string, UpdateAdministrativeState, *NetworkTapsClientBeginUpdateAdministrativeStateOptions) (*runtime.Poller[NetworkTapsClientUpdateAdministrativeStateResponse], error)` +- New function `*NetworkToNetworkInterconnectsClient.NewListByNetworkFabricPager(string, string, *NetworkToNetworkInterconnectsClientListByNetworkFabricOptions) *runtime.Pager[NetworkToNetworkInterconnectsClientListByNetworkFabricResponse]` +- New function `*NetworkToNetworkInterconnectsClient.BeginUpdate(context.Context, string, string, string, NetworkToNetworkInterconnectPatch, *NetworkToNetworkInterconnectsClientBeginUpdateOptions) (*runtime.Poller[NetworkToNetworkInterconnectsClientUpdateResponse], error)` +- New function `*NetworkToNetworkInterconnectsClient.BeginUpdateAdministrativeState(context.Context, string, string, string, UpdateAdministrativeState, *NetworkToNetworkInterconnectsClientBeginUpdateAdministrativeStateOptions) (*runtime.Poller[NetworkToNetworkInterconnectsClientUpdateAdministrativeStateResponse], error)` +- New function `*NetworkToNetworkInterconnectsClient.BeginUpdateNpbStaticRouteBfdAdministrativeState(context.Context, string, string, string, UpdateAdministrativeState, *NetworkToNetworkInterconnectsClientBeginUpdateNpbStaticRouteBfdAdministrativeStateOptions) (*runtime.Poller[NetworkToNetworkInterconnectsClientUpdateNpbStaticRouteBfdAdministrativeStateResponse], error)` +- New struct `AccessControlListAction` +- New struct `AccessControlListMatchCondition` +- New struct `AccessControlListMatchConfiguration` +- New struct `AccessControlListPortCondition` +- New struct `CommonDynamicMatchConfiguration` +- New struct `CommonPostActionResponseForDeviceUpdate` +- New struct `CommonPostActionResponseForStateUpdate` +- New struct `ConnectedSubnetRoutePolicy` +- New struct `ControllerServices` +- New struct `ErrorAdditionalInfo` +- New struct `ErrorDetail` +- New struct `ExportRoutePolicy` +- New struct `ExportRoutePolicyInformation` +- New struct `ExternalNetworkPatchPropertiesOptionAProperties` +- New struct `IPCommunityPatchableProperties` +- New struct `IPCommunityRule` +- New struct `IPExtendedCommunityPatchProperties` +- New struct `IPExtendedCommunityRule` +- New struct `IPGroupProperties` +- New struct `IPMatchCondition` +- New struct `IPPrefixPatchProperties` +- New struct `IPPrefixRule` +- New struct `ImportRoutePolicy` +- New struct `ImportRoutePolicyInformation` +- New struct `InternalNetworkPropertiesBgpConfiguration` +- New struct `InternalNetworkPropertiesStaticRouteConfiguration` +- New struct `InternetGateway` +- New struct `InternetGatewayPatch` +- New struct `InternetGatewayPatchableProperties` +- New struct `InternetGatewayProperties` +- New struct `InternetGatewayRule` +- New struct `InternetGatewayRulePatch` +- New struct `InternetGatewayRuleProperties` +- New struct `InternetGatewayRulesListResult` +- New struct `InternetGatewaysListResult` +- New struct `IsolationDomainProperties` +- New struct `L3ExportRoutePolicy` +- New struct `L3OptionBProperties` +- New struct `ManagementNetworkConfigurationPatchableProperties` +- New struct `ManagementNetworkConfigurationProperties` +- New struct `NeighborGroup` +- New struct `NeighborGroupDestination` +- New struct `NeighborGroupPatch` +- New struct `NeighborGroupPatchProperties` +- New struct `NeighborGroupProperties` +- New struct `NeighborGroupsListResult` +- New struct `NetworkFabricPatch` +- New struct `NetworkFabricPatchProperties` +- New struct `NetworkFabricPatchablePropertiesTerminalServerConfiguration` +- New struct `NetworkPacketBroker` +- New struct `NetworkPacketBrokerPatch` +- New struct `NetworkPacketBrokerProperties` +- New struct `NetworkPacketBrokersListResult` +- New struct `NetworkTap` +- New struct `NetworkTapPatch` +- New struct `NetworkTapPatchableParameters` +- New struct `NetworkTapPatchableParametersDestinationsItem` +- New struct `NetworkTapProperties` +- New struct `NetworkTapPropertiesDestinationsItem` +- New struct `NetworkTapRule` +- New struct `NetworkTapRuleAction` +- New struct `NetworkTapRuleMatchCondition` +- New struct `NetworkTapRuleMatchConfiguration` +- New struct `NetworkTapRulePatch` +- New struct `NetworkTapRulePatchProperties` +- New struct `NetworkTapRuleProperties` +- New struct `NetworkTapRulesListResult` +- New struct `NetworkTapsListResult` +- New struct `NetworkToNetworkInterconnectPatch` +- New struct `NetworkToNetworkInterconnectPatchableProperties` +- New struct `NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration` +- New struct `NpbStaticRouteConfiguration` +- New struct `OptionBLayer3Configuration` +- New struct `PortCondition` +- New struct `PortGroupProperties` +- New struct `RebootProperties` +- New struct `RoutePolicyPatchableProperties` +- New struct `RouteTargetInformation` +- New struct `RuleProperties` +- New struct `TagsUpdate` +- New struct `UpdateDeviceAdministrativeState` +- New struct `UpdateVersion` +- New struct `VPNConfigurationPatchableProperties` +- New struct `VPNConfigurationPatchablePropertiesOptionAProperties` +- New struct `VPNConfigurationPropertiesOptionAProperties` +- New struct `ValidateConfigurationProperties` +- New struct `ValidateConfigurationResponse` +- New struct `VlanGroupProperties` +- New struct `VlanMatchCondition` +- New field `ACLsURL`, `ConfigurationType`, `DynamicMatchConfigurations`, `MatchConfigurations` in struct `AccessControlListPatchProperties` +- New field `ACLsURL`, `AdministrativeState`, `ConfigurationState`, `ConfigurationType`, `DynamicMatchConfigurations`, `LastSyncedTime`, `MatchConfigurations` in struct `AccessControlListProperties` +- New field `IntervalInMilliSeconds` in struct `BfdConfiguration` +- New field `ExportRoutePolicy`, `ImportRoutePolicy` in struct `ExternalNetworkPatchProperties` +- New field `ConfigurationState`, `ExportRoutePolicy`, `ImportRoutePolicy` in struct `ExternalNetworkProperties` +- New field `EgressACLID`, `IngressACLID` in struct `ExternalNetworkPropertiesOptionAProperties` +- New anonymous field `CommonPostActionResponseForStateUpdate` in struct `ExternalNetworksClientUpdateAdministrativeStateResponse` +- New field `Properties` in struct `IPCommunityPatch` +- New field `AdministrativeState`, `ConfigurationState`, `IPCommunityRules` in struct `IPCommunityProperties` +- New field `Properties` in struct `IPExtendedCommunityPatch` +- New field `AdministrativeState`, `ConfigurationState`, `IPExtendedCommunityRules` in struct `IPExtendedCommunityProperties` +- New field `Properties` in struct `IPPrefixPatch` +- New field `AdministrativeState`, `ConfigurationState` in struct `IPPrefixProperties` +- New field `EgressACLID`, `ExportRoutePolicy`, `ImportRoutePolicy`, `IngressACLID`, `IsMonitoringEnabled` in struct `InternalNetworkPatchProperties` +- New field `ConfigurationState`, `EgressACLID`, `ExportRoutePolicy`, `Extension`, `ImportRoutePolicy`, `IngressACLID`, `IsMonitoringEnabled` in struct `InternalNetworkProperties` +- New anonymous field `CommonPostActionResponseForStateUpdate` in struct `InternalNetworksClientUpdateAdministrativeStateResponse` +- New anonymous field `CommonPostActionResponseForStateUpdate` in struct `InternalNetworksClientUpdateBgpAdministrativeStateResponse` +- New field `ConfigurationState` in struct `L2IsolationDomainProperties` +- New anonymous field `CommonPostActionResponseForDeviceUpdate` in struct `L2IsolationDomainsClientUpdateAdministrativeStateResponse` +- New field `Annotation` in struct `L3IsolationDomainPatchProperties` +- New field `ConfigurationState` in struct `L3IsolationDomainProperties` +- New anonymous field `CommonPostActionResponseForDeviceUpdate` in struct `L3IsolationDomainsClientUpdateAdministrativeStateResponse` +- New field `ConfigurationState` in struct `NeighborAddress` +- New field `AdministrativeState`, `ConfigurationState`, `ManagementIPv4Address`, `ManagementIPv6Address` in struct `NetworkDeviceProperties` +- New anonymous field `CommonPostActionResponseForStateUpdate` in struct `NetworkDevicesClientRebootResponse` +- New field `IsWorkloadManagementNetworkEnabled`, `NfcSKU`, `TenantInternetGatewayIDs` in struct `NetworkFabricControllerProperties` +- New field `AdministrativeState`, `ConfigurationState`, `FabricVersion`, `RouterIDs` in struct `NetworkFabricProperties` +- New field `Details`, `MaximumServerCount`, `SupportedVersions` in struct `NetworkFabricSKUProperties` +- New anonymous field `CommonPostActionResponseForDeviceUpdate` in struct `NetworkFabricsClientDeprovisionResponse` +- New anonymous field `CommonPostActionResponseForDeviceUpdate` in struct `NetworkFabricsClientProvisionResponse` +- New anonymous field `CommonPostActionResponseForStateUpdate` in struct `NetworkInterfacesClientUpdateAdministrativeStateResponse` +- New field `NetworkRackType` in struct `NetworkRackProperties` +- New field `ConfigurationState`, `EgressACLID`, `ExportRoutePolicy`, `ImportRoutePolicy`, `IngressACLID`, `NpbStaticRouteConfiguration`, `OptionBLayer3Configuration` in struct `NetworkToNetworkInterconnectProperties` +- New field `RouteTargets` in struct `OptionBProperties` +- New field `Properties` in struct `RoutePolicyPatch` +- New field `AddressFamilyType`, `AdministrativeState`, `ConfigurationState`, `NetworkFabricID` in struct `RoutePolicyProperties` +- New field `Type` in struct `StatementConditionProperties` +- New field `IsDefault` in struct `SupportedVersionProperties` + + ## 0.1.0 (2023-06-30) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html). diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/accesscontrollists_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/accesscontrollists_client.go index 444747f0601c..e4bdb73a07a0 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/accesscontrollists_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/accesscontrollists_client.go @@ -29,7 +29,7 @@ type AccessControlListsClient struct { } // NewAccessControlListsClient creates a new instance of AccessControlListsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAccessControlListsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccessControlListsClient, error) { @@ -44,36 +44,51 @@ func NewAccessControlListsClient(subscriptionID string, credential azcore.TokenC return client, nil } -// Create - Implements Access Control List PUT method. +// BeginCreate - Implements Access Control List PUT method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accessControlListName - Name of the Access Control List +// - accessControlListName - Name of the Access Control List. // - body - Request payload. -// - options - AccessControlListsClientCreateOptions contains the optional parameters for the AccessControlListsClient.Create +// - options - AccessControlListsClientBeginCreateOptions contains the optional parameters for the AccessControlListsClient.BeginCreate // method. -func (client *AccessControlListsClient) Create(ctx context.Context, resourceGroupName string, accessControlListName string, body AccessControlList, options *AccessControlListsClientCreateOptions) (AccessControlListsClientCreateResponse, error) { +func (client *AccessControlListsClient) BeginCreate(ctx context.Context, resourceGroupName string, accessControlListName string, body AccessControlList, options *AccessControlListsClientBeginCreateOptions) (*runtime.Poller[AccessControlListsClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, accessControlListName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessControlListsClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[AccessControlListsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Create - Implements Access Control List PUT method. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *AccessControlListsClient) create(ctx context.Context, resourceGroupName string, accessControlListName string, body AccessControlList, options *AccessControlListsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accessControlListName, body, options) if err != nil { - return AccessControlListsClientCreateResponse{}, err + return nil, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return AccessControlListsClientCreateResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AccessControlListsClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) } - return client.createHandleResponse(resp) + return resp, nil } // createCreateRequest creates the Create request. -func (client *AccessControlListsClient) createCreateRequest(ctx context.Context, resourceGroupName string, accessControlListName string, body AccessControlList, options *AccessControlListsClientCreateOptions) (*policy.Request, error) { +func (client *AccessControlListsClient) createCreateRequest(ctx context.Context, resourceGroupName string, accessControlListName string, body AccessControlList, options *AccessControlListsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -88,50 +103,56 @@ func (client *AccessControlListsClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) } -// createHandleResponse handles the Create response. -func (client *AccessControlListsClient) createHandleResponse(resp *http.Response) (AccessControlListsClientCreateResponse, error) { - result := AccessControlListsClientCreateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AccessControlList); err != nil { - return AccessControlListsClientCreateResponse{}, err +// BeginDelete - Implements Access Control List DELETE method. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accessControlListName - Name of the Access Control List. +// - options - AccessControlListsClientBeginDeleteOptions contains the optional parameters for the AccessControlListsClient.BeginDelete +// method. +func (client *AccessControlListsClient) BeginDelete(ctx context.Context, resourceGroupName string, accessControlListName string, options *AccessControlListsClientBeginDeleteOptions) (*runtime.Poller[AccessControlListsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, accessControlListName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessControlListsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[AccessControlListsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } - return result, nil } // Delete - Implements Access Control List DELETE method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accessControlListName - Name of the Access Control List -// - options - AccessControlListsClientDeleteOptions contains the optional parameters for the AccessControlListsClient.Delete -// method. -func (client *AccessControlListsClient) Delete(ctx context.Context, resourceGroupName string, accessControlListName string, options *AccessControlListsClientDeleteOptions) (AccessControlListsClientDeleteResponse, error) { +// Generated from API version 2023-06-15 +func (client *AccessControlListsClient) deleteOperation(ctx context.Context, resourceGroupName string, accessControlListName string, options *AccessControlListsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accessControlListName, options) if err != nil { - return AccessControlListsClientDeleteResponse{}, err + return nil, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return AccessControlListsClientDeleteResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return AccessControlListsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) } - return AccessControlListsClientDeleteResponse{}, nil + return resp, nil } // deleteCreateRequest creates the Delete request. -func (client *AccessControlListsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accessControlListName string, options *AccessControlListsClientDeleteOptions) (*policy.Request, error) { +func (client *AccessControlListsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accessControlListName string, options *AccessControlListsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -146,7 +167,7 @@ func (client *AccessControlListsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -155,9 +176,9 @@ func (client *AccessControlListsClient) deleteCreateRequest(ctx context.Context, // Get - Implements Access Control List GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accessControlListName - Name of the Access Control List +// - accessControlListName - Name of the Access Control List. // - options - AccessControlListsClientGetOptions contains the optional parameters for the AccessControlListsClient.Get method. func (client *AccessControlListsClient) Get(ctx context.Context, resourceGroupName string, accessControlListName string, options *AccessControlListsClientGetOptions) (AccessControlListsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accessControlListName, options) @@ -177,9 +198,6 @@ func (client *AccessControlListsClient) Get(ctx context.Context, resourceGroupNa // getCreateRequest creates the Get request. func (client *AccessControlListsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accessControlListName string, options *AccessControlListsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -194,7 +212,7 @@ func (client *AccessControlListsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +229,7 @@ func (client *AccessControlListsClient) getHandleResponse(resp *http.Response) ( // NewListByResourceGroupPager - Implements AccessControlLists list by resource group GET method. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - AccessControlListsClientListByResourceGroupOptions contains the optional parameters for the AccessControlListsClient.NewListByResourceGroupPager // method. @@ -246,9 +264,6 @@ func (client *AccessControlListsClient) NewListByResourceGroupPager(resourceGrou // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *AccessControlListsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *AccessControlListsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -259,7 +274,7 @@ func (client *AccessControlListsClient) listByResourceGroupCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +291,7 @@ func (client *AccessControlListsClient) listByResourceGroupHandleResponse(resp * // NewListBySubscriptionPager - Implements AccessControlLists list by subscription GET method. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - options - AccessControlListsClientListBySubscriptionOptions contains the optional parameters for the AccessControlListsClient.NewListBySubscriptionPager // method. func (client *AccessControlListsClient) NewListBySubscriptionPager(options *AccessControlListsClientListBySubscriptionOptions) *runtime.Pager[AccessControlListsClientListBySubscriptionResponse] { @@ -310,16 +325,13 @@ func (client *AccessControlListsClient) NewListBySubscriptionPager(options *Acce // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *AccessControlListsClient) listBySubscriptionCreateRequest(ctx context.Context, options *AccessControlListsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/accessControlLists" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -334,36 +346,115 @@ func (client *AccessControlListsClient) listBySubscriptionHandleResponse(resp *h return result, nil } -// Update - API to update certain properties of the Access Control List resource. +// BeginResync - Implements the operation to the underlying resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accessControlListName - Name of the Access Control List. +// - options - AccessControlListsClientBeginResyncOptions contains the optional parameters for the AccessControlListsClient.BeginResync +// method. +func (client *AccessControlListsClient) BeginResync(ctx context.Context, resourceGroupName string, accessControlListName string, options *AccessControlListsClientBeginResyncOptions) (*runtime.Poller[AccessControlListsClientResyncResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.resync(ctx, resourceGroupName, accessControlListName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessControlListsClientResyncResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[AccessControlListsClientResyncResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Resync - Implements the operation to the underlying resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *AccessControlListsClient) resync(ctx context.Context, resourceGroupName string, accessControlListName string, options *AccessControlListsClientBeginResyncOptions) (*http.Response, error) { + req, err := client.resyncCreateRequest(ctx, resourceGroupName, accessControlListName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// resyncCreateRequest creates the Resync request. +func (client *AccessControlListsClient) resyncCreateRequest(ctx context.Context, resourceGroupName string, accessControlListName string, options *AccessControlListsClientBeginResyncOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/resync" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accessControlListName == "" { + return nil, errors.New("parameter accessControlListName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accessControlListName}", url.PathEscape(accessControlListName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginUpdate - API to update certain properties of the Access Control List resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accessControlListName - Name of the Access Control List +// - accessControlListName - Name of the Access Control List. // - body - Access Control List properties to update. -// - options - AccessControlListsClientUpdateOptions contains the optional parameters for the AccessControlListsClient.Update +// - options - AccessControlListsClientBeginUpdateOptions contains the optional parameters for the AccessControlListsClient.BeginUpdate // method. -func (client *AccessControlListsClient) Update(ctx context.Context, resourceGroupName string, accessControlListName string, body AccessControlListPatch, options *AccessControlListsClientUpdateOptions) (AccessControlListsClientUpdateResponse, error) { +func (client *AccessControlListsClient) BeginUpdate(ctx context.Context, resourceGroupName string, accessControlListName string, body AccessControlListPatch, options *AccessControlListsClientBeginUpdateOptions) (*runtime.Poller[AccessControlListsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, accessControlListName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessControlListsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[AccessControlListsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - API to update certain properties of the Access Control List resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *AccessControlListsClient) update(ctx context.Context, resourceGroupName string, accessControlListName string, body AccessControlListPatch, options *AccessControlListsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accessControlListName, body, options) if err != nil { - return AccessControlListsClientUpdateResponse{}, err + return nil, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return AccessControlListsClientUpdateResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AccessControlListsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) } - return client.updateHandleResponse(resp) + return resp, nil } // updateCreateRequest creates the Update request. -func (client *AccessControlListsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accessControlListName string, body AccessControlListPatch, options *AccessControlListsClientUpdateOptions) (*policy.Request, error) { +func (client *AccessControlListsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accessControlListName string, body AccessControlListPatch, options *AccessControlListsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -378,17 +469,137 @@ func (client *AccessControlListsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) } -// updateHandleResponse handles the Update response. -func (client *AccessControlListsClient) updateHandleResponse(resp *http.Response) (AccessControlListsClientUpdateResponse, error) { - result := AccessControlListsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AccessControlList); err != nil { - return AccessControlListsClientUpdateResponse{}, err +// BeginUpdateAdministrativeState - Implements the operation to the underlying resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accessControlListName - Name of the Access Control List. +// - body - Request payload. +// - options - AccessControlListsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the AccessControlListsClient.BeginUpdateAdministrativeState +// method. +func (client *AccessControlListsClient) BeginUpdateAdministrativeState(ctx context.Context, resourceGroupName string, accessControlListName string, body UpdateAdministrativeState, options *AccessControlListsClientBeginUpdateAdministrativeStateOptions) (*runtime.Poller[AccessControlListsClientUpdateAdministrativeStateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateAdministrativeState(ctx, resourceGroupName, accessControlListName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessControlListsClientUpdateAdministrativeStateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[AccessControlListsClientUpdateAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } - return result, nil +} + +// UpdateAdministrativeState - Implements the operation to the underlying resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *AccessControlListsClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, accessControlListName string, body UpdateAdministrativeState, options *AccessControlListsClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { + req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, accessControlListName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. +func (client *AccessControlListsClient) updateAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, accessControlListName string, body UpdateAdministrativeState, options *AccessControlListsClientBeginUpdateAdministrativeStateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/updateAdministrativeState" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accessControlListName == "" { + return nil, errors.New("parameter accessControlListName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accessControlListName}", url.PathEscape(accessControlListName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginValidateConfiguration - Implements the operation to the underlying resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accessControlListName - Name of the Access Control List. +// - options - AccessControlListsClientBeginValidateConfigurationOptions contains the optional parameters for the AccessControlListsClient.BeginValidateConfiguration +// method. +func (client *AccessControlListsClient) BeginValidateConfiguration(ctx context.Context, resourceGroupName string, accessControlListName string, options *AccessControlListsClientBeginValidateConfigurationOptions) (*runtime.Poller[AccessControlListsClientValidateConfigurationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.validateConfiguration(ctx, resourceGroupName, accessControlListName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessControlListsClientValidateConfigurationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[AccessControlListsClientValidateConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ValidateConfiguration - Implements the operation to the underlying resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *AccessControlListsClient) validateConfiguration(ctx context.Context, resourceGroupName string, accessControlListName string, options *AccessControlListsClientBeginValidateConfigurationOptions) (*http.Response, error) { + req, err := client.validateConfigurationCreateRequest(ctx, resourceGroupName, accessControlListName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// validateConfigurationCreateRequest creates the ValidateConfiguration request. +func (client *AccessControlListsClient) validateConfigurationCreateRequest(ctx context.Context, resourceGroupName string, accessControlListName string, options *AccessControlListsClientBeginValidateConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/validateConfiguration" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accessControlListName == "" { + return nil, errors.New("parameter accessControlListName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accessControlListName}", url.PathEscape(accessControlListName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/accesscontrollists_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/accesscontrollists_client_example_test.go index b028a31d2072..47ff6c69c4cf 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/accesscontrollists_client_example_test.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/accesscontrollists_client_example_test.go @@ -18,8 +18,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/AccessControlLists_Create_MinimumSet_Gen.json -func ExampleAccessControlListsClient_Create() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Create_MaximumSet_Gen.json +func ExampleAccessControlListsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -29,58 +29,204 @@ func ExampleAccessControlListsClient_Create() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewAccessControlListsClient().Create(ctx, "resourceGroupName", "aclOne", armmanagednetworkfabric.AccessControlList{ - Location: to.Ptr("EastUs"), + poller, err := clientFactory.NewAccessControlListsClient().BeginCreate(ctx, "example-rg", "example-acl", armmanagednetworkfabric.AccessControlList{ + Location: to.Ptr("eastUs"), + Tags: map[string]*string{ + "keyID": to.Ptr("KeyValue"), + }, Properties: &armmanagednetworkfabric.AccessControlListProperties{ - AddressFamily: to.Ptr(armmanagednetworkfabric.AddressFamilyIPv4), - Conditions: []*armmanagednetworkfabric.AccessControlListConditionProperties{ + ACLsURL: to.Ptr("https://ACL-Storage-URL"), + ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), + DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ + { + IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ + { + Name: to.Ptr("example-ipGroup"), + IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + IPPrefixes: []*string{ + to.Ptr("10.20.3.1/20")}, + }}, + PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ + { + Name: to.Ptr("example-portGroup"), + Ports: []*string{ + to.Ptr("100-200")}, + }}, + VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ + { + Name: to.Ptr("example-vlanGroup"), + Vlans: []*string{ + to.Ptr("20-30")}, + }}, + }}, + MatchConfigurations: []*armmanagednetworkfabric.AccessControlListMatchConfiguration{ { - Action: to.Ptr(armmanagednetworkfabric.ConditionActionTypeAllow), - DestinationAddress: to.Ptr("1.1.1.1"), - DestinationPort: to.Ptr("21"), - SequenceNumber: to.Ptr[int32](3), - SourceAddress: to.Ptr("2.2.2.2"), - SourcePort: to.Ptr("65000"), - Protocol: to.Ptr[int32](6), + Actions: []*armmanagednetworkfabric.AccessControlListAction{ + { + Type: to.Ptr(armmanagednetworkfabric.ACLActionTypeCount), + CounterName: to.Ptr("example-counter"), + }}, + IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + MatchConditions: []*armmanagednetworkfabric.AccessControlListMatchCondition{ + { + IPCondition: &armmanagednetworkfabric.IPMatchCondition{ + Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), + IPGroupNames: []*string{ + to.Ptr("example-ipGroup")}, + IPPrefixValues: []*string{ + to.Ptr("10.20.20.20/12")}, + PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), + }, + ProtocolTypes: []*string{ + to.Ptr("TCP")}, + VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ + InnerVlans: []*string{ + to.Ptr("30")}, + VlanGroupNames: []*string{ + to.Ptr("example-vlanGroup")}, + Vlans: []*string{ + to.Ptr("20-30")}, + }, + DscpMarkings: []*string{ + to.Ptr("32")}, + EtherTypes: []*string{ + to.Ptr("0x1")}, + Fragments: []*string{ + to.Ptr("0xff00-0xffff")}, + IPLengths: []*string{ + to.Ptr("4094-9214")}, + PortCondition: &armmanagednetworkfabric.AccessControlListPortCondition{ + Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), + PortGroupNames: []*string{ + to.Ptr("example-portGroup")}, + PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), + Ports: []*string{ + to.Ptr("1-20")}, + Flags: []*string{ + to.Ptr("established")}, + }, + TTLValues: []*string{ + to.Ptr("23")}, + }}, + MatchConfigurationName: to.Ptr("example-match"), + SequenceNumber: to.Ptr[int64](123), }}, + Annotation: to.Ptr("annotation"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.AccessControlList = armmanagednetworkfabric.AccessControlList{ - // Name: to.Ptr("aaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), + // Name: to.Ptr("example-acl"), + // Type: to.Ptr("microsoft.managednetworkfabric/accessControlLists"), + // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-06-15T07:15:42.793Z"); return t}()), - // CreatedBy: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-06-15T07:15:42.793Z"); return t}()), - // LastModifiedBy: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), + // LastModifiedBy: to.Ptr("UserId"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUs"), + // Location: to.Ptr("eastUs"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("KeyValue"), + // }, // Properties: &armmanagednetworkfabric.AccessControlListProperties{ - // AddressFamily: to.Ptr(armmanagednetworkfabric.AddressFamilyIPv4), - // Conditions: []*armmanagednetworkfabric.AccessControlListConditionProperties{ + // ACLsURL: to.Ptr("https://ACL-Storage-URL"), + // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), + // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ // { - // Action: to.Ptr(armmanagednetworkfabric.ConditionActionTypeAllow), - // DestinationAddress: to.Ptr("1.1.1.1"), - // DestinationPort: to.Ptr("21"), - // SequenceNumber: to.Ptr[int32](3), - // SourceAddress: to.Ptr("2.2.2.2"), - // SourcePort: to.Ptr("65000"), - // Protocol: to.Ptr[int32](6), - // }}, - // }, - // } + // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ + // { + // Name: to.Ptr("example-ipGroup"), + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // IPPrefixes: []*string{ + // to.Ptr("10.20.3.1/20")}, + // }}, + // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ + // { + // Name: to.Ptr("example-portGroup"), + // Ports: []*string{ + // to.Ptr("100-200")}, + // }}, + // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ + // { + // Name: to.Ptr("example-vlanGroup"), + // Vlans: []*string{ + // to.Ptr("20-30")}, + // }}, + // }}, + // MatchConfigurations: []*armmanagednetworkfabric.AccessControlListMatchConfiguration{ + // { + // Actions: []*armmanagednetworkfabric.AccessControlListAction{ + // { + // Type: to.Ptr(armmanagednetworkfabric.ACLActionTypeCount), + // CounterName: to.Ptr("example-counter"), + // }}, + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // MatchConditions: []*armmanagednetworkfabric.AccessControlListMatchCondition{ + // { + // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ + // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), + // IPGroupNames: []*string{ + // to.Ptr("example-ipGroup")}, + // IPPrefixValues: []*string{ + // to.Ptr("10.20.20.20/12")}, + // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), + // }, + // ProtocolTypes: []*string{ + // to.Ptr("TCP")}, + // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ + // InnerVlans: []*string{ + // to.Ptr("30")}, + // VlanGroupNames: []*string{ + // to.Ptr("example-vlanGroup")}, + // Vlans: []*string{ + // to.Ptr("20-30")}, + // }, + // DscpMarkings: []*string{ + // to.Ptr("32")}, + // EtherTypes: []*string{ + // to.Ptr("0x1")}, + // Fragments: []*string{ + // to.Ptr("0xff00-0xffff")}, + // IPLengths: []*string{ + // to.Ptr("4094-9214")}, + // PortCondition: &armmanagednetworkfabric.AccessControlListPortCondition{ + // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), + // PortGroupNames: []*string{ + // to.Ptr("example-portGroup")}, + // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), + // Ports: []*string{ + // to.Ptr("1-20")}, + // Flags: []*string{ + // to.Ptr("established")}, + // }, + // TTLValues: []*string{ + // to.Ptr("23")}, + // }}, + // MatchConfigurationName: to.Ptr("example-match"), + // SequenceNumber: to.Ptr[int64](123), + // }}, + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-17T08:56:23.203Z"); return t}()), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/AccessControlLists_Get_MinimumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Get_MaximumSet_Gen.json func ExampleAccessControlListsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -91,7 +237,7 @@ func ExampleAccessControlListsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewAccessControlListsClient().Get(ctx, "resourceGroupName", "aclOne", nil) + res, err := clientFactory.NewAccessControlListsClient().Get(ctx, "example-rg", "example-acl", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -99,36 +245,109 @@ func ExampleAccessControlListsClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.AccessControlList = armmanagednetworkfabric.AccessControlList{ - // Name: to.Ptr("aaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), + // Name: to.Ptr("example-acl"), + // Type: to.Ptr("microsoft.managednetworkfabric/accessControlLists"), + // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-06-15T07:15:42.793Z"); return t}()), - // CreatedBy: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-06-15T07:15:42.793Z"); return t}()), - // LastModifiedBy: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), + // LastModifiedBy: to.Ptr("UserId"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("aaa"), + // Location: to.Ptr("eastUs"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("KeyValue"), + // }, // Properties: &armmanagednetworkfabric.AccessControlListProperties{ - // AddressFamily: to.Ptr(armmanagednetworkfabric.AddressFamilyIPv4), - // Conditions: []*armmanagednetworkfabric.AccessControlListConditionProperties{ + // ACLsURL: to.Ptr("https://ACL-Storage-URL"), + // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), + // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ // { - // Action: to.Ptr(armmanagednetworkfabric.ConditionActionTypeAllow), - // DestinationAddress: to.Ptr("1.1.1.1"), - // DestinationPort: to.Ptr("21"), - // SequenceNumber: to.Ptr[int32](3), - // SourceAddress: to.Ptr("2.2.2.2"), - // SourcePort: to.Ptr("65000"), - // Protocol: to.Ptr[int32](6), - // }}, - // }, - // } + // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ + // { + // Name: to.Ptr("example-ipGroup"), + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // IPPrefixes: []*string{ + // to.Ptr("10.20.3.1/20")}, + // }}, + // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ + // { + // Name: to.Ptr("example-portGroup"), + // Ports: []*string{ + // to.Ptr("100-200")}, + // }}, + // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ + // { + // Name: to.Ptr("example-vlanGroup"), + // Vlans: []*string{ + // to.Ptr("20-30")}, + // }}, + // }}, + // MatchConfigurations: []*armmanagednetworkfabric.AccessControlListMatchConfiguration{ + // { + // Actions: []*armmanagednetworkfabric.AccessControlListAction{ + // { + // Type: to.Ptr(armmanagednetworkfabric.ACLActionTypeCount), + // CounterName: to.Ptr("example-counter"), + // }}, + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // MatchConditions: []*armmanagednetworkfabric.AccessControlListMatchCondition{ + // { + // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ + // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), + // IPGroupNames: []*string{ + // to.Ptr("example-ipGroup")}, + // IPPrefixValues: []*string{ + // to.Ptr("10.20.20.20/12")}, + // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), + // }, + // ProtocolTypes: []*string{ + // to.Ptr("TCP")}, + // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ + // InnerVlans: []*string{ + // to.Ptr("30")}, + // VlanGroupNames: []*string{ + // to.Ptr("example-vlanGroup")}, + // Vlans: []*string{ + // to.Ptr("20-30")}, + // }, + // DscpMarkings: []*string{ + // to.Ptr("32")}, + // EtherTypes: []*string{ + // to.Ptr("0x1")}, + // Fragments: []*string{ + // to.Ptr("0xff00-0xffff")}, + // IPLengths: []*string{ + // to.Ptr("4094-9214")}, + // PortCondition: &armmanagednetworkfabric.AccessControlListPortCondition{ + // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), + // PortGroupNames: []*string{ + // to.Ptr("example-portGroup")}, + // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), + // Ports: []*string{ + // to.Ptr("1-20")}, + // Flags: []*string{ + // to.Ptr("established")}, + // }, + // TTLValues: []*string{ + // to.Ptr("23")}, + // }}, + // MatchConfigurationName: to.Ptr("example-match"), + // SequenceNumber: to.Ptr[int64](123), + // }}, + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-17T08:56:23.203Z"); return t}()), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/AccessControlLists_Update_MinimumSet_Gen.json -func ExampleAccessControlListsClient_Update() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Update_MaximumSet_Gen.json +func ExampleAccessControlListsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -138,58 +357,204 @@ func ExampleAccessControlListsClient_Update() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewAccessControlListsClient().Update(ctx, "resourceGroupName", "aclOne", armmanagednetworkfabric.AccessControlListPatch{ + poller, err := clientFactory.NewAccessControlListsClient().BeginUpdate(ctx, "example-rg", "example-acl", armmanagednetworkfabric.AccessControlListPatch{ + Tags: map[string]*string{ + "keyID": to.Ptr("KeyValue"), + }, Properties: &armmanagednetworkfabric.AccessControlListPatchProperties{ - AddressFamily: to.Ptr(armmanagednetworkfabric.AddressFamilyIPv4), - Conditions: []*armmanagednetworkfabric.AccessControlListConditionProperties{ + ACLsURL: to.Ptr("https://microsoft.com/a"), + ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), + DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ + { + IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ + { + Name: to.Ptr("example-ipGroup"), + IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + IPPrefixes: []*string{ + to.Ptr("10.20.3.1/20")}, + }}, + PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ + { + Name: to.Ptr("example-portGroup"), + Ports: []*string{ + to.Ptr("100-200")}, + }}, + VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ + { + Name: to.Ptr("example-vlanGroup"), + Vlans: []*string{ + to.Ptr("20-30")}, + }}, + }}, + MatchConfigurations: []*armmanagednetworkfabric.AccessControlListMatchConfiguration{ { - Action: to.Ptr(armmanagednetworkfabric.ConditionActionTypeAllow), - DestinationAddress: to.Ptr("1.1.1.2"), - DestinationPort: to.Ptr("21"), - SequenceNumber: to.Ptr[int32](4), - SourceAddress: to.Ptr("2.2.2.3"), - SourcePort: to.Ptr("65000"), - Protocol: to.Ptr[int32](6), + Actions: []*armmanagednetworkfabric.AccessControlListAction{ + { + Type: to.Ptr(armmanagednetworkfabric.ACLActionTypeCount), + CounterName: to.Ptr("example-counter"), + }}, + IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + MatchConditions: []*armmanagednetworkfabric.AccessControlListMatchCondition{ + { + IPCondition: &armmanagednetworkfabric.IPMatchCondition{ + Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), + IPGroupNames: []*string{ + to.Ptr("example-ipGroup")}, + IPPrefixValues: []*string{ + to.Ptr("10.20.20.20/12")}, + PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), + }, + ProtocolTypes: []*string{ + to.Ptr("TCP")}, + VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ + InnerVlans: []*string{ + to.Ptr("30")}, + VlanGroupNames: []*string{ + to.Ptr("example-vlanGroup")}, + Vlans: []*string{ + to.Ptr("20-30")}, + }, + DscpMarkings: []*string{ + to.Ptr("32")}, + EtherTypes: []*string{ + to.Ptr("0x1")}, + Fragments: []*string{ + to.Ptr("0xff00-0xffff")}, + IPLengths: []*string{ + to.Ptr("4094-9214")}, + PortCondition: &armmanagednetworkfabric.AccessControlListPortCondition{ + Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), + PortGroupNames: []*string{ + to.Ptr("example-portGroup")}, + PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), + Ports: []*string{ + to.Ptr("1-20")}, + Flags: []*string{ + to.Ptr("established")}, + }, + TTLValues: []*string{ + to.Ptr("23")}, + }}, + MatchConfigurationName: to.Ptr("example-match"), + SequenceNumber: to.Ptr[int64](123), }}, + Annotation: to.Ptr("annotation"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.AccessControlList = armmanagednetworkfabric.AccessControlList{ - // Name: to.Ptr("aaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), + // Name: to.Ptr("example-acl"), + // Type: to.Ptr("microsoft.managednetworkfabric/accessControlLists"), + // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-06-15T07:15:42.793Z"); return t}()), - // CreatedBy: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-06-15T07:15:42.793Z"); return t}()), - // LastModifiedBy: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), + // LastModifiedBy: to.Ptr("UserId"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUs"), + // Location: to.Ptr("eastUs"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("KeyValue"), + // }, // Properties: &armmanagednetworkfabric.AccessControlListProperties{ - // AddressFamily: to.Ptr(armmanagednetworkfabric.AddressFamilyIPv4), - // Conditions: []*armmanagednetworkfabric.AccessControlListConditionProperties{ + // ACLsURL: to.Ptr("https://ACL-Storage-URL"), + // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), + // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ // { - // Action: to.Ptr(armmanagednetworkfabric.ConditionActionTypeAllow), - // DestinationAddress: to.Ptr("1.1.1.2"), - // DestinationPort: to.Ptr("21"), - // SequenceNumber: to.Ptr[int32](4), - // SourceAddress: to.Ptr("2.2.2.3"), - // SourcePort: to.Ptr("65000"), - // Protocol: to.Ptr[int32](6), - // }}, - // }, - // } + // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ + // { + // Name: to.Ptr("example-ipGroup"), + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // IPPrefixes: []*string{ + // to.Ptr("10.20.3.1/20")}, + // }}, + // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ + // { + // Name: to.Ptr("example-portGroup"), + // Ports: []*string{ + // to.Ptr("100-200")}, + // }}, + // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ + // { + // Name: to.Ptr("example-vlanGroup"), + // Vlans: []*string{ + // to.Ptr("20-30")}, + // }}, + // }}, + // MatchConfigurations: []*armmanagednetworkfabric.AccessControlListMatchConfiguration{ + // { + // Actions: []*armmanagednetworkfabric.AccessControlListAction{ + // { + // Type: to.Ptr(armmanagednetworkfabric.ACLActionTypeCount), + // CounterName: to.Ptr("example-counter"), + // }}, + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // MatchConditions: []*armmanagednetworkfabric.AccessControlListMatchCondition{ + // { + // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ + // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), + // IPGroupNames: []*string{ + // to.Ptr("example-ipGroup")}, + // IPPrefixValues: []*string{ + // to.Ptr("10.20.20.20/12")}, + // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), + // }, + // ProtocolTypes: []*string{ + // to.Ptr("TCP")}, + // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ + // InnerVlans: []*string{ + // to.Ptr("30")}, + // VlanGroupNames: []*string{ + // to.Ptr("example-vlanGroup")}, + // Vlans: []*string{ + // to.Ptr("20-30")}, + // }, + // DscpMarkings: []*string{ + // to.Ptr("32")}, + // EtherTypes: []*string{ + // to.Ptr("0x1")}, + // Fragments: []*string{ + // to.Ptr("0xff00-0xffff")}, + // IPLengths: []*string{ + // to.Ptr("4094-9214")}, + // PortCondition: &armmanagednetworkfabric.AccessControlListPortCondition{ + // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), + // PortGroupNames: []*string{ + // to.Ptr("example-portGroup")}, + // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), + // Ports: []*string{ + // to.Ptr("1-20")}, + // Flags: []*string{ + // to.Ptr("established")}, + // }, + // TTLValues: []*string{ + // to.Ptr("23")}, + // }}, + // MatchConfigurationName: to.Ptr("example-match"), + // SequenceNumber: to.Ptr[int64](123), + // }}, + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-17T08:56:23.203Z"); return t}()), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/AccessControlLists_Delete_MinimumSet_Gen.json -func ExampleAccessControlListsClient_Delete() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Delete_MaximumSet_Gen.json +func ExampleAccessControlListsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -199,13 +564,17 @@ func ExampleAccessControlListsClient_Delete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewAccessControlListsClient().Delete(ctx, "subscriptionId", "aclOne", nil) + poller, err := clientFactory.NewAccessControlListsClient().BeginDelete(ctx, "example-rg", "example-acl", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/AccessControlLists_ListByResourceGroup_MinimumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_ListByResourceGroup_MaximumSet_Gen.json func ExampleAccessControlListsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -216,7 +585,7 @@ func ExampleAccessControlListsClient_NewListByResourceGroupPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewAccessControlListsClient().NewListByResourceGroupPager("resourceGroupName", nil) + pager := clientFactory.NewAccessControlListsClient().NewListByResourceGroupPager("example-rg", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -228,11 +597,112 @@ func ExampleAccessControlListsClient_NewListByResourceGroupPager() { } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.AccessControlListsListResult = armmanagednetworkfabric.AccessControlListsListResult{ - // } + // Value: []*armmanagednetworkfabric.AccessControlList{ + // { + // Name: to.Ptr("example-acl"), + // Type: to.Ptr("microsoft.managednetworkfabric/accessControlLists"), + // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), + // LastModifiedBy: to.Ptr("UserId"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastUs"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("KeyValue"), + // }, + // Properties: &armmanagednetworkfabric.AccessControlListProperties{ + // ACLsURL: to.Ptr("https://ACL-Storage-URL"), + // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), + // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ + // { + // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ + // { + // Name: to.Ptr("example-ipGroup"), + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // IPPrefixes: []*string{ + // to.Ptr("10.20.3.1/20")}, + // }}, + // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ + // { + // Name: to.Ptr("example-portGroup"), + // Ports: []*string{ + // to.Ptr("100-200")}, + // }}, + // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ + // { + // Name: to.Ptr("example-vlanGroup"), + // Vlans: []*string{ + // to.Ptr("20-30")}, + // }}, + // }}, + // MatchConfigurations: []*armmanagednetworkfabric.AccessControlListMatchConfiguration{ + // { + // Actions: []*armmanagednetworkfabric.AccessControlListAction{ + // { + // Type: to.Ptr(armmanagednetworkfabric.ACLActionTypeCount), + // CounterName: to.Ptr("example-counter"), + // }}, + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // MatchConditions: []*armmanagednetworkfabric.AccessControlListMatchCondition{ + // { + // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ + // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), + // IPGroupNames: []*string{ + // to.Ptr("example-ipGroup")}, + // IPPrefixValues: []*string{ + // to.Ptr("10.20.20.20/12")}, + // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), + // }, + // ProtocolTypes: []*string{ + // to.Ptr("TCP")}, + // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ + // InnerVlans: []*string{ + // to.Ptr("30")}, + // VlanGroupNames: []*string{ + // to.Ptr("example-vlanGroup")}, + // Vlans: []*string{ + // to.Ptr("20-30")}, + // }, + // DscpMarkings: []*string{ + // to.Ptr("32")}, + // EtherTypes: []*string{ + // to.Ptr("0x1")}, + // Fragments: []*string{ + // to.Ptr("0xff00-0xffff")}, + // IPLengths: []*string{ + // to.Ptr("4094-9214")}, + // PortCondition: &armmanagednetworkfabric.AccessControlListPortCondition{ + // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), + // PortGroupNames: []*string{ + // to.Ptr("example-portGroup")}, + // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), + // Ports: []*string{ + // to.Ptr("1-20")}, + // Flags: []*string{ + // to.Ptr("established")}, + // }, + // TTLValues: []*string{ + // to.Ptr("23")}, + // }}, + // MatchConfigurationName: to.Ptr("example-match"), + // SequenceNumber: to.Ptr[int64](123), + // }}, + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-17T08:56:23.203Z"); return t}()), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/AccessControlLists_ListBySubscription_MinimumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_ListBySubscription_MaximumSet_Gen.json func ExampleAccessControlListsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -255,6 +725,232 @@ func ExampleAccessControlListsClient_NewListBySubscriptionPager() { } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.AccessControlListsListResult = armmanagednetworkfabric.AccessControlListsListResult{ - // } + // Value: []*armmanagednetworkfabric.AccessControlList{ + // { + // Name: to.Ptr("example-acl"), + // Type: to.Ptr("microsoft.managednetworkfabric/accessControlLists"), + // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), + // LastModifiedBy: to.Ptr("UserId"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastUs"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("KeyValue"), + // }, + // Properties: &armmanagednetworkfabric.AccessControlListProperties{ + // ACLsURL: to.Ptr("https://ACL-Storage-URL"), + // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), + // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ + // { + // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ + // { + // Name: to.Ptr("example-ipGroup"), + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // IPPrefixes: []*string{ + // to.Ptr("10.20.3.1/20")}, + // }}, + // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ + // { + // Name: to.Ptr("example-portGroup"), + // Ports: []*string{ + // to.Ptr("100-200")}, + // }}, + // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ + // { + // Name: to.Ptr("example-vlanGroup"), + // Vlans: []*string{ + // to.Ptr("20-30")}, + // }}, + // }}, + // MatchConfigurations: []*armmanagednetworkfabric.AccessControlListMatchConfiguration{ + // { + // Actions: []*armmanagednetworkfabric.AccessControlListAction{ + // { + // Type: to.Ptr(armmanagednetworkfabric.ACLActionTypeCount), + // CounterName: to.Ptr("example-counter"), + // }}, + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // MatchConditions: []*armmanagednetworkfabric.AccessControlListMatchCondition{ + // { + // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ + // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), + // IPGroupNames: []*string{ + // to.Ptr("example-ipGroup")}, + // IPPrefixValues: []*string{ + // to.Ptr("10.20.20.20/12")}, + // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), + // }, + // ProtocolTypes: []*string{ + // to.Ptr("TCP")}, + // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ + // InnerVlans: []*string{ + // to.Ptr("30")}, + // VlanGroupNames: []*string{ + // to.Ptr("example-vlanGroup")}, + // Vlans: []*string{ + // to.Ptr("20-30")}, + // }, + // DscpMarkings: []*string{ + // to.Ptr("32")}, + // EtherTypes: []*string{ + // to.Ptr("0x1")}, + // Fragments: []*string{ + // to.Ptr("0xff00-0xffff")}, + // IPLengths: []*string{ + // to.Ptr("4094-9214")}, + // PortCondition: &armmanagednetworkfabric.AccessControlListPortCondition{ + // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), + // PortGroupNames: []*string{ + // to.Ptr("example-portGroup")}, + // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), + // Ports: []*string{ + // to.Ptr("1-20")}, + // Flags: []*string{ + // to.Ptr("established")}, + // }, + // TTLValues: []*string{ + // to.Ptr("23")}, + // }}, + // MatchConfigurationName: to.Ptr("example-match"), + // SequenceNumber: to.Ptr[int64](123), + // }}, + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-17T08:56:23.203Z"); return t}()), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_UpdateAdministrativeState_MaximumSet_Gen.json +func ExampleAccessControlListsClient_BeginUpdateAdministrativeState() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAccessControlListsClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-acl", armmanagednetworkfabric.UpdateAdministrativeState{ + ResourceIDs: []*string{ + to.Ptr("")}, + State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Resync_MaximumSet_Gen.json +func ExampleAccessControlListsClient_BeginResync() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) } + poller, err := clientFactory.NewAccessControlListsClient().BeginResync(ctx, "example-rg", "example-acl", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_ValidateConfiguration_MaximumSet_Gen.json +func ExampleAccessControlListsClient_BeginValidateConfiguration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAccessControlListsClient().BeginValidateConfiguration(ctx, "example-rg", "example-acl", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ValidateConfigurationResponse = armmanagednetworkfabric.ValidateConfigurationResponse{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // URL: to.Ptr("https://ActionDetails"), + // } } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/autorest.md b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/autorest.md index 5336b43ac540..4e3b76e283a8 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/autorest.md +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.1.0 -tag: package-2023-02-01-preview +module-version: 1.0.0 +tag: package-2023-06-15 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/client_factory.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/client_factory.go index f34384fdfb1a..cb20602013ef 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/client_factory.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/client_factory.go @@ -24,7 +24,7 @@ type ClientFactory struct { // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { @@ -43,6 +43,16 @@ func (c *ClientFactory) NewAccessControlListsClient() *AccessControlListsClient return subClient } +func (c *ClientFactory) NewInternetGatewaysClient() *InternetGatewaysClient { + subClient, _ := NewInternetGatewaysClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewInternetGatewayRulesClient() *InternetGatewayRulesClient { + subClient, _ := NewInternetGatewayRulesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewIPCommunitiesClient() *IPCommunitiesClient { subClient, _ := NewIPCommunitiesClient(c.subscriptionID, c.credential, c.options) return subClient @@ -78,6 +88,11 @@ func (c *ClientFactory) NewExternalNetworksClient() *ExternalNetworksClient { return subClient } +func (c *ClientFactory) NewNeighborGroupsClient() *NeighborGroupsClient { + subClient, _ := NewNeighborGroupsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewNetworkDeviceSKUsClient() *NetworkDeviceSKUsClient { subClient, _ := NewNetworkDeviceSKUsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -113,8 +128,8 @@ func (c *ClientFactory) NewNetworkToNetworkInterconnectsClient() *NetworkToNetwo return subClient } -func (c *ClientFactory) NewNetworkRackSKUsClient() *NetworkRackSKUsClient { - subClient, _ := NewNetworkRackSKUsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewNetworkPacketBrokersClient() *NetworkPacketBrokersClient { + subClient, _ := NewNetworkPacketBrokersClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -123,6 +138,16 @@ func (c *ClientFactory) NewNetworkRacksClient() *NetworkRacksClient { return subClient } +func (c *ClientFactory) NewNetworkTapRulesClient() *NetworkTapRulesClient { + subClient, _ := NewNetworkTapRulesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewNetworkTapsClient() *NetworkTapsClient { + subClient, _ := NewNetworkTapsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewOperationsClient() *OperationsClient { subClient, _ := NewOperationsClient(c.credential, c.options) return subClient diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/constants.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/constants.go index 7ee79fde84af..75d20256a336 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/constants.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/constants.go @@ -11,9 +11,43 @@ package armmanagednetworkfabric const ( moduleName = "armmanagednetworkfabric" - moduleVersion = "v0.1.0" + moduleVersion = "v1.0.0" ) +// ACLActionType - Type of actions that can be performed. +type ACLActionType string + +const ( + ACLActionTypeCount ACLActionType = "Count" + ACLActionTypeDrop ACLActionType = "Drop" + ACLActionTypeLog ACLActionType = "Log" +) + +// PossibleACLActionTypeValues returns the possible values for the ACLActionType const type. +func PossibleACLActionTypeValues() []ACLActionType { + return []ACLActionType{ + ACLActionTypeCount, + ACLActionTypeDrop, + ACLActionTypeLog, + } +} + +// Action - Specify action. +type Action string + +const ( + ActionAllow Action = "Allow" + ActionDeny Action = "Deny" +) + +// PossibleActionValues returns the possible values for the Action const type. +func PossibleActionValues() []Action { + return []Action{ + ActionAllow, + ActionDeny, + } +} + // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. type ActionType string @@ -28,35 +62,39 @@ func PossibleActionTypeValues() []ActionType { } } -// AddressFamily - IP address family. Example: ipv4 | ipv6. -type AddressFamily string +// AddressFamilyType - AddressFamilyType. This parameter decides whether the given ipv4 or ipv6 route policy. +type AddressFamilyType string const ( - AddressFamilyIPv4 AddressFamily = "ipv4" - AddressFamilyIPv6 AddressFamily = "ipv6" + AddressFamilyTypeIPv4 AddressFamilyType = "IPv4" + AddressFamilyTypeIPv6 AddressFamilyType = "IPv6" ) -// PossibleAddressFamilyValues returns the possible values for the AddressFamily const type. -func PossibleAddressFamilyValues() []AddressFamily { - return []AddressFamily{ - AddressFamilyIPv4, - AddressFamilyIPv6, +// PossibleAddressFamilyTypeValues returns the possible values for the AddressFamilyType const type. +func PossibleAddressFamilyTypeValues() []AddressFamilyType { + return []AddressFamilyType{ + AddressFamilyTypeIPv4, + AddressFamilyTypeIPv6, } } -// AdministrativeState - Administrative state. +// AdministrativeState - State defined to represent administrative actions or post actions on a particular resource. type AdministrativeState string const ( - AdministrativeStateDisable AdministrativeState = "Disable" - AdministrativeStateEnable AdministrativeState = "Enable" + AdministrativeStateDisabled AdministrativeState = "Disabled" + AdministrativeStateEnabled AdministrativeState = "Enabled" + AdministrativeStateMAT AdministrativeState = "MAT" + AdministrativeStateRMA AdministrativeState = "RMA" ) // PossibleAdministrativeStateValues returns the possible values for the AdministrativeState const type. func PossibleAdministrativeStateValues() []AdministrativeState { return []AdministrativeState{ - AdministrativeStateDisable, - AdministrativeStateEnable, + AdministrativeStateDisabled, + AdministrativeStateEnabled, + AdministrativeStateMAT, + AdministrativeStateRMA, } } @@ -76,6 +114,26 @@ func PossibleAllowASOverrideValues() []AllowASOverride { } } +// BfdAdministrativeState - Administrative state of the BfdConfiguration. Example: Enabled | Disabled. +type BfdAdministrativeState string + +const ( + BfdAdministrativeStateDisabled BfdAdministrativeState = "Disabled" + BfdAdministrativeStateEnabled BfdAdministrativeState = "Enabled" + BfdAdministrativeStateMAT BfdAdministrativeState = "MAT" + BfdAdministrativeStateRMA BfdAdministrativeState = "RMA" +) + +// PossibleBfdAdministrativeStateValues returns the possible values for the BfdAdministrativeState const type. +func PossibleBfdAdministrativeStateValues() []BfdAdministrativeState { + return []BfdAdministrativeState{ + BfdAdministrativeStateDisabled, + BfdAdministrativeStateEnabled, + BfdAdministrativeStateMAT, + BfdAdministrativeStateRMA, + } +} + // BooleanEnumProperty - Boolean Enum. Example- True/False type BooleanEnumProperty string @@ -115,6 +173,7 @@ const ( ConditionEqualTo Condition = "EqualTo" ConditionGreaterThanOrEqualTo Condition = "GreaterThanOrEqualTo" ConditionLesserThanOrEqualTo Condition = "LesserThanOrEqualTo" + ConditionRange Condition = "Range" ) // PossibleConditionValues returns the possible values for the Condition const type. @@ -123,22 +182,55 @@ func PossibleConditionValues() []Condition { ConditionEqualTo, ConditionGreaterThanOrEqualTo, ConditionLesserThanOrEqualTo, + ConditionRange, } } -// ConditionActionType - action. Example: allow | deny. -type ConditionActionType string +// ConfigurationState - Configuration state for the resource. +type ConfigurationState string const ( - ConditionActionTypeAllow ConditionActionType = "allow" - ConditionActionTypeDeny ConditionActionType = "deny" + ConfigurationStateAccepted ConfigurationState = "Accepted" + ConfigurationStateDeferredControl ConfigurationState = "DeferredControl" + ConfigurationStateDeprovisioned ConfigurationState = "Deprovisioned" + ConfigurationStateDeprovisioning ConfigurationState = "Deprovisioning" + ConfigurationStateErrorDeprovisioning ConfigurationState = "ErrorDeprovisioning" + ConfigurationStateErrorProvisioning ConfigurationState = "ErrorProvisioning" + ConfigurationStateFailed ConfigurationState = "Failed" + ConfigurationStateProvisioned ConfigurationState = "Provisioned" + ConfigurationStateRejected ConfigurationState = "Rejected" + ConfigurationStateSucceeded ConfigurationState = "Succeeded" ) -// PossibleConditionActionTypeValues returns the possible values for the ConditionActionType const type. -func PossibleConditionActionTypeValues() []ConditionActionType { - return []ConditionActionType{ - ConditionActionTypeAllow, - ConditionActionTypeDeny, +// PossibleConfigurationStateValues returns the possible values for the ConfigurationState const type. +func PossibleConfigurationStateValues() []ConfigurationState { + return []ConfigurationState{ + ConfigurationStateAccepted, + ConfigurationStateDeferredControl, + ConfigurationStateDeprovisioned, + ConfigurationStateDeprovisioning, + ConfigurationStateErrorDeprovisioning, + ConfigurationStateErrorProvisioning, + ConfigurationStateFailed, + ConfigurationStateProvisioned, + ConfigurationStateRejected, + ConfigurationStateSucceeded, + } +} + +// ConfigurationType - Input method to configure Access Control List. +type ConfigurationType string + +const ( + ConfigurationTypeFile ConfigurationType = "File" + ConfigurationTypeInline ConfigurationType = "Inline" +) + +// PossibleConfigurationTypeValues returns the possible values for the ConfigurationType const type. +func PossibleConfigurationTypeValues() []ConfigurationType { + return []ConfigurationType{ + ConfigurationTypeFile, + ConfigurationTypeInline, } } @@ -162,19 +254,151 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -// EnabledDisabledState - EnabledDisabledState state for the resource. -type EnabledDisabledState string +// DestinationType - Type of destination. Input can be IsolationDomain or Direct. +type DestinationType string + +const ( + DestinationTypeDirect DestinationType = "Direct" + DestinationTypeIsolationDomain DestinationType = "IsolationDomain" +) + +// PossibleDestinationTypeValues returns the possible values for the DestinationType const type. +func PossibleDestinationTypeValues() []DestinationType { + return []DestinationType{ + DestinationTypeDirect, + DestinationTypeIsolationDomain, + } +} + +// DeviceAdministrativeState - Administrative state. +type DeviceAdministrativeState string + +const ( + DeviceAdministrativeStateGracefulQuarantine DeviceAdministrativeState = "GracefulQuarantine" + DeviceAdministrativeStateQuarantine DeviceAdministrativeState = "Quarantine" + DeviceAdministrativeStateRMA DeviceAdministrativeState = "RMA" + DeviceAdministrativeStateResync DeviceAdministrativeState = "Resync" +) + +// PossibleDeviceAdministrativeStateValues returns the possible values for the DeviceAdministrativeState const type. +func PossibleDeviceAdministrativeStateValues() []DeviceAdministrativeState { + return []DeviceAdministrativeState{ + DeviceAdministrativeStateGracefulQuarantine, + DeviceAdministrativeStateQuarantine, + DeviceAdministrativeStateRMA, + DeviceAdministrativeStateResync, + } +} + +// EnableDisableState - Administrative state. +type EnableDisableState string + +const ( + EnableDisableStateDisable EnableDisableState = "Disable" + EnableDisableStateEnable EnableDisableState = "Enable" +) + +// PossibleEnableDisableStateValues returns the possible values for the EnableDisableState const type. +func PossibleEnableDisableStateValues() []EnableDisableState { + return []EnableDisableState{ + EnableDisableStateDisable, + EnableDisableStateEnable, + } +} + +// Encapsulation - Type of encapsulation. +type Encapsulation string + +const ( + EncapsulationGRE Encapsulation = "GRE" + EncapsulationNone Encapsulation = "None" +) + +// PossibleEncapsulationValues returns the possible values for the Encapsulation const type. +func PossibleEncapsulationValues() []Encapsulation { + return []Encapsulation{ + EncapsulationGRE, + EncapsulationNone, + } +} + +// EncapsulationType - Encapsulation Type. +type EncapsulationType string + +const ( + EncapsulationTypeGTPv1 EncapsulationType = "GTPv1" + EncapsulationTypeNone EncapsulationType = "None" +) + +// PossibleEncapsulationTypeValues returns the possible values for the EncapsulationType const type. +func PossibleEncapsulationTypeValues() []EncapsulationType { + return []EncapsulationType{ + EncapsulationTypeGTPv1, + EncapsulationTypeNone, + } +} + +// Extension - Extension. Example: NoExtension | NPB. +type Extension string + +const ( + ExtensionNPB Extension = "NPB" + ExtensionNoExtension Extension = "NoExtension" +) + +// PossibleExtensionValues returns the possible values for the Extension const type. +func PossibleExtensionValues() []Extension { + return []Extension{ + ExtensionNPB, + ExtensionNoExtension, + } +} + +// FabricSKUType - Type of Network Fabric SKU. +type FabricSKUType string + +const ( + FabricSKUTypeMultiRack FabricSKUType = "MultiRack" + FabricSKUTypeSingleRack FabricSKUType = "SingleRack" +) + +// PossibleFabricSKUTypeValues returns the possible values for the FabricSKUType const type. +func PossibleFabricSKUTypeValues() []FabricSKUType { + return []FabricSKUType{ + FabricSKUTypeMultiRack, + FabricSKUTypeSingleRack, + } +} + +// GatewayType - Gateway Type of the resource. +type GatewayType string + +const ( + GatewayTypeInfrastructure GatewayType = "Infrastructure" + GatewayTypeWorkload GatewayType = "Workload" +) + +// PossibleGatewayTypeValues returns the possible values for the GatewayType const type. +func PossibleGatewayTypeValues() []GatewayType { + return []GatewayType{ + GatewayTypeInfrastructure, + GatewayTypeWorkload, + } +} + +// IPAddressType - IP Address type. +type IPAddressType string const ( - EnabledDisabledStateDisabled EnabledDisabledState = "Disabled" - EnabledDisabledStateEnabled EnabledDisabledState = "Enabled" + IPAddressTypeIPv4 IPAddressType = "IPv4" + IPAddressTypeIPv6 IPAddressType = "IPv6" ) -// PossibleEnabledDisabledStateValues returns the possible values for the EnabledDisabledState const type. -func PossibleEnabledDisabledStateValues() []EnabledDisabledState { - return []EnabledDisabledState{ - EnabledDisabledStateDisabled, - EnabledDisabledStateEnabled, +// PossibleIPAddressTypeValues returns the possible values for the IPAddressType const type. +func PossibleIPAddressTypeValues() []IPAddressType { + return []IPAddressType{ + IPAddressTypeIPv4, + IPAddressTypeIPv6, } } @@ -194,57 +418,91 @@ func PossibleInterfaceTypeValues() []InterfaceType { } } -// IsCurrentVersion - If the current version is in use. -type IsCurrentVersion string +// IsManagementType - Configuration to use NNI for Infrastructure Management. Example: True/False. +type IsManagementType string const ( - IsCurrentVersionFalse IsCurrentVersion = "false" - IsCurrentVersionTrue IsCurrentVersion = "true" + IsManagementTypeFalse IsManagementType = "False" + IsManagementTypeTrue IsManagementType = "True" ) -// PossibleIsCurrentVersionValues returns the possible values for the IsCurrentVersion const type. -func PossibleIsCurrentVersionValues() []IsCurrentVersion { - return []IsCurrentVersion{ - IsCurrentVersionFalse, - IsCurrentVersionTrue, +// PossibleIsManagementTypeValues returns the possible values for the IsManagementType const type. +func PossibleIsManagementTypeValues() []IsManagementType { + return []IsManagementType{ + IsManagementTypeFalse, + IsManagementTypeTrue, } } -// IsTestVersion - If the current version is a test version. -type IsTestVersion string +// IsMonitoringEnabled - To check whether monitoring of internal network is enabled or not. +type IsMonitoringEnabled string const ( - IsTestVersionFalse IsTestVersion = "false" - IsTestVersionTrue IsTestVersion = "true" + IsMonitoringEnabledFalse IsMonitoringEnabled = "False" + IsMonitoringEnabledTrue IsMonitoringEnabled = "True" ) -// PossibleIsTestVersionValues returns the possible values for the IsTestVersion const type. -func PossibleIsTestVersionValues() []IsTestVersion { - return []IsTestVersion{ - IsTestVersionFalse, - IsTestVersionTrue, +// PossibleIsMonitoringEnabledValues returns the possible values for the IsMonitoringEnabled const type. +func PossibleIsMonitoringEnabledValues() []IsMonitoringEnabled { + return []IsMonitoringEnabled{ + IsMonitoringEnabledFalse, + IsMonitoringEnabledTrue, } } -// NetworkDeviceRackRoleType - Role for the network device. -type NetworkDeviceRackRoleType string +// IsWorkloadManagementNetworkEnabled - 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. +type IsWorkloadManagementNetworkEnabled string const ( - NetworkDeviceRackRoleTypeCE NetworkDeviceRackRoleType = "CE" - NetworkDeviceRackRoleTypeManagement NetworkDeviceRackRoleType = "Management" - NetworkDeviceRackRoleTypeNPB NetworkDeviceRackRoleType = "NPB" - NetworkDeviceRackRoleTypeTS NetworkDeviceRackRoleType = "TS" - NetworkDeviceRackRoleTypeToR NetworkDeviceRackRoleType = "ToR" + IsWorkloadManagementNetworkEnabledFalse IsWorkloadManagementNetworkEnabled = "False" + IsWorkloadManagementNetworkEnabledTrue IsWorkloadManagementNetworkEnabled = "True" ) -// PossibleNetworkDeviceRackRoleTypeValues returns the possible values for the NetworkDeviceRackRoleType const type. -func PossibleNetworkDeviceRackRoleTypeValues() []NetworkDeviceRackRoleType { - return []NetworkDeviceRackRoleType{ - NetworkDeviceRackRoleTypeCE, - NetworkDeviceRackRoleTypeManagement, - NetworkDeviceRackRoleTypeNPB, - NetworkDeviceRackRoleTypeTS, - NetworkDeviceRackRoleTypeToR, +// PossibleIsWorkloadManagementNetworkEnabledValues returns the possible values for the IsWorkloadManagementNetworkEnabled const type. +func PossibleIsWorkloadManagementNetworkEnabledValues() []IsWorkloadManagementNetworkEnabled { + return []IsWorkloadManagementNetworkEnabled{ + IsWorkloadManagementNetworkEnabledFalse, + IsWorkloadManagementNetworkEnabledTrue, + } +} + +// Layer4Protocol - Layer4 protocol type that needs to be matched. +type Layer4Protocol string + +const ( + Layer4ProtocolTCP Layer4Protocol = "TCP" + Layer4ProtocolUDP Layer4Protocol = "UDP" +) + +// PossibleLayer4ProtocolValues returns the possible values for the Layer4Protocol const type. +func PossibleLayer4ProtocolValues() []Layer4Protocol { + return []Layer4Protocol{ + Layer4ProtocolTCP, + Layer4ProtocolUDP, + } +} + +// NetworkDeviceRole - NetworkDeviceRole is the device role: Example: CE | ToR. +type NetworkDeviceRole string + +const ( + NetworkDeviceRoleCE NetworkDeviceRole = "CE" + NetworkDeviceRoleManagement NetworkDeviceRole = "Management" + NetworkDeviceRoleNPB NetworkDeviceRole = "NPB" + NetworkDeviceRoleTS NetworkDeviceRole = "TS" + NetworkDeviceRoleToR NetworkDeviceRole = "ToR" +) + +// PossibleNetworkDeviceRoleValues returns the possible values for the NetworkDeviceRole const type. +func PossibleNetworkDeviceRoleValues() []NetworkDeviceRole { + return []NetworkDeviceRole{ + NetworkDeviceRoleCE, + NetworkDeviceRoleManagement, + NetworkDeviceRoleNPB, + NetworkDeviceRoleTS, + NetworkDeviceRoleToR, } } @@ -270,85 +528,39 @@ func PossibleNetworkDeviceRoleNameValues() []NetworkDeviceRoleName { } } -// NetworkDeviceRoleTypes - Available roles for the network device. -type NetworkDeviceRoleTypes string - -const ( - NetworkDeviceRoleTypesCE NetworkDeviceRoleTypes = "CE" - NetworkDeviceRoleTypesManagement NetworkDeviceRoleTypes = "Management" - NetworkDeviceRoleTypesNPB NetworkDeviceRoleTypes = "NPB" - NetworkDeviceRoleTypesTS NetworkDeviceRoleTypes = "TS" - NetworkDeviceRoleTypesToR NetworkDeviceRoleTypes = "ToR" -) - -// PossibleNetworkDeviceRoleTypesValues returns the possible values for the NetworkDeviceRoleTypes const type. -func PossibleNetworkDeviceRoleTypesValues() []NetworkDeviceRoleTypes { - return []NetworkDeviceRoleTypes{ - NetworkDeviceRoleTypesCE, - NetworkDeviceRoleTypesManagement, - NetworkDeviceRoleTypesNPB, - NetworkDeviceRoleTypesTS, - NetworkDeviceRoleTypesToR, - } -} - -// NetworkFabricControllerOperationalState - Operational state for the resource. -type NetworkFabricControllerOperationalState string +// NetworkRackType - Network Rack SKU name. +type NetworkRackType string const ( - NetworkFabricControllerOperationalStateConfiguring NetworkFabricControllerOperationalState = "Configuring" - NetworkFabricControllerOperationalStateFailed NetworkFabricControllerOperationalState = "Failed" - NetworkFabricControllerOperationalStateSucceeded NetworkFabricControllerOperationalState = "Succeeded" + NetworkRackTypeAggregate NetworkRackType = "Aggregate" + NetworkRackTypeCombined NetworkRackType = "Combined" + NetworkRackTypeCompute NetworkRackType = "Compute" ) -// PossibleNetworkFabricControllerOperationalStateValues returns the possible values for the NetworkFabricControllerOperationalState const type. -func PossibleNetworkFabricControllerOperationalStateValues() []NetworkFabricControllerOperationalState { - return []NetworkFabricControllerOperationalState{ - NetworkFabricControllerOperationalStateConfiguring, - NetworkFabricControllerOperationalStateFailed, - NetworkFabricControllerOperationalStateSucceeded, +// PossibleNetworkRackTypeValues returns the possible values for the NetworkRackType const type. +func PossibleNetworkRackTypeValues() []NetworkRackType { + return []NetworkRackType{ + NetworkRackTypeAggregate, + NetworkRackTypeCombined, + NetworkRackTypeCompute, } } -// NetworkFabricOperationalState - Operational state for the resource. -type NetworkFabricOperationalState string +// NfcSKU - Network Fabric Controller SKU. +type NfcSKU string const ( - NetworkFabricOperationalStateDeferredControl NetworkFabricOperationalState = "DeferredControl" - NetworkFabricOperationalStateDeprovisioned NetworkFabricOperationalState = "Deprovisioned" - NetworkFabricOperationalStateDeprovisioning NetworkFabricOperationalState = "Deprovisioning" - NetworkFabricOperationalStateErrorDeprovisioning NetworkFabricOperationalState = "ErrorDeprovisioning" - NetworkFabricOperationalStateErrorProvisioning NetworkFabricOperationalState = "ErrorProvisioning" - NetworkFabricOperationalStateProvisioned NetworkFabricOperationalState = "Provisioned" - NetworkFabricOperationalStateProvisioning NetworkFabricOperationalState = "Provisioning" + NfcSKUBasic NfcSKU = "Basic" + NfcSKUHighPerformance NfcSKU = "HighPerformance" + NfcSKUStandard NfcSKU = "Standard" ) -// PossibleNetworkFabricOperationalStateValues returns the possible values for the NetworkFabricOperationalState const type. -func PossibleNetworkFabricOperationalStateValues() []NetworkFabricOperationalState { - return []NetworkFabricOperationalState{ - NetworkFabricOperationalStateDeferredControl, - NetworkFabricOperationalStateDeprovisioned, - NetworkFabricOperationalStateDeprovisioning, - NetworkFabricOperationalStateErrorDeprovisioning, - NetworkFabricOperationalStateErrorProvisioning, - NetworkFabricOperationalStateProvisioned, - NetworkFabricOperationalStateProvisioning, - } -} - -// NetworkRackRoleName - The role of the Network Rack: Aggregate or Compute. -type NetworkRackRoleName string - -const ( - NetworkRackRoleNameAggregateRack NetworkRackRoleName = "AggregateRack" - NetworkRackRoleNameComputeRack NetworkRackRoleName = "ComputeRack" -) - -// PossibleNetworkRackRoleNameValues returns the possible values for the NetworkRackRoleName const type. -func PossibleNetworkRackRoleNameValues() []NetworkRackRoleName { - return []NetworkRackRoleName{ - NetworkRackRoleNameAggregateRack, - NetworkRackRoleNameComputeRack, +// PossibleNfcSKUValues returns the possible values for the NfcSKU const type. +func PossibleNfcSKUValues() []NfcSKU { + return []NfcSKU{ + NfcSKUBasic, + NfcSKUHighPerformance, + NfcSKUStandard, } } @@ -368,24 +580,6 @@ func PossibleNniTypeValues() []NniType { } } -// OperationalStatus - Primary or Secondary power end. -type OperationalStatus string - -const ( - OperationalStatusBootPrompt OperationalStatus = "BootPrompt" - OperationalStatusBooted OperationalStatus = "Booted" - OperationalStatusZtp OperationalStatus = "Ztp" -) - -// PossibleOperationalStatusValues returns the possible values for the OperationalStatus const type. -func PossibleOperationalStatusValues() []OperationalStatus { - return []OperationalStatus{ - OperationalStatusBootPrompt, - OperationalStatusBooted, - OperationalStatusZtp, - } -} - // Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default // value is "user,system" type Origin string @@ -421,35 +615,71 @@ func PossiblePeeringOptionValues() []PeeringOption { } } -// PowerCycleState - On or Off power cycle state. -type PowerCycleState string +// PollingIntervalInSeconds - Polling interval in seconds. +type PollingIntervalInSeconds int32 + +const ( + PollingIntervalInSecondsNinety PollingIntervalInSeconds = 90 + PollingIntervalInSecondsOneHundredTwenty PollingIntervalInSeconds = 120 + PollingIntervalInSecondsSixty PollingIntervalInSeconds = 60 + PollingIntervalInSecondsThirty PollingIntervalInSeconds = 30 +) + +// PossiblePollingIntervalInSecondsValues returns the possible values for the PollingIntervalInSeconds const type. +func PossiblePollingIntervalInSecondsValues() []PollingIntervalInSeconds { + return []PollingIntervalInSeconds{ + PollingIntervalInSecondsNinety, + PollingIntervalInSecondsOneHundredTwenty, + PollingIntervalInSecondsSixty, + PollingIntervalInSecondsThirty, + } +} + +// PollingType - Polling type. +type PollingType string const ( - PowerCycleStateOff PowerCycleState = "Off" - PowerCycleStateOn PowerCycleState = "On" + PollingTypePull PollingType = "Pull" + PollingTypePush PollingType = "Push" ) -// PossiblePowerCycleStateValues returns the possible values for the PowerCycleState const type. -func PossiblePowerCycleStateValues() []PowerCycleState { - return []PowerCycleState{ - PowerCycleStateOff, - PowerCycleStateOn, +// PossiblePollingTypeValues returns the possible values for the PollingType const type. +func PossiblePollingTypeValues() []PollingType { + return []PollingType{ + PollingTypePull, + PollingTypePush, } } -// PowerEnd - Primary or Secondary power end. -type PowerEnd string +// PortType - Port type that needs to be matched. +type PortType string const ( - PowerEndPrimary PowerEnd = "Primary" - PowerEndSecondary PowerEnd = "Secondary" + PortTypeDestinationPort PortType = "DestinationPort" + PortTypeSourcePort PortType = "SourcePort" ) -// PossiblePowerEndValues returns the possible values for the PowerEnd const type. -func PossiblePowerEndValues() []PowerEnd { - return []PowerEnd{ - PowerEndPrimary, - PowerEndSecondary, +// PossiblePortTypeValues returns the possible values for the PortType const type. +func PossiblePortTypeValues() []PortType { + return []PortType{ + PortTypeDestinationPort, + PortTypeSourcePort, + } +} + +// PrefixType - IP Prefix Type. +type PrefixType string + +const ( + PrefixTypeLongestPrefix PrefixType = "LongestPrefix" + PrefixTypePrefix PrefixType = "Prefix" +) + +// PossiblePrefixTypeValues returns the possible values for the PrefixType const type. +func PossiblePrefixTypeValues() []PrefixType { + return []PrefixType{ + PrefixTypeLongestPrefix, + PrefixTypePrefix, } } @@ -457,6 +687,7 @@ func PossiblePowerEndValues() []PowerEnd { type ProvisioningState string const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" ProvisioningStateCanceled ProvisioningState = "Canceled" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" @@ -467,6 +698,7 @@ const ( // PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{ + ProvisioningStateAccepted, ProvisioningStateCanceled, ProvisioningStateDeleting, ProvisioningStateFailed, @@ -475,6 +707,26 @@ func PossibleProvisioningStateValues() []ProvisioningState { } } +// RebootType - Type of reboot to be performed. Example: GracefulRebootWithZTP +type RebootType string + +const ( + RebootTypeGracefulRebootWithZTP RebootType = "GracefulRebootWithZTP" + RebootTypeGracefulRebootWithoutZTP RebootType = "GracefulRebootWithoutZTP" + RebootTypeUngracefulRebootWithZTP RebootType = "UngracefulRebootWithZTP" + RebootTypeUngracefulRebootWithoutZTP RebootType = "UngracefulRebootWithoutZTP" +) + +// PossibleRebootTypeValues returns the possible values for the RebootType const type. +func PossibleRebootTypeValues() []RebootType { + return []RebootType{ + RebootTypeGracefulRebootWithZTP, + RebootTypeGracefulRebootWithoutZTP, + RebootTypeUngracefulRebootWithZTP, + RebootTypeUngracefulRebootWithoutZTP, + } +} + // RedistributeConnectedSubnets - Advertise Connected Subnets. Ex: "True" | "False". type RedistributeConnectedSubnets string @@ -507,19 +759,97 @@ func PossibleRedistributeStaticRoutesValues() []RedistributeStaticRoutes { } } -// State - On or Off toggle state. -type State string +// RoutePolicyActionType - Action type. Example: Permit | Deny | Continue. +type RoutePolicyActionType string + +const ( + RoutePolicyActionTypeContinue RoutePolicyActionType = "Continue" + RoutePolicyActionTypeDeny RoutePolicyActionType = "Deny" + RoutePolicyActionTypePermit RoutePolicyActionType = "Permit" +) + +// PossibleRoutePolicyActionTypeValues returns the possible values for the RoutePolicyActionType const type. +func PossibleRoutePolicyActionTypeValues() []RoutePolicyActionType { + return []RoutePolicyActionType{ + RoutePolicyActionTypeContinue, + RoutePolicyActionTypeDeny, + RoutePolicyActionTypePermit, + } +} + +// RoutePolicyConditionType - Type of the condition used. +type RoutePolicyConditionType string + +const ( + RoutePolicyConditionTypeAnd RoutePolicyConditionType = "And" + RoutePolicyConditionTypeOr RoutePolicyConditionType = "Or" +) + +// PossibleRoutePolicyConditionTypeValues returns the possible values for the RoutePolicyConditionType const type. +func PossibleRoutePolicyConditionTypeValues() []RoutePolicyConditionType { + return []RoutePolicyConditionType{ + RoutePolicyConditionTypeAnd, + RoutePolicyConditionTypeOr, + } +} + +// SourceDestinationType - IP Address type. +type SourceDestinationType string + +const ( + SourceDestinationTypeDestinationIP SourceDestinationType = "DestinationIP" + SourceDestinationTypeSourceIP SourceDestinationType = "SourceIP" +) + +// PossibleSourceDestinationTypeValues returns the possible values for the SourceDestinationType const type. +func PossibleSourceDestinationTypeValues() []SourceDestinationType { + return []SourceDestinationType{ + SourceDestinationTypeDestinationIP, + SourceDestinationTypeSourceIP, + } +} + +// TapRuleActionType - Type of actions that can be performed. +type TapRuleActionType string + +const ( + TapRuleActionTypeCount TapRuleActionType = "Count" + TapRuleActionTypeDrop TapRuleActionType = "Drop" + TapRuleActionTypeGoto TapRuleActionType = "Goto" + TapRuleActionTypeLog TapRuleActionType = "Log" + TapRuleActionTypeMirror TapRuleActionType = "Mirror" + TapRuleActionTypeRedirect TapRuleActionType = "Redirect" + TapRuleActionTypeReplicate TapRuleActionType = "Replicate" +) + +// PossibleTapRuleActionTypeValues returns the possible values for the TapRuleActionType const type. +func PossibleTapRuleActionTypeValues() []TapRuleActionType { + return []TapRuleActionType{ + TapRuleActionTypeCount, + TapRuleActionTypeDrop, + TapRuleActionTypeGoto, + TapRuleActionTypeLog, + TapRuleActionTypeMirror, + TapRuleActionTypeRedirect, + TapRuleActionTypeReplicate, + } +} + +// ValidateAction - Validate action that to be performed +type ValidateAction string const ( - StateOff State = "Off" - StateOn State = "On" + ValidateActionCabling ValidateAction = "Cabling" + ValidateActionConfiguration ValidateAction = "Configuration" + ValidateActionConnectivity ValidateAction = "Connectivity" ) -// PossibleStateValues returns the possible values for the State const type. -func PossibleStateValues() []State { - return []State{ - StateOff, - StateOn, +// PossibleValidateActionValues returns the possible values for the ValidateAction const type. +func PossibleValidateActionValues() []ValidateAction { + return []ValidateAction{ + ValidateActionCabling, + ValidateActionConfiguration, + ValidateActionConnectivity, } } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/externalnetworks_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/externalnetworks_client.go index e49117ee7499..33192b8be923 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/externalnetworks_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/externalnetworks_client.go @@ -29,7 +29,7 @@ type ExternalNetworksClient struct { } // NewExternalNetworksClient creates a new instance of ExternalNetworksClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewExternalNetworksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExternalNetworksClient, error) { @@ -44,159 +44,13 @@ func NewExternalNetworksClient(subscriptionID string, credential azcore.TokenCre return client, nil } -// BeginClearArpEntries - clearArpEntries for externalNetwork. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain. -// - externalNetworkName - Name of the ExternalNetwork. -// - body - Request payload. -// - options - ExternalNetworksClientBeginClearArpEntriesOptions contains the optional parameters for the ExternalNetworksClient.BeginClearArpEntries -// method. -func (client *ExternalNetworksClient) BeginClearArpEntries(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body EnableDisableOnResources, options *ExternalNetworksClientBeginClearArpEntriesOptions) (*runtime.Poller[ExternalNetworksClientClearArpEntriesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.clearArpEntries(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, body, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExternalNetworksClientClearArpEntriesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ExternalNetworksClientClearArpEntriesResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// ClearArpEntries - clearArpEntries for externalNetwork. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -func (client *ExternalNetworksClient) clearArpEntries(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body EnableDisableOnResources, options *ExternalNetworksClientBeginClearArpEntriesOptions) (*http.Response, error) { - req, err := client.clearArpEntriesCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, body, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// clearArpEntriesCreateRequest creates the ClearArpEntries request. -func (client *ExternalNetworksClient) clearArpEntriesCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body EnableDisableOnResources, options *ExternalNetworksClientBeginClearArpEntriesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/clearArpEntries" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if l3IsolationDomainName == "" { - return nil, errors.New("parameter l3IsolationDomainName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{l3IsolationDomainName}", url.PathEscape(l3IsolationDomainName)) - if externalNetworkName == "" { - return nil, errors.New("parameter externalNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{externalNetworkName}", url.PathEscape(externalNetworkName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) -} - -// BeginClearIPv6Neighbors - clearIpv6Neighbors for externalNetwork. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain. -// - externalNetworkName - Name of the ExternalNetwork. -// - body - Request payload. -// - options - ExternalNetworksClientBeginClearIPv6NeighborsOptions contains the optional parameters for the ExternalNetworksClient.BeginClearIPv6Neighbors -// method. -func (client *ExternalNetworksClient) BeginClearIPv6Neighbors(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body EnableDisableOnResources, options *ExternalNetworksClientBeginClearIPv6NeighborsOptions) (*runtime.Poller[ExternalNetworksClientClearIPv6NeighborsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.clearIPv6Neighbors(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, body, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExternalNetworksClientClearIPv6NeighborsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ExternalNetworksClientClearIPv6NeighborsResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// ClearIPv6Neighbors - clearIpv6Neighbors for externalNetwork. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -func (client *ExternalNetworksClient) clearIPv6Neighbors(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body EnableDisableOnResources, options *ExternalNetworksClientBeginClearIPv6NeighborsOptions) (*http.Response, error) { - req, err := client.clearIPv6NeighborsCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, body, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// clearIPv6NeighborsCreateRequest creates the ClearIPv6Neighbors request. -func (client *ExternalNetworksClient) clearIPv6NeighborsCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body EnableDisableOnResources, options *ExternalNetworksClientBeginClearIPv6NeighborsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/clearIpv6Neighbors" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if l3IsolationDomainName == "" { - return nil, errors.New("parameter l3IsolationDomainName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{l3IsolationDomainName}", url.PathEscape(l3IsolationDomainName)) - if externalNetworkName == "" { - return nil, errors.New("parameter externalNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{externalNetworkName}", url.PathEscape(externalNetworkName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) -} - // BeginCreate - Creates ExternalNetwork PUT method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain -// - externalNetworkName - Name of the ExternalNetwork +// - l3IsolationDomainName - Name of the L3 Isolation Domain. +// - externalNetworkName - Name of the External Network. // - body - Request payload. // - options - ExternalNetworksClientBeginCreateOptions contains the optional parameters for the ExternalNetworksClient.BeginCreate // method. @@ -217,7 +71,7 @@ func (client *ExternalNetworksClient) BeginCreate(ctx context.Context, resourceG // Create - Creates ExternalNetwork PUT method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *ExternalNetworksClient) create(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body ExternalNetwork, options *ExternalNetworksClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, body, options) if err != nil { @@ -236,9 +90,6 @@ func (client *ExternalNetworksClient) create(ctx context.Context, resourceGroupN // createCreateRequest creates the Create request. func (client *ExternalNetworksClient) createCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body ExternalNetwork, options *ExternalNetworksClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -257,7 +108,7 @@ func (client *ExternalNetworksClient) createCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -266,10 +117,10 @@ func (client *ExternalNetworksClient) createCreateRequest(ctx context.Context, r // BeginDelete - Implements ExternalNetworks DELETE method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain -// - externalNetworkName - Name of the ExternalNetwork +// - l3IsolationDomainName - Name of the L3 Isolation Domain. +// - externalNetworkName - Name of the External Network. // - options - ExternalNetworksClientBeginDeleteOptions contains the optional parameters for the ExternalNetworksClient.BeginDelete // method. func (client *ExternalNetworksClient) BeginDelete(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, options *ExternalNetworksClientBeginDeleteOptions) (*runtime.Poller[ExternalNetworksClientDeleteResponse], error) { @@ -289,7 +140,7 @@ func (client *ExternalNetworksClient) BeginDelete(ctx context.Context, resourceG // Delete - Implements ExternalNetworks DELETE method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *ExternalNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, options *ExternalNetworksClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, options) if err != nil { @@ -299,7 +150,7 @@ func (client *ExternalNetworksClient) deleteOperation(ctx context.Context, resou if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -308,9 +159,6 @@ func (client *ExternalNetworksClient) deleteOperation(ctx context.Context, resou // deleteCreateRequest creates the Delete request. func (client *ExternalNetworksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, options *ExternalNetworksClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -329,7 +177,7 @@ func (client *ExternalNetworksClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -338,10 +186,10 @@ func (client *ExternalNetworksClient) deleteCreateRequest(ctx context.Context, r // Get - Implements ExternalNetworks GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain -// - externalNetworkName - Name of the ExternalNetwork +// - l3IsolationDomainName - Name of the L3 Isolation Domain. +// - externalNetworkName - Name of the External Network. // - options - ExternalNetworksClientGetOptions contains the optional parameters for the ExternalNetworksClient.Get method. func (client *ExternalNetworksClient) Get(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, options *ExternalNetworksClientGetOptions) (ExternalNetworksClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, options) @@ -361,9 +209,6 @@ func (client *ExternalNetworksClient) Get(ctx context.Context, resourceGroupName // getCreateRequest creates the Get request. func (client *ExternalNetworksClient) getCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, options *ExternalNetworksClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -382,7 +227,7 @@ func (client *ExternalNetworksClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -397,47 +242,44 @@ func (client *ExternalNetworksClient) getHandleResponse(resp *http.Response) (Ex return result, nil } -// NewListPager - Implements External Networks list by resource group GET method. +// NewListByL3IsolationDomainPager - Implements External Networks list by resource group GET method. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain -// - options - ExternalNetworksClientListOptions contains the optional parameters for the ExternalNetworksClient.NewListPager +// - l3IsolationDomainName - Name of the L3 Isolation Domain. +// - options - ExternalNetworksClientListByL3IsolationDomainOptions contains the optional parameters for the ExternalNetworksClient.NewListByL3IsolationDomainPager // method. -func (client *ExternalNetworksClient) NewListPager(resourceGroupName string, l3IsolationDomainName string, options *ExternalNetworksClientListOptions) *runtime.Pager[ExternalNetworksClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ExternalNetworksClientListResponse]{ - More: func(page ExternalNetworksClientListResponse) bool { +func (client *ExternalNetworksClient) NewListByL3IsolationDomainPager(resourceGroupName string, l3IsolationDomainName string, options *ExternalNetworksClientListByL3IsolationDomainOptions) *runtime.Pager[ExternalNetworksClientListByL3IsolationDomainResponse] { + return runtime.NewPager(runtime.PagingHandler[ExternalNetworksClientListByL3IsolationDomainResponse]{ + More: func(page ExternalNetworksClientListByL3IsolationDomainResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *ExternalNetworksClientListResponse) (ExternalNetworksClientListResponse, error) { + Fetcher: func(ctx context.Context, page *ExternalNetworksClientListByL3IsolationDomainResponse) (ExternalNetworksClientListByL3IsolationDomainResponse, error) { var req *policy.Request var err error if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, options) + req, err = client.listByL3IsolationDomainCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, options) } else { req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return ExternalNetworksClientListResponse{}, err + return ExternalNetworksClientListByL3IsolationDomainResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return ExternalNetworksClientListResponse{}, err + return ExternalNetworksClientListByL3IsolationDomainResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExternalNetworksClientListResponse{}, runtime.NewResponseError(resp) + return ExternalNetworksClientListByL3IsolationDomainResponse{}, runtime.NewResponseError(resp) } - return client.listHandleResponse(resp) + return client.listByL3IsolationDomainHandleResponse(resp) }, }) } -// listCreateRequest creates the List request. -func (client *ExternalNetworksClient) listCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *ExternalNetworksClientListOptions) (*policy.Request, error) { +// listByL3IsolationDomainCreateRequest creates the ListByL3IsolationDomain request. +func (client *ExternalNetworksClient) listByL3IsolationDomainCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *ExternalNetworksClientListByL3IsolationDomainOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -452,17 +294,17 @@ func (client *ExternalNetworksClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// listHandleResponse handles the List response. -func (client *ExternalNetworksClient) listHandleResponse(resp *http.Response) (ExternalNetworksClientListResponse, error) { - result := ExternalNetworksClientListResponse{} +// listByL3IsolationDomainHandleResponse handles the ListByL3IsolationDomain response. +func (client *ExternalNetworksClient) listByL3IsolationDomainHandleResponse(resp *http.Response) (ExternalNetworksClientListByL3IsolationDomainResponse, error) { + result := ExternalNetworksClientListByL3IsolationDomainResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ExternalNetworksList); err != nil { - return ExternalNetworksClientListResponse{}, err + return ExternalNetworksClientListByL3IsolationDomainResponse{}, err } return result, nil } @@ -470,10 +312,10 @@ func (client *ExternalNetworksClient) listHandleResponse(resp *http.Response) (E // BeginUpdate - API to update certain properties of the ExternalNetworks resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain -// - externalNetworkName - Name of the ExternalNetwork +// - l3IsolationDomainName - Name of the L3 Isolation Domain. +// - externalNetworkName - Name of the External Network. // - body - ExternalNetwork properties to update. Only annotations are supported. // - options - ExternalNetworksClientBeginUpdateOptions contains the optional parameters for the ExternalNetworksClient.BeginUpdate // method. @@ -484,7 +326,7 @@ func (client *ExternalNetworksClient) BeginUpdate(ctx context.Context, resourceG return nil, err } return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExternalNetworksClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + FinalStateVia: runtime.FinalStateViaLocation, }) } else { return runtime.NewPollerFromResumeToken[ExternalNetworksClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) @@ -494,7 +336,7 @@ func (client *ExternalNetworksClient) BeginUpdate(ctx context.Context, resourceG // Update - API to update certain properties of the ExternalNetworks resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *ExternalNetworksClient) update(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body ExternalNetworkPatch, options *ExternalNetworksClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, body, options) if err != nil { @@ -513,9 +355,6 @@ func (client *ExternalNetworksClient) update(ctx context.Context, resourceGroupN // updateCreateRequest creates the Update request. func (client *ExternalNetworksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body ExternalNetworkPatch, options *ExternalNetworksClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -534,7 +373,7 @@ func (client *ExternalNetworksClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -543,10 +382,10 @@ func (client *ExternalNetworksClient) updateCreateRequest(ctx context.Context, r // BeginUpdateAdministrativeState - Executes update operation to enable or disable administrative State for externalNetwork. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain. -// - externalNetworkName - Name of the ExternalNetwork. +// - l3IsolationDomainName - Name of the L3 Isolation Domain. +// - externalNetworkName - Name of the External Network. // - body - Request payload. // - options - ExternalNetworksClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the ExternalNetworksClient.BeginUpdateAdministrativeState // method. @@ -567,7 +406,7 @@ func (client *ExternalNetworksClient) BeginUpdateAdministrativeState(ctx context // UpdateAdministrativeState - Executes update operation to enable or disable administrative State for externalNetwork. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *ExternalNetworksClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body UpdateAdministrativeState, options *ExternalNetworksClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, body, options) if err != nil { @@ -577,7 +416,7 @@ func (client *ExternalNetworksClient) updateAdministrativeState(ctx context.Cont if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -586,9 +425,6 @@ func (client *ExternalNetworksClient) updateAdministrativeState(ctx context.Cont // updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. func (client *ExternalNetworksClient) updateAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body UpdateAdministrativeState, options *ExternalNetworksClientBeginUpdateAdministrativeStateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateAdministrativeState" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -607,42 +443,42 @@ func (client *ExternalNetworksClient) updateAdministrativeStateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) } -// BeginUpdateBfdForBgpAdministrativeState - Update BfdForBgp for externalNetwork. +// BeginUpdateStaticRouteBfdAdministrativeState - Update Static Route BFD for external Network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain. -// - externalNetworkName - Name of the ExternalNetwork. +// - l3IsolationDomainName - Name of the L3 Isolation Domain. +// - externalNetworkName - Name of the External Network. // - body - Request payload. -// - options - ExternalNetworksClientBeginUpdateBfdForBgpAdministrativeStateOptions contains the optional parameters for the -// ExternalNetworksClient.BeginUpdateBfdForBgpAdministrativeState method. -func (client *ExternalNetworksClient) BeginUpdateBfdForBgpAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body UpdateAdministrativeState, options *ExternalNetworksClientBeginUpdateBfdForBgpAdministrativeStateOptions) (*runtime.Poller[ExternalNetworksClientUpdateBfdForBgpAdministrativeStateResponse], error) { +// - options - ExternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions contains the optional parameters for +// the ExternalNetworksClient.BeginUpdateStaticRouteBfdAdministrativeState method. +func (client *ExternalNetworksClient) BeginUpdateStaticRouteBfdAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body UpdateAdministrativeState, options *ExternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions) (*runtime.Poller[ExternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.updateBfdForBgpAdministrativeState(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, body, options) + resp, err := client.updateStaticRouteBfdAdministrativeState(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, body, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExternalNetworksClientUpdateBfdForBgpAdministrativeStateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[ExternalNetworksClientUpdateBfdForBgpAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken[ExternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } -// UpdateBfdForBgpAdministrativeState - Update BfdForBgp for externalNetwork. +// UpdateStaticRouteBfdAdministrativeState - Update Static Route BFD for external Network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview -func (client *ExternalNetworksClient) updateBfdForBgpAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body UpdateAdministrativeState, options *ExternalNetworksClientBeginUpdateBfdForBgpAdministrativeStateOptions) (*http.Response, error) { - req, err := client.updateBfdForBgpAdministrativeStateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, body, options) +// Generated from API version 2023-06-15 +func (client *ExternalNetworksClient) updateStaticRouteBfdAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body UpdateAdministrativeState, options *ExternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions) (*http.Response, error) { + req, err := client.updateStaticRouteBfdAdministrativeStateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, body, options) if err != nil { return nil, err } @@ -650,91 +486,15 @@ func (client *ExternalNetworksClient) updateBfdForBgpAdministrativeState(ctx con if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateBfdForBgpAdministrativeStateCreateRequest creates the UpdateBfdForBgpAdministrativeState request. -func (client *ExternalNetworksClient) updateBfdForBgpAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body UpdateAdministrativeState, options *ExternalNetworksClientBeginUpdateBfdForBgpAdministrativeStateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateBfdForBgpAdministrativeState" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if l3IsolationDomainName == "" { - return nil, errors.New("parameter l3IsolationDomainName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{l3IsolationDomainName}", url.PathEscape(l3IsolationDomainName)) - if externalNetworkName == "" { - return nil, errors.New("parameter externalNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{externalNetworkName}", url.PathEscape(externalNetworkName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) -} - -// BeginUpdateBgpAdministrativeState - Update BGP for externalNetwork. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain. -// - externalNetworkName - Name of the ExternalNetwork. -// - body - Request payload. -// - options - ExternalNetworksClientBeginUpdateBgpAdministrativeStateOptions contains the optional parameters for the ExternalNetworksClient.BeginUpdateBgpAdministrativeState -// method. -func (client *ExternalNetworksClient) BeginUpdateBgpAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body UpdateAdministrativeState, options *ExternalNetworksClientBeginUpdateBgpAdministrativeStateOptions) (*runtime.Poller[ExternalNetworksClientUpdateBgpAdministrativeStateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.updateBgpAdministrativeState(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, body, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExternalNetworksClientUpdateBgpAdministrativeStateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[ExternalNetworksClientUpdateBgpAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// UpdateBgpAdministrativeState - Update BGP for externalNetwork. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -func (client *ExternalNetworksClient) updateBgpAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body UpdateAdministrativeState, options *ExternalNetworksClientBeginUpdateBgpAdministrativeStateOptions) (*http.Response, error) { - req, err := client.updateBgpAdministrativeStateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, body, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil } -// updateBgpAdministrativeStateCreateRequest creates the UpdateBgpAdministrativeState request. -func (client *ExternalNetworksClient) updateBgpAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body UpdateAdministrativeState, options *ExternalNetworksClientBeginUpdateBgpAdministrativeStateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateBgpAdministrativeState" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } +// updateStaticRouteBfdAdministrativeStateCreateRequest creates the UpdateStaticRouteBfdAdministrativeState request. +func (client *ExternalNetworksClient) updateStaticRouteBfdAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body UpdateAdministrativeState, options *ExternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateStaticRouteBfdAdministrativeState" urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -753,7 +513,7 @@ func (client *ExternalNetworksClient) updateBgpAdministrativeStateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/externalnetworks_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/externalnetworks_client_example_test.go index 039084c4c525..c619b87de2a8 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/externalnetworks_client_example_test.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/externalnetworks_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_Create_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Create_MaximumSet_Gen.json func ExampleExternalNetworksClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,25 +29,49 @@ func ExampleExternalNetworksClient_BeginCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExternalNetworksClient().BeginCreate(ctx, "resourceGroupName", "example-l3domain", "example-externalnetwork", armmanagednetworkfabric.ExternalNetwork{ + poller, err := clientFactory.NewExternalNetworksClient().BeginCreate(ctx, "example-rg", "example-l3domain", "example-externalnetwork", armmanagednetworkfabric.ExternalNetwork{ Properties: &armmanagednetworkfabric.ExternalNetworkProperties{ - ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ImportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + Annotation: to.Ptr("annotation"), + ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ + ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + }, + ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ + ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + }, + ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), OptionAProperties: &armmanagednetworkfabric.ExternalNetworkPropertiesOptionAProperties{ + BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + IntervalInMilliSeconds: to.Ptr[int32](300), + Multiplier: to.Ptr[int32](15), + }, + EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + Mtu: to.Ptr[int32](1500), + PeerASN: to.Ptr[int64](65047), + VlanID: to.Ptr[int32](1001), PrimaryIPv4Prefix: to.Ptr("10.1.1.0/30"), PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), SecondaryIPv4Prefix: to.Ptr("10.1.1.4/30"), SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), - BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{}, - Mtu: to.Ptr[int32](1500), - PeerASN: to.Ptr[int32](65047), - VlanID: to.Ptr[int32](1001), }, - OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ + OptionBProperties: &armmanagednetworkfabric.L3OptionBProperties{ ExportRouteTargets: []*string{ to.Ptr("65046:10039")}, ImportRouteTargets: []*string{ to.Ptr("65046:10039")}, + RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + ExportIPv4RouteTargets: []*string{ + to.Ptr("65046:10039")}, + ExportIPv6RouteTargets: []*string{ + to.Ptr("65046:10039")}, + ImportIPv4RouteTargets: []*string{ + to.Ptr("65046:10039")}, + ImportIPv6RouteTargets: []*string{ + to.Ptr("65046:10039")}, + }, }, PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), }, @@ -64,52 +88,71 @@ func ExampleExternalNetworksClient_BeginCreate() { // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ExternalNetwork = armmanagednetworkfabric.ExternalNetwork{ // Name: to.Ptr("example-externalnetwork"), - // Type: to.Ptr("microsoft.managednetworkfabric/example-externalnetwork"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/externalNetworks/example-externalnetwork"), + // Type: to.Ptr("microsoft.managednetworkfabric/l3IsolationDomains/externalnetworks"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/externalNetworks/example-externalnetwork"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), // LastModifiedBy: to.Ptr("UserId"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Properties: &armmanagednetworkfabric.ExternalNetworkProperties{ - // Annotation: to.Ptr("lab1"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // DisabledOnResources: []*string{ - // to.Ptr("")}, - // ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnects/DefaultNNI"), - // OptionAProperties: &armmanagednetworkfabric.ExternalNetworkPropertiesOptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.1.1.0/30"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), - // SecondaryIPv4Prefix: to.Ptr("10.1.1.4/30"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // Interval: to.Ptr[int32](4), - // Multiplier: to.Ptr[int32](13), - // }, - // FabricASN: to.Ptr[int32](65048), - // Mtu: to.Ptr[int32](1500), - // PeerASN: to.Ptr[int32](65047), - // VlanID: to.Ptr[int32](1001), + // Annotation: to.Ptr("annotation"), + // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ + // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // }, + // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ + // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // }, + // ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + // OptionAProperties: &armmanagednetworkfabric.ExternalNetworkPropertiesOptionAProperties{ + // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](15), // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ - // ExportRouteTargets: []*string{ + // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // FabricASN: to.Ptr[int64](1234), + // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // Mtu: to.Ptr[int32](1500), + // PeerASN: to.Ptr[int64](65047), + // VlanID: to.Ptr[int32](1001), + // PrimaryIPv4Prefix: to.Ptr("10.1.1.0/30"), + // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), + // SecondaryIPv4Prefix: to.Ptr("10.1.1.4/30"), + // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), + // }, + // OptionBProperties: &armmanagednetworkfabric.L3OptionBProperties{ + // ExportRouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // ImportRouteTargets: []*string{ // to.Ptr("65046:10039")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } + // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + // ExportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // ExportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // ImportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // ImportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // }, + // }, + // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_Get_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Get_MaximumSet_Gen.json func ExampleExternalNetworksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -120,7 +163,7 @@ func ExampleExternalNetworksClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewExternalNetworksClient().Get(ctx, "resourceGroupName", "example-l3domain", "example-externalnetwork", nil) + res, err := clientFactory.NewExternalNetworksClient().Get(ctx, "rgL3IsolationDomains", "yhtr", "fltpszzikbalrzaqq", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -129,52 +172,71 @@ func ExampleExternalNetworksClient_Get() { // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ExternalNetwork = armmanagednetworkfabric.ExternalNetwork{ // Name: to.Ptr("example-externalnetwork"), - // Type: to.Ptr("microsoft.managednetworkfabric/example-externalnetwork"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/externalNetworks/example-externalnetwork"), + // Type: to.Ptr("microsoft.managednetworkfabric/l3IsolationDomains/externalnetworks"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/externalNetworks/example-externalnetwork"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), // LastModifiedBy: to.Ptr("UserId"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Properties: &armmanagednetworkfabric.ExternalNetworkProperties{ - // Annotation: to.Ptr("lab1"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // DisabledOnResources: []*string{ - // to.Ptr("")}, - // ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnects/DefaultNNI"), - // OptionAProperties: &armmanagednetworkfabric.ExternalNetworkPropertiesOptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.1.1.0/30"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), - // SecondaryIPv4Prefix: to.Ptr("10.1.1.4/30"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // Interval: to.Ptr[int32](4), - // Multiplier: to.Ptr[int32](13), - // }, - // FabricASN: to.Ptr[int32](65048), - // Mtu: to.Ptr[int32](1500), - // PeerASN: to.Ptr[int32](65047), - // VlanID: to.Ptr[int32](1001), + // Annotation: to.Ptr("annotation"), + // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ + // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // }, + // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ + // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // }, + // ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + // OptionAProperties: &armmanagednetworkfabric.ExternalNetworkPropertiesOptionAProperties{ + // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](15), // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ - // ExportRouteTargets: []*string{ + // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // FabricASN: to.Ptr[int64](1234), + // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // Mtu: to.Ptr[int32](1500), + // PeerASN: to.Ptr[int64](65047), + // VlanID: to.Ptr[int32](1001), + // PrimaryIPv4Prefix: to.Ptr("10.1.1.0/30"), + // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), + // SecondaryIPv4Prefix: to.Ptr("10.1.1.4/30"), + // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), + // }, + // OptionBProperties: &armmanagednetworkfabric.L3OptionBProperties{ + // ExportRouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // ImportRouteTargets: []*string{ // to.Ptr("65046:10039")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } + // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + // ExportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // ExportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // ImportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // ImportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // }, + // }, + // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_Update_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Update_MaximumSet_Gen.json func ExampleExternalNetworksClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -185,26 +247,49 @@ func ExampleExternalNetworksClient_BeginUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExternalNetworksClient().BeginUpdate(ctx, "resourceGroupName", "example-l3domain", "example-externalnetwork", armmanagednetworkfabric.ExternalNetworkPatch{ + poller, err := clientFactory.NewExternalNetworksClient().BeginUpdate(ctx, "example-rg", "example-l3domain", "example-externalnetwork", armmanagednetworkfabric.ExternalNetworkPatch{ Properties: &armmanagednetworkfabric.ExternalNetworkPatchProperties{ - Annotation: to.Ptr("Lab 1"), - ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ImportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - OptionAProperties: &armmanagednetworkfabric.Layer3OptionAProperties{ + Annotation: to.Ptr("annotation1"), + ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ + ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + }, + ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ + ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + }, + ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + OptionAProperties: &armmanagednetworkfabric.ExternalNetworkPatchPropertiesOptionAProperties{ + BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + IntervalInMilliSeconds: to.Ptr[int32](300), + Multiplier: to.Ptr[int32](15), + }, + EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + Mtu: to.Ptr[int32](1500), + PeerASN: to.Ptr[int64](65047), + VlanID: to.Ptr[int32](1001), PrimaryIPv4Prefix: to.Ptr("10.1.1.0/30"), PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), SecondaryIPv4Prefix: to.Ptr("10.1.1.4/30"), SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), - BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{}, - Mtu: to.Ptr[int32](1500), - PeerASN: to.Ptr[int32](65047), - VlanID: to.Ptr[int32](1001), }, - OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ + OptionBProperties: &armmanagednetworkfabric.L3OptionBProperties{ ExportRouteTargets: []*string{ to.Ptr("65046:10039")}, ImportRouteTargets: []*string{ to.Ptr("65046:10039")}, + RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + ExportIPv4RouteTargets: []*string{ + to.Ptr("65046:10039")}, + ExportIPv6RouteTargets: []*string{ + to.Ptr("65046:10039")}, + ImportIPv4RouteTargets: []*string{ + to.Ptr("65046:10039")}, + ImportIPv6RouteTargets: []*string{ + to.Ptr("65046:10039")}, + }, }, PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), }, @@ -221,52 +306,71 @@ func ExampleExternalNetworksClient_BeginUpdate() { // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ExternalNetwork = armmanagednetworkfabric.ExternalNetwork{ // Name: to.Ptr("example-externalnetwork"), - // Type: to.Ptr("microsoft.managednetworkfabric/example-externalnetwork"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/externalNetworks/example-externalnetwork"), + // Type: to.Ptr("microsoft.managednetworkfabric/l3IsolationDomains/externalnetworks"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/externalNetworks/example-externalnetwork"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), // LastModifiedBy: to.Ptr("UserId"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Properties: &armmanagednetworkfabric.ExternalNetworkProperties{ - // Annotation: to.Ptr("lab1"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // DisabledOnResources: []*string{ - // to.Ptr("")}, - // ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnects/DefaultNNI"), - // OptionAProperties: &armmanagednetworkfabric.ExternalNetworkPropertiesOptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.1.1.0/30"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), - // SecondaryIPv4Prefix: to.Ptr("10.1.1.4/30"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // Interval: to.Ptr[int32](4), - // Multiplier: to.Ptr[int32](13), - // }, - // FabricASN: to.Ptr[int32](65048), - // Mtu: to.Ptr[int32](1500), - // PeerASN: to.Ptr[int32](65047), - // VlanID: to.Ptr[int32](1001), + // Annotation: to.Ptr("annotation"), + // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ + // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // }, + // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ + // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // }, + // ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + // OptionAProperties: &armmanagednetworkfabric.ExternalNetworkPropertiesOptionAProperties{ + // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](15), // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ - // ExportRouteTargets: []*string{ + // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // FabricASN: to.Ptr[int64](1234), + // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // Mtu: to.Ptr[int32](1500), + // PeerASN: to.Ptr[int64](65047), + // VlanID: to.Ptr[int32](1001), + // PrimaryIPv4Prefix: to.Ptr("10.1.1.0/30"), + // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), + // SecondaryIPv4Prefix: to.Ptr("10.1.1.4/30"), + // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), + // }, + // OptionBProperties: &armmanagednetworkfabric.L3OptionBProperties{ + // ExportRouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // ImportRouteTargets: []*string{ // to.Ptr("65046:10039")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } + // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + // ExportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // ExportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // ImportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // ImportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // }, + // }, + // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_Delete_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Delete_MaximumSet_Gen.json func ExampleExternalNetworksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -277,7 +381,7 @@ func ExampleExternalNetworksClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExternalNetworksClient().BeginDelete(ctx, "resourceGroupName", "example-l3domain", "example-externalnetwork", nil) + poller, err := clientFactory.NewExternalNetworksClient().BeginDelete(ctx, "example-rg", "example-l3domain", "example-externalnetwork", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -287,8 +391,8 @@ func ExampleExternalNetworksClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_List_MaximumSet_Gen.json -func ExampleExternalNetworksClient_NewListPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_ListByL3IsolationDomain_MaximumSet_Gen.json +func ExampleExternalNetworksClient_NewListByL3IsolationDomainPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -298,7 +402,7 @@ func ExampleExternalNetworksClient_NewListPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewExternalNetworksClient().NewListPager("resourceGroupName", "example-l3domain", nil) + pager := clientFactory.NewExternalNetworksClient().NewListByL3IsolationDomainPager("example-rg", "example-l3domain", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -313,54 +417,73 @@ func ExampleExternalNetworksClient_NewListPager() { // Value: []*armmanagednetworkfabric.ExternalNetwork{ // { // Name: to.Ptr("example-externalnetwork"), - // Type: to.Ptr("microsoft.managednetworkfabric/example-externalnetwork"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/externalNetworks/example-externalnetwork"), + // Type: to.Ptr("microsoft.managednetworkfabric/l3IsolationDomains/externalnetworks"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/externalNetworks/example-externalnetwork"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), - // LastModifiedBy: to.Ptr("User"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), + // LastModifiedBy: to.Ptr("UserId"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Properties: &armmanagednetworkfabric.ExternalNetworkProperties{ - // Annotation: to.Ptr("lab1"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // DisabledOnResources: []*string{ - // to.Ptr("")}, - // ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnects/DefaultNNI"), - // OptionAProperties: &armmanagednetworkfabric.ExternalNetworkPropertiesOptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.1.1.0/30"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), - // SecondaryIPv4Prefix: to.Ptr("10.1.1.4/30"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // Interval: to.Ptr[int32](4), - // Multiplier: to.Ptr[int32](13), - // }, - // FabricASN: to.Ptr[int32](65048), - // Mtu: to.Ptr[int32](1500), - // PeerASN: to.Ptr[int32](65047), - // VlanID: to.Ptr[int32](1001), + // Annotation: to.Ptr("annotation"), + // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ + // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // }, + // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ + // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // }, + // ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + // OptionAProperties: &armmanagednetworkfabric.ExternalNetworkPropertiesOptionAProperties{ + // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](15), // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ - // ExportRouteTargets: []*string{ + // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // FabricASN: to.Ptr[int64](1234), + // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // Mtu: to.Ptr[int32](1500), + // PeerASN: to.Ptr[int64](65047), + // VlanID: to.Ptr[int32](1001), + // PrimaryIPv4Prefix: to.Ptr("10.1.1.0/30"), + // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), + // SecondaryIPv4Prefix: to.Ptr("10.1.1.4/30"), + // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), + // }, + // OptionBProperties: &armmanagednetworkfabric.L3OptionBProperties{ + // ExportRouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // ImportRouteTargets: []*string{ // to.Ptr("65046:10039")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } + // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + // ExportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // ExportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // ImportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // ImportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10039")}, + // }, + // }, + // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_updateAdministrativeState_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_UpdateAdministrativeState_MaximumSet_Gen.json func ExampleExternalNetworksClient_BeginUpdateAdministrativeState() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -371,96 +494,41 @@ func ExampleExternalNetworksClient_BeginUpdateAdministrativeState() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExternalNetworksClient().BeginUpdateAdministrativeState(ctx, "resourceGroupName", "example-l3domain", "example-externalnetwork", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")}, - State: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnable), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_updateBgpAdministrativeState_MaximumSet_Gen.json -func ExampleExternalNetworksClient_BeginUpdateBgpAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExternalNetworksClient().BeginUpdateBgpAdministrativeState(ctx, "resourceGroupName", "example-l3domain", "example-externalnetwork", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")}, - State: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnable), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_updateBfdForBgpAdministrativeState_MaximumSet_Gen.json -func ExampleExternalNetworksClient_BeginUpdateBfdForBgpAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExternalNetworksClient().BeginUpdateBfdForBgpAdministrativeState(ctx, "resourceGroupName", "example-l3domain", "example-externalnetwork", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")}, - State: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnable), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_clearIpv6Neighbors_MaximumSet_Gen.json -func ExampleExternalNetworksClient_BeginClearIPv6Neighbors() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExternalNetworksClient().BeginClearIPv6Neighbors(ctx, "resourceGroupName", "example-l3domain", "example-externalnetwork", armmanagednetworkfabric.EnableDisableOnResources{ + poller, err := clientFactory.NewExternalNetworksClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-l3domain", "example-externalnetwork", armmanagednetworkfabric.UpdateAdministrativeState{ ResourceIDs: []*string{ - to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")}, + to.Ptr("")}, + State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_clearArpEntries_MaximumSet_Gen.json -func ExampleExternalNetworksClient_BeginClearArpEntries() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_UpdateStaticRouteBfdAdministrativeState_MaximumSet_Gen.json +func ExampleExternalNetworksClient_BeginUpdateStaticRouteBfdAdministrativeState() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -470,15 +538,35 @@ func ExampleExternalNetworksClient_BeginClearArpEntries() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExternalNetworksClient().BeginClearArpEntries(ctx, "resourceGroupName", "example-l3domain", "example-externalnetwork", armmanagednetworkfabric.EnableDisableOnResources{ + poller, err := clientFactory.NewExternalNetworksClient().BeginUpdateStaticRouteBfdAdministrativeState(ctx, "example-rg", "example-l3domain", "example-externalnetwork", armmanagednetworkfabric.UpdateAdministrativeState{ ResourceIDs: []*string{ - to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")}, + to.Ptr("")}, + State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internalnetworks_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internalnetworks_client.go index 4581825efb41..3a0002fc21ac 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internalnetworks_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internalnetworks_client.go @@ -29,7 +29,7 @@ type InternalNetworksClient struct { } // NewInternalNetworksClient creates a new instance of InternalNetworksClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewInternalNetworksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InternalNetworksClient, error) { @@ -44,159 +44,13 @@ func NewInternalNetworksClient(subscriptionID string, credential azcore.TokenCre return client, nil } -// BeginClearArpEntries - clearArpEntries for internalNetwork. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain. -// - internalNetworkName - Name of the InternalNetwork. -// - body - Request payload. -// - options - InternalNetworksClientBeginClearArpEntriesOptions contains the optional parameters for the InternalNetworksClient.BeginClearArpEntries -// method. -func (client *InternalNetworksClient) BeginClearArpEntries(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body EnableDisableOnResources, options *InternalNetworksClientBeginClearArpEntriesOptions) (*runtime.Poller[InternalNetworksClientClearArpEntriesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.clearArpEntries(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientClearArpEntriesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[InternalNetworksClientClearArpEntriesResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// ClearArpEntries - clearArpEntries for internalNetwork. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -func (client *InternalNetworksClient) clearArpEntries(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body EnableDisableOnResources, options *InternalNetworksClientBeginClearArpEntriesOptions) (*http.Response, error) { - req, err := client.clearArpEntriesCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// clearArpEntriesCreateRequest creates the ClearArpEntries request. -func (client *InternalNetworksClient) clearArpEntriesCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body EnableDisableOnResources, options *InternalNetworksClientBeginClearArpEntriesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/clearArpEntries" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if l3IsolationDomainName == "" { - return nil, errors.New("parameter l3IsolationDomainName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{l3IsolationDomainName}", url.PathEscape(l3IsolationDomainName)) - if internalNetworkName == "" { - return nil, errors.New("parameter internalNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{internalNetworkName}", url.PathEscape(internalNetworkName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) -} - -// BeginClearIPv6Neighbors - clearIpv6Neighbors for internalNetwork. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain. -// - internalNetworkName - Name of the InternalNetwork. -// - body - Request payload. -// - options - InternalNetworksClientBeginClearIPv6NeighborsOptions contains the optional parameters for the InternalNetworksClient.BeginClearIPv6Neighbors -// method. -func (client *InternalNetworksClient) BeginClearIPv6Neighbors(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body EnableDisableOnResources, options *InternalNetworksClientBeginClearIPv6NeighborsOptions) (*runtime.Poller[InternalNetworksClientClearIPv6NeighborsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.clearIPv6Neighbors(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientClearIPv6NeighborsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[InternalNetworksClientClearIPv6NeighborsResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// ClearIPv6Neighbors - clearIpv6Neighbors for internalNetwork. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -func (client *InternalNetworksClient) clearIPv6Neighbors(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body EnableDisableOnResources, options *InternalNetworksClientBeginClearIPv6NeighborsOptions) (*http.Response, error) { - req, err := client.clearIPv6NeighborsCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// clearIPv6NeighborsCreateRequest creates the ClearIPv6Neighbors request. -func (client *InternalNetworksClient) clearIPv6NeighborsCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body EnableDisableOnResources, options *InternalNetworksClientBeginClearIPv6NeighborsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/clearIpv6Neighbors" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if l3IsolationDomainName == "" { - return nil, errors.New("parameter l3IsolationDomainName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{l3IsolationDomainName}", url.PathEscape(l3IsolationDomainName)) - if internalNetworkName == "" { - return nil, errors.New("parameter internalNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{internalNetworkName}", url.PathEscape(internalNetworkName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) -} - // BeginCreate - Creates InternalNetwork PUT method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain -// - internalNetworkName - Name of the InternalNetwork +// - l3IsolationDomainName - Name of the L3 Isolation Domain. +// - internalNetworkName - Name of the Internal Network. // - body - Request payload. // - options - InternalNetworksClientBeginCreateOptions contains the optional parameters for the InternalNetworksClient.BeginCreate // method. @@ -217,7 +71,7 @@ func (client *InternalNetworksClient) BeginCreate(ctx context.Context, resourceG // Create - Creates InternalNetwork PUT method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *InternalNetworksClient) create(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body InternalNetwork, options *InternalNetworksClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, options) if err != nil { @@ -236,9 +90,6 @@ func (client *InternalNetworksClient) create(ctx context.Context, resourceGroupN // createCreateRequest creates the Create request. func (client *InternalNetworksClient) createCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body InternalNetwork, options *InternalNetworksClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -257,7 +108,7 @@ func (client *InternalNetworksClient) createCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -266,10 +117,10 @@ func (client *InternalNetworksClient) createCreateRequest(ctx context.Context, r // BeginDelete - Implements InternalNetworks DELETE method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain -// - internalNetworkName - Name of the InternalNetwork +// - l3IsolationDomainName - Name of the L3 Isolation Domain. +// - internalNetworkName - Name of the Internal Network. // - options - InternalNetworksClientBeginDeleteOptions contains the optional parameters for the InternalNetworksClient.BeginDelete // method. func (client *InternalNetworksClient) BeginDelete(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, options *InternalNetworksClientBeginDeleteOptions) (*runtime.Poller[InternalNetworksClientDeleteResponse], error) { @@ -289,7 +140,7 @@ func (client *InternalNetworksClient) BeginDelete(ctx context.Context, resourceG // Delete - Implements InternalNetworks DELETE method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *InternalNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, options *InternalNetworksClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, options) if err != nil { @@ -299,7 +150,7 @@ func (client *InternalNetworksClient) deleteOperation(ctx context.Context, resou if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -308,9 +159,6 @@ func (client *InternalNetworksClient) deleteOperation(ctx context.Context, resou // deleteCreateRequest creates the Delete request. func (client *InternalNetworksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, options *InternalNetworksClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -329,7 +177,7 @@ func (client *InternalNetworksClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -338,10 +186,10 @@ func (client *InternalNetworksClient) deleteCreateRequest(ctx context.Context, r // Get - Gets a InternalNetworks. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain -// - internalNetworkName - Name of the InternalNetwork +// - l3IsolationDomainName - Name of the L3 Isolation Domain. +// - internalNetworkName - Name of the Internal Network. // - options - InternalNetworksClientGetOptions contains the optional parameters for the InternalNetworksClient.Get method. func (client *InternalNetworksClient) Get(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, options *InternalNetworksClientGetOptions) (InternalNetworksClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, options) @@ -361,9 +209,6 @@ func (client *InternalNetworksClient) Get(ctx context.Context, resourceGroupName // getCreateRequest creates the Get request. func (client *InternalNetworksClient) getCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, options *InternalNetworksClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -382,7 +227,7 @@ func (client *InternalNetworksClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -397,47 +242,44 @@ func (client *InternalNetworksClient) getHandleResponse(resp *http.Response) (In return result, nil } -// NewListPager - Displays InternalNetworks list by resource group GET method. +// NewListByL3IsolationDomainPager - Displays InternalNetworks list by resource group GET method. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain -// - options - InternalNetworksClientListOptions contains the optional parameters for the InternalNetworksClient.NewListPager +// - l3IsolationDomainName - Name of the L3 Isolation Domain. +// - options - InternalNetworksClientListByL3IsolationDomainOptions contains the optional parameters for the InternalNetworksClient.NewListByL3IsolationDomainPager // method. -func (client *InternalNetworksClient) NewListPager(resourceGroupName string, l3IsolationDomainName string, options *InternalNetworksClientListOptions) *runtime.Pager[InternalNetworksClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[InternalNetworksClientListResponse]{ - More: func(page InternalNetworksClientListResponse) bool { +func (client *InternalNetworksClient) NewListByL3IsolationDomainPager(resourceGroupName string, l3IsolationDomainName string, options *InternalNetworksClientListByL3IsolationDomainOptions) *runtime.Pager[InternalNetworksClientListByL3IsolationDomainResponse] { + return runtime.NewPager(runtime.PagingHandler[InternalNetworksClientListByL3IsolationDomainResponse]{ + More: func(page InternalNetworksClientListByL3IsolationDomainResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *InternalNetworksClientListResponse) (InternalNetworksClientListResponse, error) { + Fetcher: func(ctx context.Context, page *InternalNetworksClientListByL3IsolationDomainResponse) (InternalNetworksClientListByL3IsolationDomainResponse, error) { var req *policy.Request var err error if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, options) + req, err = client.listByL3IsolationDomainCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, options) } else { req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return InternalNetworksClientListResponse{}, err + return InternalNetworksClientListByL3IsolationDomainResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return InternalNetworksClientListResponse{}, err + return InternalNetworksClientListByL3IsolationDomainResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return InternalNetworksClientListResponse{}, runtime.NewResponseError(resp) + return InternalNetworksClientListByL3IsolationDomainResponse{}, runtime.NewResponseError(resp) } - return client.listHandleResponse(resp) + return client.listByL3IsolationDomainHandleResponse(resp) }, }) } -// listCreateRequest creates the List request. -func (client *InternalNetworksClient) listCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *InternalNetworksClientListOptions) (*policy.Request, error) { +// listByL3IsolationDomainCreateRequest creates the ListByL3IsolationDomain request. +func (client *InternalNetworksClient) listByL3IsolationDomainCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *InternalNetworksClientListByL3IsolationDomainOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -452,17 +294,17 @@ func (client *InternalNetworksClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// listHandleResponse handles the List response. -func (client *InternalNetworksClient) listHandleResponse(resp *http.Response) (InternalNetworksClientListResponse, error) { - result := InternalNetworksClientListResponse{} +// listByL3IsolationDomainHandleResponse handles the ListByL3IsolationDomain response. +func (client *InternalNetworksClient) listByL3IsolationDomainHandleResponse(resp *http.Response) (InternalNetworksClientListByL3IsolationDomainResponse, error) { + result := InternalNetworksClientListByL3IsolationDomainResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.InternalNetworksList); err != nil { - return InternalNetworksClientListResponse{}, err + return InternalNetworksClientListByL3IsolationDomainResponse{}, err } return result, nil } @@ -470,10 +312,10 @@ func (client *InternalNetworksClient) listHandleResponse(resp *http.Response) (I // BeginUpdate - Updates a InternalNetworks. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain -// - internalNetworkName - Name of the InternalNetwork +// - l3IsolationDomainName - Name of the L3 Isolation Domain. +// - internalNetworkName - Name of the Internal Network. // - body - InternalNetwork properties to update. Only annotations are supported. // - options - InternalNetworksClientBeginUpdateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdate // method. @@ -484,7 +326,7 @@ func (client *InternalNetworksClient) BeginUpdate(ctx context.Context, resourceG return nil, err } return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + FinalStateVia: runtime.FinalStateViaLocation, }) } else { return runtime.NewPollerFromResumeToken[InternalNetworksClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) @@ -494,7 +336,7 @@ func (client *InternalNetworksClient) BeginUpdate(ctx context.Context, resourceG // Update - Updates a InternalNetworks. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *InternalNetworksClient) update(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body InternalNetworkPatch, options *InternalNetworksClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, options) if err != nil { @@ -513,9 +355,6 @@ func (client *InternalNetworksClient) update(ctx context.Context, resourceGroupN // updateCreateRequest creates the Update request. func (client *InternalNetworksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body InternalNetworkPatch, options *InternalNetworksClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -534,7 +373,7 @@ func (client *InternalNetworksClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -544,10 +383,10 @@ func (client *InternalNetworksClient) updateCreateRequest(ctx context.Context, r // ids. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain. -// - internalNetworkName - Name of the InternalNetwork. +// - l3IsolationDomainName - Name of the L3 Isolation Domain. +// - internalNetworkName - Name of the Internal Network. // - body - Request payload. // - options - InternalNetworksClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdateAdministrativeState // method. @@ -568,7 +407,7 @@ func (client *InternalNetworksClient) BeginUpdateAdministrativeState(ctx context // UpdateAdministrativeState - Update Administrative state of InternalNetworks on resources referred by their resource ids. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *InternalNetworksClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, options) if err != nil { @@ -578,7 +417,7 @@ func (client *InternalNetworksClient) updateAdministrativeState(ctx context.Cont if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -587,82 +426,6 @@ func (client *InternalNetworksClient) updateAdministrativeState(ctx context.Cont // updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. func (client *InternalNetworksClient) updateAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateAdministrativeStateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateAdministrativeState" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if l3IsolationDomainName == "" { - return nil, errors.New("parameter l3IsolationDomainName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{l3IsolationDomainName}", url.PathEscape(l3IsolationDomainName)) - if internalNetworkName == "" { - return nil, errors.New("parameter internalNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{internalNetworkName}", url.PathEscape(internalNetworkName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) -} - -// BeginUpdateBfdForBgpAdministrativeState - Update BfdForBgp for internalNetwork. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain. -// - internalNetworkName - Name of the InternalNetwork. -// - body - Request payload. -// - options - InternalNetworksClientBeginUpdateBfdForBgpAdministrativeStateOptions contains the optional parameters for the -// InternalNetworksClient.BeginUpdateBfdForBgpAdministrativeState method. -func (client *InternalNetworksClient) BeginUpdateBfdForBgpAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateBfdForBgpAdministrativeStateOptions) (*runtime.Poller[InternalNetworksClientUpdateBfdForBgpAdministrativeStateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.updateBfdForBgpAdministrativeState(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientUpdateBfdForBgpAdministrativeStateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[InternalNetworksClientUpdateBfdForBgpAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// UpdateBfdForBgpAdministrativeState - Update BfdForBgp for internalNetwork. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -func (client *InternalNetworksClient) updateBfdForBgpAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateBfdForBgpAdministrativeStateOptions) (*http.Response, error) { - req, err := client.updateBfdForBgpAdministrativeStateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateBfdForBgpAdministrativeStateCreateRequest creates the UpdateBfdForBgpAdministrativeState request. -func (client *InternalNetworksClient) updateBfdForBgpAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateBfdForBgpAdministrativeStateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBfdForBgpAdministrativeState" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -681,42 +444,42 @@ func (client *InternalNetworksClient) updateBfdForBgpAdministrativeStateCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) } -// BeginUpdateBfdForStaticRouteAdministrativeState - Update BfdForStaticRoutes for internalNetwork. +// BeginUpdateBgpAdministrativeState - Update BGP state for internalNetwork. Allowed only on edge devices. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain. -// - internalNetworkName - Name of the InternalNetwork. +// - l3IsolationDomainName - Name of the L3 Isolation Domain. +// - internalNetworkName - Name of the Internal Network. // - body - Request payload. -// - options - InternalNetworksClientBeginUpdateBfdForStaticRouteAdministrativeStateOptions contains the optional parameters -// for the InternalNetworksClient.BeginUpdateBfdForStaticRouteAdministrativeState method. -func (client *InternalNetworksClient) BeginUpdateBfdForStaticRouteAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateBfdForStaticRouteAdministrativeStateOptions) (*runtime.Poller[InternalNetworksClientUpdateBfdForStaticRouteAdministrativeStateResponse], error) { +// - options - InternalNetworksClientBeginUpdateBgpAdministrativeStateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdateBgpAdministrativeState +// method. +func (client *InternalNetworksClient) BeginUpdateBgpAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateBgpAdministrativeStateOptions) (*runtime.Poller[InternalNetworksClientUpdateBgpAdministrativeStateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.updateBfdForStaticRouteAdministrativeState(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, options) + resp, err := client.updateBgpAdministrativeState(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientUpdateBfdForStaticRouteAdministrativeStateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientUpdateBgpAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[InternalNetworksClientUpdateBfdForStaticRouteAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken[InternalNetworksClientUpdateBgpAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } -// UpdateBfdForStaticRouteAdministrativeState - Update BfdForStaticRoutes for internalNetwork. +// UpdateBgpAdministrativeState - Update BGP state for internalNetwork. Allowed only on edge devices. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview -func (client *InternalNetworksClient) updateBfdForStaticRouteAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateBfdForStaticRouteAdministrativeStateOptions) (*http.Response, error) { - req, err := client.updateBfdForStaticRouteAdministrativeStateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, options) +// Generated from API version 2023-06-15 +func (client *InternalNetworksClient) updateBgpAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateBgpAdministrativeStateOptions) (*http.Response, error) { + req, err := client.updateBgpAdministrativeStateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, options) if err != nil { return nil, err } @@ -724,18 +487,15 @@ func (client *InternalNetworksClient) updateBfdForStaticRouteAdministrativeState if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil } -// updateBfdForStaticRouteAdministrativeStateCreateRequest creates the UpdateBfdForStaticRouteAdministrativeState request. -func (client *InternalNetworksClient) updateBfdForStaticRouteAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateBfdForStaticRouteAdministrativeStateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBfdForStaticRouteAdministrativeState" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } +// updateBgpAdministrativeStateCreateRequest creates the UpdateBgpAdministrativeState request. +func (client *InternalNetworksClient) updateBgpAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateBgpAdministrativeStateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBgpAdministrativeState" urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -754,42 +514,42 @@ func (client *InternalNetworksClient) updateBfdForStaticRouteAdministrativeState return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) } -// BeginUpdateBgpAdministrativeState - Update BGP state for internalNetwork. Allowed only on edge devices. +// BeginUpdateStaticRouteBfdAdministrativeState - Update Static Route BFD administrative state for internalNetwork. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain. -// - internalNetworkName - Name of the InternalNetwork. +// - l3IsolationDomainName - Name of the L3 Isolation Domain. +// - internalNetworkName - Name of the Internal Network. // - body - Request payload. -// - options - InternalNetworksClientBeginUpdateBgpAdministrativeStateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdateBgpAdministrativeState -// method. -func (client *InternalNetworksClient) BeginUpdateBgpAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateBgpAdministrativeStateOptions) (*runtime.Poller[InternalNetworksClientUpdateBgpAdministrativeStateResponse], error) { +// - options - InternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions contains the optional parameters for +// the InternalNetworksClient.BeginUpdateStaticRouteBfdAdministrativeState method. +func (client *InternalNetworksClient) BeginUpdateStaticRouteBfdAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions) (*runtime.Poller[InternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.updateBgpAdministrativeState(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, options) + resp, err := client.updateStaticRouteBfdAdministrativeState(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientUpdateBgpAdministrativeStateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[InternalNetworksClientUpdateBgpAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken[InternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } -// UpdateBgpAdministrativeState - Update BGP state for internalNetwork. Allowed only on edge devices. +// UpdateStaticRouteBfdAdministrativeState - Update Static Route BFD administrative state for internalNetwork. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview -func (client *InternalNetworksClient) updateBgpAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateBgpAdministrativeStateOptions) (*http.Response, error) { - req, err := client.updateBgpAdministrativeStateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, options) +// Generated from API version 2023-06-15 +func (client *InternalNetworksClient) updateStaticRouteBfdAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions) (*http.Response, error) { + req, err := client.updateStaticRouteBfdAdministrativeStateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, options) if err != nil { return nil, err } @@ -797,18 +557,15 @@ func (client *InternalNetworksClient) updateBgpAdministrativeState(ctx context.C if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil } -// updateBgpAdministrativeStateCreateRequest creates the UpdateBgpAdministrativeState request. -func (client *InternalNetworksClient) updateBgpAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateBgpAdministrativeStateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBgpAdministrativeState" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } +// updateStaticRouteBfdAdministrativeStateCreateRequest creates the UpdateStaticRouteBfdAdministrativeState request. +func (client *InternalNetworksClient) updateStaticRouteBfdAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateStaticRouteBfdAdministrativeState" urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -827,7 +584,7 @@ func (client *InternalNetworksClient) updateBgpAdministrativeStateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internalnetworks_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internalnetworks_client_example_test.go index 37266bbf4d2f..242e67a99ee7 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internalnetworks_client_example_test.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internalnetworks_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_Create_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Create_MaximumSet_Gen.json func ExampleInternalNetworksClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,12 +29,42 @@ func ExampleInternalNetworksClient_BeginCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewInternalNetworksClient().BeginCreate(ctx, "resourceGroupName", "example-l3domain", "example-internalnetwork", armmanagednetworkfabric.InternalNetwork{ + poller, err := clientFactory.NewInternalNetworksClient().BeginCreate(ctx, "example-rg", "example-l3domain", "example-internalnetwork", armmanagednetworkfabric.InternalNetwork{ Properties: &armmanagednetworkfabric.InternalNetworkProperties{ - BgpConfiguration: &armmanagednetworkfabric.BgpConfiguration{ - AllowAS: to.Ptr[int32](1), - AllowASOverride: to.Ptr(armmanagednetworkfabric.AllowASOverrideEnable), - BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{}, + Annotation: to.Ptr("annotation"), + Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), + ConnectedIPv4Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ + { + Annotation: to.Ptr("annotation"), + Prefix: to.Ptr("10.0.0.0/24"), + }}, + ConnectedIPv6Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ + { + Annotation: to.Ptr("annotation"), + Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), + }}, + EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ + ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + }, + ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ + ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + }, + ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + IsMonitoringEnabled: to.Ptr(armmanagednetworkfabric.IsMonitoringEnabledTrue), + Mtu: to.Ptr[int32](1500), + BgpConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesBgpConfiguration{ + Annotation: to.Ptr("annotation"), + AllowAS: to.Ptr[int32](10), + AllowASOverride: to.Ptr(armmanagednetworkfabric.AllowASOverrideEnable), + BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + IntervalInMilliSeconds: to.Ptr[int32](300), + Multiplier: to.Ptr[int32](5), + }, DefaultRouteOriginate: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), IPv4ListenRangePrefixes: []*string{ to.Ptr("10.1.0.0/25")}, @@ -48,35 +78,28 @@ func ExampleInternalNetworksClient_BeginCreate() { { Address: to.Ptr("2fff::"), }}, - PeerASN: to.Ptr[int32](6), + PeerASN: to.Ptr[int64](61234), }, - ConnectedIPv4Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - { - Prefix: to.Ptr("10.0.0.0/24"), - }}, - ConnectedIPv6Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - { - Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - }}, - ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2"), - ImportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName1"), - Mtu: to.Ptr[int32](1500), - StaticRouteConfiguration: &armmanagednetworkfabric.StaticRouteConfiguration{ - BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{}, + StaticRouteConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesStaticRouteConfiguration{ + Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), + BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + IntervalInMilliSeconds: to.Ptr[int32](300), + Multiplier: to.Ptr[int32](15), + }, IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ { NextHop: []*string{ to.Ptr("10.0.0.1")}, - Prefix: to.Ptr("10.1.0.0/24"), + Prefix: to.Ptr("jffgck"), }}, IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ { NextHop: []*string{ - to.Ptr("2ffe::1")}, + to.Ptr("3ffe::1")}, Prefix: to.Ptr("2fff::/64"), }}, }, - VlanID: to.Ptr[int32](501), + VlanID: to.Ptr[int32](755), }, }, nil) if err != nil { @@ -90,91 +113,100 @@ func ExampleInternalNetworksClient_BeginCreate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.InternalNetwork = armmanagednetworkfabric.InternalNetwork{ - // Name: to.Ptr("example-externalnetwork"), - // Type: to.Ptr("microsoft.managednetworkfabric/example-externalnetwork"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/externalNetworks/example-externalnetwork"), + // Name: to.Ptr("example-internalnetwork"), + // Type: to.Ptr("microsoft.managednetworkfabric/l3IsolationDomains/internalnetworks"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/internalNetworks/example-internalnetwork"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), // LastModifiedBy: to.Ptr("UserId"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Properties: &armmanagednetworkfabric.InternalNetworkProperties{ - // Annotation: to.Ptr("dojarxck"), - // BgpConfiguration: &armmanagednetworkfabric.BgpConfiguration{ - // AllowAS: to.Ptr[int32](1), + // Annotation: to.Ptr("annotation"), + // Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), + // ConnectedIPv4Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ + // { + // Annotation: to.Ptr("annotation"), + // Prefix: to.Ptr("10.0.0.0/24"), + // }}, + // ConnectedIPv6Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ + // { + // Annotation: to.Ptr("annotation"), + // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), + // }}, + // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ + // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // }, + // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ + // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // }, + // ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // IsMonitoringEnabled: to.Ptr(armmanagednetworkfabric.IsMonitoringEnabledTrue), + // Mtu: to.Ptr[int32](1500), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // BgpConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesBgpConfiguration{ + // Annotation: to.Ptr("annotation"), + // AllowAS: to.Ptr[int32](10), // AllowASOverride: to.Ptr(armmanagednetworkfabric.AllowASOverrideEnable), // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // Interval: to.Ptr[int32](4), - // Multiplier: to.Ptr[int32](13), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](5), // }, // DefaultRouteOriginate: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // FabricASN: to.Ptr[int32](21), + // FabricASN: to.Ptr[int64](20), // IPv4ListenRangePrefixes: []*string{ // to.Ptr("10.1.0.0/25")}, // IPv4NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ // { // Address: to.Ptr("10.1.0.0"), - // OperationalState: to.Ptr("Provisioned"), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), // }}, // IPv6ListenRangePrefixes: []*string{ // to.Ptr("2fff::/66")}, // IPv6NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ // { // Address: to.Ptr("2fff::"), - // OperationalState: to.Ptr("Provisioned"), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), // }}, - // PeerASN: to.Ptr[int32](6), + // PeerASN: to.Ptr[int64](61234), // }, - // ConnectedIPv4Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - // { - // Prefix: to.Ptr("10.0.0.0/24"), - // }}, - // ConnectedIPv6Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - // { - // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - // }}, - // ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2"), - // ImportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName1"), - // Mtu: to.Ptr[int32](1500), - // StaticRouteConfiguration: &armmanagednetworkfabric.StaticRouteConfiguration{ + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // StaticRouteConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesStaticRouteConfiguration{ + // Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // Interval: to.Ptr[int32](4), - // Multiplier: to.Ptr[int32](13), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](15), // }, // IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ // { // NextHop: []*string{ // to.Ptr("10.0.0.1")}, - // Prefix: to.Ptr("10.1.0.0/24"), + // Prefix: to.Ptr("jffgck"), // }}, // IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ // { // NextHop: []*string{ - // to.Ptr("2ffe::1")}, + // to.Ptr("3ffe::1")}, // Prefix: to.Ptr("2fff::/64"), // }}, // }, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // BfdDisabledOnResources: []*string{ - // to.Ptr("string")}, - // BfdForStaticRoutesDisabledOnResources: []*string{ - // to.Ptr("string")}, - // BgpDisabledOnResources: []*string{ - // to.Ptr("string")}, - // DisabledOnResources: []*string{ - // to.Ptr("string")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // VlanID: to.Ptr[int32](501), - // }, - // } + // VlanID: to.Ptr[int32](755), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_Get_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Get_MaximumSet_Gen.json func ExampleInternalNetworksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -185,7 +217,7 @@ func ExampleInternalNetworksClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewInternalNetworksClient().Get(ctx, "resourceGroupName", "example-l3domain", "example-internalnetwork", nil) + res, err := clientFactory.NewInternalNetworksClient().Get(ctx, "example-rg", "example-l3domain", "example-internalnetwork", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -193,90 +225,100 @@ func ExampleInternalNetworksClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.InternalNetwork = armmanagednetworkfabric.InternalNetwork{ - // Name: to.Ptr("example-externalnetwork"), - // Type: to.Ptr("microsoft.managednetworkfabric/example-externalnetwork"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/externalNetworks/example-externalnetwork"), + // Name: to.Ptr("example-internalnetwork"), + // Type: to.Ptr("microsoft.managednetworkfabric/l3IsolationDomains/internalnetworks"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/internalNetworks/example-internalnetwork"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), // LastModifiedBy: to.Ptr("UserId"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Properties: &armmanagednetworkfabric.InternalNetworkProperties{ - // BgpConfiguration: &armmanagednetworkfabric.BgpConfiguration{ - // AllowAS: to.Ptr[int32](1), + // Annotation: to.Ptr("annotation"), + // Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), + // ConnectedIPv4Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ + // { + // Annotation: to.Ptr("annotation"), + // Prefix: to.Ptr("10.0.0.0/24"), + // }}, + // ConnectedIPv6Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ + // { + // Annotation: to.Ptr("annotation"), + // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), + // }}, + // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ + // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // }, + // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ + // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // }, + // ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // IsMonitoringEnabled: to.Ptr(armmanagednetworkfabric.IsMonitoringEnabledTrue), + // Mtu: to.Ptr[int32](1500), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // BgpConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesBgpConfiguration{ + // Annotation: to.Ptr("annotation"), + // AllowAS: to.Ptr[int32](10), // AllowASOverride: to.Ptr(armmanagednetworkfabric.AllowASOverrideEnable), // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // Interval: to.Ptr[int32](4), - // Multiplier: to.Ptr[int32](13), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](5), // }, // DefaultRouteOriginate: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // FabricASN: to.Ptr[int32](21), + // FabricASN: to.Ptr[int64](20), // IPv4ListenRangePrefixes: []*string{ // to.Ptr("10.1.0.0/25")}, // IPv4NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ // { // Address: to.Ptr("10.1.0.0"), - // OperationalState: to.Ptr("Provisioned"), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), // }}, // IPv6ListenRangePrefixes: []*string{ // to.Ptr("2fff::/66")}, // IPv6NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ // { // Address: to.Ptr("2fff::"), - // OperationalState: to.Ptr("Provisioned"), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), // }}, - // PeerASN: to.Ptr[int32](6), + // PeerASN: to.Ptr[int64](61234), // }, - // ConnectedIPv4Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - // { - // Prefix: to.Ptr("10.0.0.0/24"), - // }}, - // ConnectedIPv6Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - // { - // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - // }}, - // ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2"), - // ImportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName1"), - // Mtu: to.Ptr[int32](1500), - // StaticRouteConfiguration: &armmanagednetworkfabric.StaticRouteConfiguration{ + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // StaticRouteConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesStaticRouteConfiguration{ + // Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // Interval: to.Ptr[int32](4), - // Multiplier: to.Ptr[int32](13), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](15), // }, // IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ // { // NextHop: []*string{ // to.Ptr("10.0.0.1")}, - // Prefix: to.Ptr("10.1.0.0/24"), + // Prefix: to.Ptr("jffgck"), // }}, // IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ // { // NextHop: []*string{ - // to.Ptr("2ffe::1")}, + // to.Ptr("3ffe::1")}, // Prefix: to.Ptr("2fff::/64"), // }}, // }, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // BfdDisabledOnResources: []*string{ - // to.Ptr("string")}, - // BfdForStaticRoutesDisabledOnResources: []*string{ - // to.Ptr("string")}, - // BgpDisabledOnResources: []*string{ - // to.Ptr("string")}, - // DisabledOnResources: []*string{ - // to.Ptr("string")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // VlanID: to.Ptr[int32](501), - // }, - // } + // VlanID: to.Ptr[int32](755), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_Update_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Update_MaximumSet_Gen.json func ExampleInternalNetworksClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -287,12 +329,41 @@ func ExampleInternalNetworksClient_BeginUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewInternalNetworksClient().BeginUpdate(ctx, "resourceGroupName", "example-l3domain", "example-internalnetwork", armmanagednetworkfabric.InternalNetworkPatch{ + poller, err := clientFactory.NewInternalNetworksClient().BeginUpdate(ctx, "example-rg", "example-l3domain", "example-internalnetwork", armmanagednetworkfabric.InternalNetworkPatch{ Properties: &armmanagednetworkfabric.InternalNetworkPatchProperties{ + Annotation: to.Ptr("annotation"), + ConnectedIPv4Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ + { + Annotation: to.Ptr("annotation"), + Prefix: to.Ptr("10.0.0.0/24"), + }}, + ConnectedIPv6Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ + { + Annotation: to.Ptr("annotation"), + Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), + }}, + EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ + ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + }, + ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ + ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + }, + ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + IsMonitoringEnabled: to.Ptr(armmanagednetworkfabric.IsMonitoringEnabledTrue), + Mtu: to.Ptr[int32](1500), BgpConfiguration: &armmanagednetworkfabric.BgpConfiguration{ - AllowAS: to.Ptr[int32](1), - AllowASOverride: to.Ptr(armmanagednetworkfabric.AllowASOverrideEnable), - BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{}, + Annotation: to.Ptr("annotation"), + AllowAS: to.Ptr[int32](10), + AllowASOverride: to.Ptr(armmanagednetworkfabric.AllowASOverrideEnable), + BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + IntervalInMilliSeconds: to.Ptr[int32](300), + Multiplier: to.Ptr[int32](5), + }, DefaultRouteOriginate: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), IPv4ListenRangePrefixes: []*string{ to.Ptr("10.1.0.0/25")}, @@ -306,31 +377,23 @@ func ExampleInternalNetworksClient_BeginUpdate() { { Address: to.Ptr("2fff::"), }}, - PeerASN: to.Ptr[int32](6), + PeerASN: to.Ptr[int64](61234), }, - ConnectedIPv4Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - { - Prefix: to.Ptr("10.0.0.0/24"), - }}, - ConnectedIPv6Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - { - Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - }}, - ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2"), - ImportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName1"), - Mtu: to.Ptr[int32](1500), StaticRouteConfiguration: &armmanagednetworkfabric.StaticRouteConfiguration{ - BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{}, + BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + IntervalInMilliSeconds: to.Ptr[int32](300), + Multiplier: to.Ptr[int32](15), + }, IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ { NextHop: []*string{ to.Ptr("10.0.0.1")}, - Prefix: to.Ptr("10.1.0.0/24"), + Prefix: to.Ptr("20.20.20.20/25"), }}, IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ { NextHop: []*string{ - to.Ptr("2ffe::1")}, + to.Ptr("3ffe::1")}, Prefix: to.Ptr("2fff::/64"), }}, }, @@ -347,91 +410,100 @@ func ExampleInternalNetworksClient_BeginUpdate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.InternalNetwork = armmanagednetworkfabric.InternalNetwork{ - // Name: to.Ptr("example-externalnetwork"), - // Type: to.Ptr("microsoft.managednetworkfabric/example-externalnetwork"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/externalNetworks/example-externalnetwork"), + // Name: to.Ptr("example-internalnetwork"), + // Type: to.Ptr("microsoft.managednetworkfabric/l3IsolationDomains/internalnetworks"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/internalNetworks/example-internalnetwork"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), // LastModifiedBy: to.Ptr("UserId"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Properties: &armmanagednetworkfabric.InternalNetworkProperties{ - // Annotation: to.Ptr("dojarxck"), - // BgpConfiguration: &armmanagednetworkfabric.BgpConfiguration{ - // AllowAS: to.Ptr[int32](1), + // Annotation: to.Ptr("annotation"), + // Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), + // ConnectedIPv4Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ + // { + // Annotation: to.Ptr("annotation"), + // Prefix: to.Ptr("10.0.0.0/24"), + // }}, + // ConnectedIPv6Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ + // { + // Annotation: to.Ptr("annotation"), + // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), + // }}, + // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ + // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // }, + // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ + // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // }, + // ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // IsMonitoringEnabled: to.Ptr(armmanagednetworkfabric.IsMonitoringEnabledTrue), + // Mtu: to.Ptr[int32](1500), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // BgpConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesBgpConfiguration{ + // Annotation: to.Ptr("annotation"), + // AllowAS: to.Ptr[int32](10), // AllowASOverride: to.Ptr(armmanagednetworkfabric.AllowASOverrideEnable), // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // Interval: to.Ptr[int32](4), - // Multiplier: to.Ptr[int32](13), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](5), // }, // DefaultRouteOriginate: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // FabricASN: to.Ptr[int32](21), + // FabricASN: to.Ptr[int64](20), // IPv4ListenRangePrefixes: []*string{ // to.Ptr("10.1.0.0/25")}, // IPv4NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ // { // Address: to.Ptr("10.1.0.0"), - // OperationalState: to.Ptr("Provisioned"), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), // }}, // IPv6ListenRangePrefixes: []*string{ // to.Ptr("2fff::/66")}, // IPv6NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ // { // Address: to.Ptr("2fff::"), - // OperationalState: to.Ptr("Provisioned"), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), // }}, - // PeerASN: to.Ptr[int32](6), + // PeerASN: to.Ptr[int64](61234), // }, - // ConnectedIPv4Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - // { - // Prefix: to.Ptr("10.0.0.0/24"), - // }}, - // ConnectedIPv6Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - // { - // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - // }}, - // ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2"), - // ImportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName1"), - // Mtu: to.Ptr[int32](1500), - // StaticRouteConfiguration: &armmanagednetworkfabric.StaticRouteConfiguration{ + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // StaticRouteConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesStaticRouteConfiguration{ + // Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // Interval: to.Ptr[int32](4), - // Multiplier: to.Ptr[int32](13), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](15), // }, // IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ // { // NextHop: []*string{ // to.Ptr("10.0.0.1")}, - // Prefix: to.Ptr("10.1.0.0/24"), + // Prefix: to.Ptr("jffgck"), // }}, // IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ // { // NextHop: []*string{ - // to.Ptr("2ffe::1")}, + // to.Ptr("3ffe::1")}, // Prefix: to.Ptr("2fff::/64"), // }}, // }, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // BfdDisabledOnResources: []*string{ - // to.Ptr("string")}, - // BfdForStaticRoutesDisabledOnResources: []*string{ - // to.Ptr("string")}, - // BgpDisabledOnResources: []*string{ - // to.Ptr("string")}, - // DisabledOnResources: []*string{ - // to.Ptr("string")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // VlanID: to.Ptr[int32](501), - // }, - // } + // VlanID: to.Ptr[int32](755), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_Delete_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Delete_MaximumSet_Gen.json func ExampleInternalNetworksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -442,7 +514,7 @@ func ExampleInternalNetworksClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewInternalNetworksClient().BeginDelete(ctx, "resourceGroupName", "example-l3domain", "example-internalnetwork", nil) + poller, err := clientFactory.NewInternalNetworksClient().BeginDelete(ctx, "example-rg", "example-l3domain", "example-internalnetwork", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -452,8 +524,8 @@ func ExampleInternalNetworksClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_List_MaximumSet_Gen.json -func ExampleInternalNetworksClient_NewListPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_ListByL3IsolationDomain_MaximumSet_Gen.json +func ExampleInternalNetworksClient_NewListByL3IsolationDomainPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -463,7 +535,7 @@ func ExampleInternalNetworksClient_NewListPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewInternalNetworksClient().NewListPager("resourceGroupName", "example-l3domain", nil) + pager := clientFactory.NewInternalNetworksClient().NewListByL3IsolationDomainPager("example-rg", "example-l3domain", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -477,93 +549,102 @@ func ExampleInternalNetworksClient_NewListPager() { // page.InternalNetworksList = armmanagednetworkfabric.InternalNetworksList{ // Value: []*armmanagednetworkfabric.InternalNetwork{ // { - // Name: to.Ptr("example-externalnetwork"), - // Type: to.Ptr("microsoft.managednetworkfabric/example-externalnetwork"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/externalNetworks/example-externalnetwork"), + // Name: to.Ptr("example-internalnetwork"), + // Type: to.Ptr("microsoft.managednetworkfabric/l3IsolationDomains/internalnetworks"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/internalNetworks/example-internalnetwork"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), // LastModifiedBy: to.Ptr("UserId"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Properties: &armmanagednetworkfabric.InternalNetworkProperties{ - // Annotation: to.Ptr("lab 1"), - // BgpConfiguration: &armmanagednetworkfabric.BgpConfiguration{ - // AllowAS: to.Ptr[int32](1), + // Annotation: to.Ptr("annotation"), + // Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), + // ConnectedIPv4Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ + // { + // Annotation: to.Ptr("annotation"), + // Prefix: to.Ptr("10.0.0.0/24"), + // }}, + // ConnectedIPv6Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ + // { + // Annotation: to.Ptr("annotation"), + // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), + // }}, + // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ + // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // }, + // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ + // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // }, + // ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // IsMonitoringEnabled: to.Ptr(armmanagednetworkfabric.IsMonitoringEnabledTrue), + // Mtu: to.Ptr[int32](1500), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // BgpConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesBgpConfiguration{ + // Annotation: to.Ptr("annotation"), + // AllowAS: to.Ptr[int32](10), // AllowASOverride: to.Ptr(armmanagednetworkfabric.AllowASOverrideEnable), // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // Interval: to.Ptr[int32](4), - // Multiplier: to.Ptr[int32](13), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](5), // }, // DefaultRouteOriginate: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // FabricASN: to.Ptr[int32](21), + // FabricASN: to.Ptr[int64](20), // IPv4ListenRangePrefixes: []*string{ // to.Ptr("10.1.0.0/25")}, // IPv4NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ // { // Address: to.Ptr("10.1.0.0"), - // OperationalState: to.Ptr("Provisioned"), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), // }}, // IPv6ListenRangePrefixes: []*string{ // to.Ptr("2fff::/66")}, // IPv6NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ // { // Address: to.Ptr("2fff::"), - // OperationalState: to.Ptr("Provisioned"), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), // }}, - // PeerASN: to.Ptr[int32](6), + // PeerASN: to.Ptr[int64](61234), // }, - // ConnectedIPv4Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - // { - // Prefix: to.Ptr("10.0.0.0/24"), - // }}, - // ConnectedIPv6Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - // { - // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - // }}, - // ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2"), - // ImportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName1"), - // Mtu: to.Ptr[int32](1500), - // StaticRouteConfiguration: &armmanagednetworkfabric.StaticRouteConfiguration{ + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // StaticRouteConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesStaticRouteConfiguration{ + // Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // Interval: to.Ptr[int32](4), - // Multiplier: to.Ptr[int32](13), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](15), // }, // IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ // { // NextHop: []*string{ // to.Ptr("10.0.0.1")}, - // Prefix: to.Ptr("10.1.0.0/24"), + // Prefix: to.Ptr("jffgck"), // }}, // IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ // { // NextHop: []*string{ - // to.Ptr("2ffe::1")}, + // to.Ptr("3ffe::1")}, // Prefix: to.Ptr("2fff::/64"), // }}, // }, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // BfdDisabledOnResources: []*string{ - // to.Ptr("string")}, - // BfdForStaticRoutesDisabledOnResources: []*string{ - // to.Ptr("string")}, - // BgpDisabledOnResources: []*string{ - // to.Ptr("string")}, - // DisabledOnResources: []*string{ - // to.Ptr("string")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // VlanID: to.Ptr[int32](501), - // }, - // }}, - // } + // VlanID: to.Ptr[int32](755), + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_updateAdministrativeState_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_UpdateAdministrativeState_MaximumSet_Gen.json func ExampleInternalNetworksClient_BeginUpdateAdministrativeState() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -574,21 +655,40 @@ func ExampleInternalNetworksClient_BeginUpdateAdministrativeState() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewInternalNetworksClient().BeginUpdateAdministrativeState(ctx, "resourceGroupName", "example-l3domain", "example-internalnetwork", armmanagednetworkfabric.UpdateAdministrativeState{ + poller, err := clientFactory.NewInternalNetworksClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-l3domain", "example-internalnetwork", armmanagednetworkfabric.UpdateAdministrativeState{ ResourceIDs: []*string{ - to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/internalNetworks/example-internalnetwork")}, - State: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnable), + to.Ptr("")}, + State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_updateBgpAdministrativeState_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_UpdateBgpAdministrativeState_MaximumSet_Gen.json func ExampleInternalNetworksClient_BeginUpdateBgpAdministrativeState() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -599,95 +699,41 @@ func ExampleInternalNetworksClient_BeginUpdateBgpAdministrativeState() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewInternalNetworksClient().BeginUpdateBgpAdministrativeState(ctx, "resourceGroupName", "example-l3domain", "example-internalnetwork", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/internalNetworks/example-internalnetwork")}, - State: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnable), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_updateBfdForBgpAdministrativeState_MaximumSet_Gen.json -func ExampleInternalNetworksClient_BeginUpdateBfdForBgpAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInternalNetworksClient().BeginUpdateBfdForBgpAdministrativeState(ctx, "resourceGroupName", "example-l3domain", "example-internalnetwork", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/internalNetworks/example-internalnetwork")}, - State: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnable), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_clearIpv6Neighbors_MaximumSet_Gen.json -func ExampleInternalNetworksClient_BeginClearIPv6Neighbors() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInternalNetworksClient().BeginClearIPv6Neighbors(ctx, "resourceGroupName", "example-l3domain", "example-internalnetwork", armmanagednetworkfabric.EnableDisableOnResources{ + poller, err := clientFactory.NewInternalNetworksClient().BeginUpdateBgpAdministrativeState(ctx, "example-rg", "example-l3domain", "example-internalNetwork", armmanagednetworkfabric.UpdateAdministrativeState{ ResourceIDs: []*string{ - to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")}, + to.Ptr("")}, + State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_clearArpEntries_MaximumSet_Gen.json -func ExampleInternalNetworksClient_BeginClearArpEntries() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInternalNetworksClient().BeginClearArpEntries(ctx, "resourceGroupName", "example-l3domain", "example-internalnetwork", armmanagednetworkfabric.EnableDisableOnResources{ - ResourceIDs: []*string{ - to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_updateBfdForStaticRouteAdministrativeState_MaximumSet_Gen.json -func ExampleInternalNetworksClient_BeginUpdateBfdForStaticRouteAdministrativeState() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_UpdateStaticRouteBfdAdministrativeState_MaximumSet_Gen.json +func ExampleInternalNetworksClient_BeginUpdateStaticRouteBfdAdministrativeState() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -697,16 +743,35 @@ func ExampleInternalNetworksClient_BeginUpdateBfdForStaticRouteAdministrativeSta if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewInternalNetworksClient().BeginUpdateBfdForStaticRouteAdministrativeState(ctx, "resourceGroupName", "example-l3domain", "example-internalnetwork", armmanagednetworkfabric.UpdateAdministrativeState{ + poller, err := clientFactory.NewInternalNetworksClient().BeginUpdateStaticRouteBfdAdministrativeState(ctx, "example-rg", "example-l3domain", "example-internalNetwork", armmanagednetworkfabric.UpdateAdministrativeState{ ResourceIDs: []*string{ - to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/internalNetworks/example-internalnetwork")}, - State: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnable), + to.Ptr("")}, + State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgatewayrules_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgatewayrules_client.go new file mode 100644 index 000000000000..6121be5961ee --- /dev/null +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgatewayrules_client.go @@ -0,0 +1,413 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armmanagednetworkfabric + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// InternetGatewayRulesClient contains the methods for the InternetGatewayRules group. +// Don't use this type directly, use NewInternetGatewayRulesClient() instead. +type InternetGatewayRulesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewInternetGatewayRulesClient creates a new instance of InternetGatewayRulesClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewInternetGatewayRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InternetGatewayRulesClient, error) { + cl, err := arm.NewClient(moduleName+".InternetGatewayRulesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &InternetGatewayRulesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Creates an Internet Gateway rule resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - internetGatewayRuleName - Name of the Internet Gateway rule. +// - body - Request payload. +// - options - InternetGatewayRulesClientBeginCreateOptions contains the optional parameters for the InternetGatewayRulesClient.BeginCreate +// method. +func (client *InternetGatewayRulesClient) BeginCreate(ctx context.Context, resourceGroupName string, internetGatewayRuleName string, body InternetGatewayRule, options *InternetGatewayRulesClientBeginCreateOptions) (*runtime.Poller[InternetGatewayRulesClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, internetGatewayRuleName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternetGatewayRulesClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[InternetGatewayRulesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Create - Creates an Internet Gateway rule resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *InternetGatewayRulesClient) create(ctx context.Context, resourceGroupName string, internetGatewayRuleName string, body InternetGatewayRule, options *InternetGatewayRulesClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, internetGatewayRuleName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createCreateRequest creates the Create request. +func (client *InternetGatewayRulesClient) createCreateRequest(ctx context.Context, resourceGroupName string, internetGatewayRuleName string, body InternetGatewayRule, options *InternetGatewayRulesClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if internetGatewayRuleName == "" { + return nil, errors.New("parameter internetGatewayRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{internetGatewayRuleName}", url.PathEscape(internetGatewayRuleName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginDelete - Implements Internet Gateway Rules DELETE method. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - internetGatewayRuleName - Name of the Internet Gateway rule. +// - options - InternetGatewayRulesClientBeginDeleteOptions contains the optional parameters for the InternetGatewayRulesClient.BeginDelete +// method. +func (client *InternetGatewayRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, internetGatewayRuleName string, options *InternetGatewayRulesClientBeginDeleteOptions) (*runtime.Poller[InternetGatewayRulesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, internetGatewayRuleName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternetGatewayRulesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[InternetGatewayRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Implements Internet Gateway Rules DELETE method. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *InternetGatewayRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, internetGatewayRuleName string, options *InternetGatewayRulesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, internetGatewayRuleName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *InternetGatewayRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, internetGatewayRuleName string, options *InternetGatewayRulesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if internetGatewayRuleName == "" { + return nil, errors.New("parameter internetGatewayRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{internetGatewayRuleName}", url.PathEscape(internetGatewayRuleName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets an Internet Gateway Rule resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - internetGatewayRuleName - Name of the Internet Gateway rule. +// - options - InternetGatewayRulesClientGetOptions contains the optional parameters for the InternetGatewayRulesClient.Get +// method. +func (client *InternetGatewayRulesClient) Get(ctx context.Context, resourceGroupName string, internetGatewayRuleName string, options *InternetGatewayRulesClientGetOptions) (InternetGatewayRulesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, internetGatewayRuleName, options) + if err != nil { + return InternetGatewayRulesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InternetGatewayRulesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InternetGatewayRulesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *InternetGatewayRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, internetGatewayRuleName string, options *InternetGatewayRulesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if internetGatewayRuleName == "" { + return nil, errors.New("parameter internetGatewayRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{internetGatewayRuleName}", url.PathEscape(internetGatewayRuleName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *InternetGatewayRulesClient) getHandleResponse(resp *http.Response) (InternetGatewayRulesClientGetResponse, error) { + result := InternetGatewayRulesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InternetGatewayRule); err != nil { + return InternetGatewayRulesClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Implements Internet Gateway Rules list by resource group GET method. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - InternetGatewayRulesClientListByResourceGroupOptions contains the optional parameters for the InternetGatewayRulesClient.NewListByResourceGroupPager +// method. +func (client *InternetGatewayRulesClient) NewListByResourceGroupPager(resourceGroupName string, options *InternetGatewayRulesClientListByResourceGroupOptions) *runtime.Pager[InternetGatewayRulesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[InternetGatewayRulesClientListByResourceGroupResponse]{ + More: func(page InternetGatewayRulesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InternetGatewayRulesClientListByResourceGroupResponse) (InternetGatewayRulesClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return InternetGatewayRulesClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InternetGatewayRulesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InternetGatewayRulesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *InternetGatewayRulesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *InternetGatewayRulesClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *InternetGatewayRulesClient) listByResourceGroupHandleResponse(resp *http.Response) (InternetGatewayRulesClientListByResourceGroupResponse, error) { + result := InternetGatewayRulesClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InternetGatewayRulesListResult); err != nil { + return InternetGatewayRulesClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List all Internet Gateway rules in the given subscription. +// +// Generated from API version 2023-06-15 +// - options - InternetGatewayRulesClientListBySubscriptionOptions contains the optional parameters for the InternetGatewayRulesClient.NewListBySubscriptionPager +// method. +func (client *InternetGatewayRulesClient) NewListBySubscriptionPager(options *InternetGatewayRulesClientListBySubscriptionOptions) *runtime.Pager[InternetGatewayRulesClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[InternetGatewayRulesClientListBySubscriptionResponse]{ + More: func(page InternetGatewayRulesClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InternetGatewayRulesClientListBySubscriptionResponse) (InternetGatewayRulesClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return InternetGatewayRulesClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InternetGatewayRulesClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InternetGatewayRulesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *InternetGatewayRulesClient) listBySubscriptionCreateRequest(ctx context.Context, options *InternetGatewayRulesClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *InternetGatewayRulesClient) listBySubscriptionHandleResponse(resp *http.Response) (InternetGatewayRulesClientListBySubscriptionResponse, error) { + result := InternetGatewayRulesClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InternetGatewayRulesListResult); err != nil { + return InternetGatewayRulesClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// BeginUpdate - API to update certain properties of the Internet Gateway Rule resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - internetGatewayRuleName - Name of the Internet Gateway rule. +// - body - Internet Gateway Rule properties to update. +// - options - InternetGatewayRulesClientBeginUpdateOptions contains the optional parameters for the InternetGatewayRulesClient.BeginUpdate +// method. +func (client *InternetGatewayRulesClient) BeginUpdate(ctx context.Context, resourceGroupName string, internetGatewayRuleName string, body InternetGatewayRulePatch, options *InternetGatewayRulesClientBeginUpdateOptions) (*runtime.Poller[InternetGatewayRulesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, internetGatewayRuleName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternetGatewayRulesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[InternetGatewayRulesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - API to update certain properties of the Internet Gateway Rule resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *InternetGatewayRulesClient) update(ctx context.Context, resourceGroupName string, internetGatewayRuleName string, body InternetGatewayRulePatch, options *InternetGatewayRulesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, internetGatewayRuleName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *InternetGatewayRulesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, internetGatewayRuleName string, body InternetGatewayRulePatch, options *InternetGatewayRulesClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if internetGatewayRuleName == "" { + return nil, errors.New("parameter internetGatewayRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{internetGatewayRuleName}", url.PathEscape(internetGatewayRuleName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgatewayrules_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgatewayrules_client_example_test.go new file mode 100644 index 000000000000..1f0e554cfcdc --- /dev/null +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgatewayrules_client_example_test.go @@ -0,0 +1,321 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armmanagednetworkfabric_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Create_MaximumSet_Gen.json +func ExampleInternetGatewayRulesClient_BeginCreate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewInternetGatewayRulesClient().BeginCreate(ctx, "example-rg", "example-internetGatewayRule", armmanagednetworkfabric.InternetGatewayRule{ + Location: to.Ptr("eastus"), + Tags: map[string]*string{ + "keyID": to.Ptr("keyValue"), + }, + Properties: &armmanagednetworkfabric.InternetGatewayRuleProperties{ + Annotation: to.Ptr("annotationValue"), + RuleProperties: &armmanagednetworkfabric.RuleProperties{ + Action: to.Ptr(armmanagednetworkfabric.ActionAllow), + AddressList: []*string{ + to.Ptr("10.10.10.10")}, + }, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.InternetGatewayRule = armmanagednetworkfabric.InternetGatewayRule{ + // Name: to.Ptr("example-internetGatewayRule"), + // Type: to.Ptr("microsoft.managednetworkfabric/internetGatewayRules"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-InternetGatewayRule"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("keyValue"), + // }, + // Properties: &armmanagednetworkfabric.InternetGatewayRuleProperties{ + // Annotation: to.Ptr("annotationValue"), + // InternetGatewayIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // RuleProperties: &armmanagednetworkfabric.RuleProperties{ + // Action: to.Ptr(armmanagednetworkfabric.ActionAllow), + // AddressList: []*string{ + // to.Ptr("10.10.10.10")}, + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Get_MaximumSet_Gen.json +func ExampleInternetGatewayRulesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewInternetGatewayRulesClient().Get(ctx, "example-rg", "example-internetGatewayRule", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.InternetGatewayRule = armmanagednetworkfabric.InternetGatewayRule{ + // Name: to.Ptr("example-internetGatewayRule"), + // Type: to.Ptr("microsoft.managednetworkfabric/internetGatewayRules"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-InternetGatewayRule"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("keyValue"), + // }, + // Properties: &armmanagednetworkfabric.InternetGatewayRuleProperties{ + // Annotation: to.Ptr("annotationValue"), + // InternetGatewayIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // RuleProperties: &armmanagednetworkfabric.RuleProperties{ + // Action: to.Ptr(armmanagednetworkfabric.ActionAllow), + // AddressList: []*string{ + // to.Ptr("10.10.10.10")}, + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Update_MaximumSet_Gen.json +func ExampleInternetGatewayRulesClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewInternetGatewayRulesClient().BeginUpdate(ctx, "example-rg", "example-internetGatewayRule", armmanagednetworkfabric.InternetGatewayRulePatch{ + Tags: map[string]*string{ + "key3311": to.Ptr("1234"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.InternetGatewayRule = armmanagednetworkfabric.InternetGatewayRule{ + // Name: to.Ptr("example-internetGatewayRule"), + // Type: to.Ptr("microsoft.managednetworkfabric/internetGatewayRules"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-InternetGatewayRule"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "key3311": to.Ptr("1234"), + // }, + // Properties: &armmanagednetworkfabric.InternetGatewayRuleProperties{ + // Annotation: to.Ptr("annotationValue"), + // InternetGatewayIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // RuleProperties: &armmanagednetworkfabric.RuleProperties{ + // Action: to.Ptr(armmanagednetworkfabric.ActionAllow), + // AddressList: []*string{ + // to.Ptr("10.10.10.10")}, + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Delete_MaximumSet_Gen.json +func ExampleInternetGatewayRulesClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewInternetGatewayRulesClient().BeginDelete(ctx, "example-rg", "example-internetGatewayRule", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_ListByResourceGroup_MaximumSet_Gen.json +func ExampleInternetGatewayRulesClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewInternetGatewayRulesClient().NewListByResourceGroupPager("example-internetGatewayRule", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.InternetGatewayRulesListResult = armmanagednetworkfabric.InternetGatewayRulesListResult{ + // Value: []*armmanagednetworkfabric.InternetGatewayRule{ + // { + // Name: to.Ptr("example-internetGatewayRule"), + // Type: to.Ptr("microsoft.managednetworkfabric/internetGatewayRules"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-InternetGatewayRule"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("keyValue"), + // }, + // Properties: &armmanagednetworkfabric.InternetGatewayRuleProperties{ + // Annotation: to.Ptr("annotationValue"), + // InternetGatewayIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // RuleProperties: &armmanagednetworkfabric.RuleProperties{ + // Action: to.Ptr(armmanagednetworkfabric.ActionAllow), + // AddressList: []*string{ + // to.Ptr("10.10.10.10")}, + // }, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_ListBySubscription_MaximumSet_Gen.json +func ExampleInternetGatewayRulesClient_NewListBySubscriptionPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewInternetGatewayRulesClient().NewListBySubscriptionPager(nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.InternetGatewayRulesListResult = armmanagednetworkfabric.InternetGatewayRulesListResult{ + // Value: []*armmanagednetworkfabric.InternetGatewayRule{ + // { + // Name: to.Ptr("example-internetGatewayRule"), + // Type: to.Ptr("microsoft.managednetworkfabric/internetGatewayRules"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-InternetGatewayRule"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("keyValue"), + // }, + // Properties: &armmanagednetworkfabric.InternetGatewayRuleProperties{ + // Annotation: to.Ptr("annotationValue"), + // InternetGatewayIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // RuleProperties: &armmanagednetworkfabric.RuleProperties{ + // Action: to.Ptr(armmanagednetworkfabric.ActionAllow), + // AddressList: []*string{ + // to.Ptr("10.10.10.10")}, + // }, + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgateways_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgateways_client.go new file mode 100644 index 000000000000..450aa624eb52 --- /dev/null +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgateways_client.go @@ -0,0 +1,412 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armmanagednetworkfabric + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// InternetGatewaysClient contains the methods for the InternetGateways group. +// Don't use this type directly, use NewInternetGatewaysClient() instead. +type InternetGatewaysClient struct { + internal *arm.Client + subscriptionID string +} + +// NewInternetGatewaysClient creates a new instance of InternetGatewaysClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewInternetGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InternetGatewaysClient, error) { + cl, err := arm.NewClient(moduleName+".InternetGatewaysClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &InternetGatewaysClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Creates a Network Fabric Service Internet Gateway resource instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - internetGatewayName - Name of the Internet Gateway. +// - body - Request payload. +// - options - InternetGatewaysClientBeginCreateOptions contains the optional parameters for the InternetGatewaysClient.BeginCreate +// method. +func (client *InternetGatewaysClient) BeginCreate(ctx context.Context, resourceGroupName string, internetGatewayName string, body InternetGateway, options *InternetGatewaysClientBeginCreateOptions) (*runtime.Poller[InternetGatewaysClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, internetGatewayName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternetGatewaysClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[InternetGatewaysClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Create - Creates a Network Fabric Service Internet Gateway resource instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *InternetGatewaysClient) create(ctx context.Context, resourceGroupName string, internetGatewayName string, body InternetGateway, options *InternetGatewaysClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, internetGatewayName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createCreateRequest creates the Create request. +func (client *InternetGatewaysClient) createCreateRequest(ctx context.Context, resourceGroupName string, internetGatewayName string, body InternetGateway, options *InternetGatewaysClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if internetGatewayName == "" { + return nil, errors.New("parameter internetGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{internetGatewayName}", url.PathEscape(internetGatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginDelete - Execute a delete on Network Fabric Service Internet Gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - internetGatewayName - Name of the Internet Gateway. +// - options - InternetGatewaysClientBeginDeleteOptions contains the optional parameters for the InternetGatewaysClient.BeginDelete +// method. +func (client *InternetGatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, internetGatewayName string, options *InternetGatewaysClientBeginDeleteOptions) (*runtime.Poller[InternetGatewaysClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, internetGatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternetGatewaysClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[InternetGatewaysClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Execute a delete on Network Fabric Service Internet Gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *InternetGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, internetGatewayName string, options *InternetGatewaysClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, internetGatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *InternetGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, internetGatewayName string, options *InternetGatewaysClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if internetGatewayName == "" { + return nil, errors.New("parameter internetGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{internetGatewayName}", url.PathEscape(internetGatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Implements Gateway GET method. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - internetGatewayName - Name of the Internet Gateway. +// - options - InternetGatewaysClientGetOptions contains the optional parameters for the InternetGatewaysClient.Get method. +func (client *InternetGatewaysClient) Get(ctx context.Context, resourceGroupName string, internetGatewayName string, options *InternetGatewaysClientGetOptions) (InternetGatewaysClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, internetGatewayName, options) + if err != nil { + return InternetGatewaysClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InternetGatewaysClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InternetGatewaysClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *InternetGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, internetGatewayName string, options *InternetGatewaysClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if internetGatewayName == "" { + return nil, errors.New("parameter internetGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{internetGatewayName}", url.PathEscape(internetGatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *InternetGatewaysClient) getHandleResponse(resp *http.Response) (InternetGatewaysClientGetResponse, error) { + result := InternetGatewaysClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InternetGateway); err != nil { + return InternetGatewaysClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Displays Internet Gateways list by resource group GET method. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - InternetGatewaysClientListByResourceGroupOptions contains the optional parameters for the InternetGatewaysClient.NewListByResourceGroupPager +// method. +func (client *InternetGatewaysClient) NewListByResourceGroupPager(resourceGroupName string, options *InternetGatewaysClientListByResourceGroupOptions) *runtime.Pager[InternetGatewaysClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[InternetGatewaysClientListByResourceGroupResponse]{ + More: func(page InternetGatewaysClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InternetGatewaysClientListByResourceGroupResponse) (InternetGatewaysClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return InternetGatewaysClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InternetGatewaysClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InternetGatewaysClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *InternetGatewaysClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *InternetGatewaysClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *InternetGatewaysClient) listByResourceGroupHandleResponse(resp *http.Response) (InternetGatewaysClientListByResourceGroupResponse, error) { + result := InternetGatewaysClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InternetGatewaysListResult); err != nil { + return InternetGatewaysClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Displays Internet Gateways list by subscription GET method. +// +// Generated from API version 2023-06-15 +// - options - InternetGatewaysClientListBySubscriptionOptions contains the optional parameters for the InternetGatewaysClient.NewListBySubscriptionPager +// method. +func (client *InternetGatewaysClient) NewListBySubscriptionPager(options *InternetGatewaysClientListBySubscriptionOptions) *runtime.Pager[InternetGatewaysClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[InternetGatewaysClientListBySubscriptionResponse]{ + More: func(page InternetGatewaysClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InternetGatewaysClientListBySubscriptionResponse) (InternetGatewaysClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return InternetGatewaysClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InternetGatewaysClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InternetGatewaysClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *InternetGatewaysClient) listBySubscriptionCreateRequest(ctx context.Context, options *InternetGatewaysClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGateways" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *InternetGatewaysClient) listBySubscriptionHandleResponse(resp *http.Response) (InternetGatewaysClientListBySubscriptionResponse, error) { + result := InternetGatewaysClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InternetGatewaysListResult); err != nil { + return InternetGatewaysClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// BeginUpdate - Execute patch on Network Fabric Service Internet Gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - internetGatewayName - Name of the Internet Gateway. +// - body - API to update certain properties of the L2 Isolation Domain resource.. +// - options - InternetGatewaysClientBeginUpdateOptions contains the optional parameters for the InternetGatewaysClient.BeginUpdate +// method. +func (client *InternetGatewaysClient) BeginUpdate(ctx context.Context, resourceGroupName string, internetGatewayName string, body InternetGatewayPatch, options *InternetGatewaysClientBeginUpdateOptions) (*runtime.Poller[InternetGatewaysClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, internetGatewayName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternetGatewaysClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[InternetGatewaysClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Execute patch on Network Fabric Service Internet Gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *InternetGatewaysClient) update(ctx context.Context, resourceGroupName string, internetGatewayName string, body InternetGatewayPatch, options *InternetGatewaysClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, internetGatewayName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *InternetGatewaysClient) updateCreateRequest(ctx context.Context, resourceGroupName string, internetGatewayName string, body InternetGatewayPatch, options *InternetGatewaysClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if internetGatewayName == "" { + return nil, errors.New("parameter internetGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{internetGatewayName}", url.PathEscape(internetGatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgateways_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgateways_client_example_test.go new file mode 100644 index 000000000000..315d0f3876a4 --- /dev/null +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgateways_client_example_test.go @@ -0,0 +1,312 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armmanagednetworkfabric_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_Create_MaximumSet_Gen.json +func ExampleInternetGatewaysClient_BeginCreate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewInternetGatewaysClient().BeginCreate(ctx, "example-rg", "example-internetGateway", armmanagednetworkfabric.InternetGateway{ + Location: to.Ptr("eastus"), + Tags: map[string]*string{ + "key3540": to.Ptr("1234"), + }, + Properties: &armmanagednetworkfabric.InternetGatewayProperties{ + Annotation: to.Ptr("annotation"), + InternetGatewayRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetGatewayRule"), + Type: to.Ptr(armmanagednetworkfabric.GatewayTypeInfrastructure), + NetworkFabricControllerID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkFabricController"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.InternetGateway = armmanagednetworkfabric.InternetGateway{ + // Name: to.Ptr("example-internetGateway"), + // Type: to.Ptr("microsoft.managednetworkfabric/internetGateways"), + // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "key3540": to.Ptr("1234"), + // }, + // Properties: &armmanagednetworkfabric.InternetGatewayProperties{ + // Annotation: to.Ptr("annotation"), + // InternetGatewayRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetGatewayRule"), + // Type: to.Ptr(armmanagednetworkfabric.GatewayTypeInfrastructure), + // IPv4Address: to.Ptr("10.10.10.10"), + // NetworkFabricControllerID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkFabricController"), + // Port: to.Ptr[int32](25), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_Get_MaximumSet_Gen.json +func ExampleInternetGatewaysClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewInternetGatewaysClient().Get(ctx, "example-rg", "example-internetGateway", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.InternetGateway = armmanagednetworkfabric.InternetGateway{ + // Name: to.Ptr("example-internetGateway"), + // Type: to.Ptr("microsoft.managednetworkfabric/internetGateways"), + // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "key3540": to.Ptr("1234"), + // }, + // Properties: &armmanagednetworkfabric.InternetGatewayProperties{ + // Annotation: to.Ptr("annotation"), + // InternetGatewayRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetGatewayRule"), + // Type: to.Ptr(armmanagednetworkfabric.GatewayTypeInfrastructure), + // IPv4Address: to.Ptr("10.10.10.10"), + // NetworkFabricControllerID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkFabricController"), + // Port: to.Ptr[int32](25), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_Update_MaximumSet_Gen.json +func ExampleInternetGatewaysClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewInternetGatewaysClient().BeginUpdate(ctx, "example-rg", "example-internetGateway", armmanagednetworkfabric.InternetGatewayPatch{ + Tags: map[string]*string{ + "key81": to.Ptr("2345"), + }, + Properties: &armmanagednetworkfabric.InternetGatewayPatchableProperties{ + InternetGatewayRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetGatewayRule"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.InternetGateway = armmanagednetworkfabric.InternetGateway{ + // Name: to.Ptr("example-internetGateway"), + // Type: to.Ptr("microsoft.managednetworkfabric/internetGateways"), + // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "key3540": to.Ptr("1234"), + // }, + // Properties: &armmanagednetworkfabric.InternetGatewayProperties{ + // Annotation: to.Ptr("annotation"), + // InternetGatewayRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetGatewayRule"), + // Type: to.Ptr(armmanagednetworkfabric.GatewayTypeInfrastructure), + // IPv4Address: to.Ptr("10.10.10.10"), + // NetworkFabricControllerID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkFabricController"), + // Port: to.Ptr[int32](25), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_Delete_MaximumSet_Gen.json +func ExampleInternetGatewaysClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewInternetGatewaysClient().BeginDelete(ctx, "example-rg", "example-internetGateway", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_ListByResourceGroup_MaximumSet_Gen.json +func ExampleInternetGatewaysClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewInternetGatewaysClient().NewListByResourceGroupPager("example-rg", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.InternetGatewaysListResult = armmanagednetworkfabric.InternetGatewaysListResult{ + // Value: []*armmanagednetworkfabric.InternetGateway{ + // { + // Name: to.Ptr("example-internetGateway"), + // Type: to.Ptr("microsoft.managednetworkfabric/internetGateways"), + // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "key3540": to.Ptr("1234"), + // }, + // Properties: &armmanagednetworkfabric.InternetGatewayProperties{ + // Annotation: to.Ptr("annotation"), + // InternetGatewayRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetGatewayRule"), + // Type: to.Ptr(armmanagednetworkfabric.GatewayTypeInfrastructure), + // IPv4Address: to.Ptr("10.10.10.10"), + // NetworkFabricControllerID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkFabricController"), + // Port: to.Ptr[int32](25), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_ListBySubscription_MaximumSet_Gen.json +func ExampleInternetGatewaysClient_NewListBySubscriptionPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewInternetGatewaysClient().NewListBySubscriptionPager(nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.InternetGatewaysListResult = armmanagednetworkfabric.InternetGatewaysListResult{ + // Value: []*armmanagednetworkfabric.InternetGateway{ + // { + // Name: to.Ptr("example-internetGateway"), + // Type: to.Ptr("microsoft.managednetworkfabric/internetGateways"), + // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "key3540": to.Ptr("1234"), + // }, + // Properties: &armmanagednetworkfabric.InternetGatewayProperties{ + // Annotation: to.Ptr("annotation"), + // InternetGatewayRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetGatewayRule"), + // Type: to.Ptr(armmanagednetworkfabric.GatewayTypeInfrastructure), + // IPv4Address: to.Ptr("10.10.10.10"), + // NetworkFabricControllerID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkFabricController"), + // Port: to.Ptr[int32](25), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipcommunities_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipcommunities_client.go index 66141b2fc722..cedc55edf921 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipcommunities_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipcommunities_client.go @@ -29,7 +29,7 @@ type IPCommunitiesClient struct { } // NewIPCommunitiesClient creates a new instance of IPCommunitiesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewIPCommunitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IPCommunitiesClient, error) { @@ -47,9 +47,9 @@ func NewIPCommunitiesClient(subscriptionID string, credential azcore.TokenCreden // BeginCreate - Implements an IP Community PUT method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - ipCommunityName - Name of the IP Community +// - ipCommunityName - Name of the IP Community. // - body - Request payload. // - options - IPCommunitiesClientBeginCreateOptions contains the optional parameters for the IPCommunitiesClient.BeginCreate // method. @@ -70,7 +70,7 @@ func (client *IPCommunitiesClient) BeginCreate(ctx context.Context, resourceGrou // Create - Implements an IP Community PUT method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *IPCommunitiesClient) create(ctx context.Context, resourceGroupName string, ipCommunityName string, body IPCommunity, options *IPCommunitiesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, ipCommunityName, body, options) if err != nil { @@ -89,9 +89,6 @@ func (client *IPCommunitiesClient) create(ctx context.Context, resourceGroupName // createCreateRequest creates the Create request. func (client *IPCommunitiesClient) createCreateRequest(ctx context.Context, resourceGroupName string, ipCommunityName string, body IPCommunity, options *IPCommunitiesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -106,7 +103,7 @@ func (client *IPCommunitiesClient) createCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -115,7 +112,7 @@ func (client *IPCommunitiesClient) createCreateRequest(ctx context.Context, reso // BeginDelete - Implements IP Community DELETE method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - ipCommunityName - Name of the IP Community. // - options - IPCommunitiesClientBeginDeleteOptions contains the optional parameters for the IPCommunitiesClient.BeginDelete @@ -137,7 +134,7 @@ func (client *IPCommunitiesClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Implements IP Community DELETE method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *IPCommunitiesClient) deleteOperation(ctx context.Context, resourceGroupName string, ipCommunityName string, options *IPCommunitiesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, ipCommunityName, options) if err != nil { @@ -147,7 +144,7 @@ func (client *IPCommunitiesClient) deleteOperation(ctx context.Context, resource if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -156,9 +153,6 @@ func (client *IPCommunitiesClient) deleteOperation(ctx context.Context, resource // deleteCreateRequest creates the Delete request. func (client *IPCommunitiesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ipCommunityName string, options *IPCommunitiesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -173,7 +167,7 @@ func (client *IPCommunitiesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +176,7 @@ func (client *IPCommunitiesClient) deleteCreateRequest(ctx context.Context, reso // Get - Implements an IP Community GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - ipCommunityName - Name of the IP Community. // - options - IPCommunitiesClientGetOptions contains the optional parameters for the IPCommunitiesClient.Get method. @@ -204,9 +198,6 @@ func (client *IPCommunitiesClient) Get(ctx context.Context, resourceGroupName st // getCreateRequest creates the Get request. func (client *IPCommunitiesClient) getCreateRequest(ctx context.Context, resourceGroupName string, ipCommunityName string, options *IPCommunitiesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -221,7 +212,7 @@ func (client *IPCommunitiesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -236,9 +227,9 @@ func (client *IPCommunitiesClient) getHandleResponse(resp *http.Response) (IPCom return result, nil } -// NewListByResourceGroupPager - Implements IpCommunities list by resource group GET method. +// NewListByResourceGroupPager - Implements IP Communities list by resource group GET method. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - IPCommunitiesClientListByResourceGroupOptions contains the optional parameters for the IPCommunitiesClient.NewListByResourceGroupPager // method. @@ -273,9 +264,6 @@ func (client *IPCommunitiesClient) NewListByResourceGroupPager(resourceGroupName // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *IPCommunitiesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *IPCommunitiesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -286,7 +274,7 @@ func (client *IPCommunitiesClient) listByResourceGroupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -301,9 +289,9 @@ func (client *IPCommunitiesClient) listByResourceGroupHandleResponse(resp *http. return result, nil } -// NewListBySubscriptionPager - Implements IpCommunities list by subscription GET method. +// NewListBySubscriptionPager - Implements IP Communities list by subscription GET method. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - options - IPCommunitiesClientListBySubscriptionOptions contains the optional parameters for the IPCommunitiesClient.NewListBySubscriptionPager // method. func (client *IPCommunitiesClient) NewListBySubscriptionPager(options *IPCommunitiesClientListBySubscriptionOptions) *runtime.Pager[IPCommunitiesClientListBySubscriptionResponse] { @@ -337,16 +325,13 @@ func (client *IPCommunitiesClient) NewListBySubscriptionPager(options *IPCommuni // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *IPCommunitiesClient) listBySubscriptionCreateRequest(ctx context.Context, options *IPCommunitiesClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/ipCommunities" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -364,9 +349,9 @@ func (client *IPCommunitiesClient) listBySubscriptionHandleResponse(resp *http.R // BeginUpdate - API to update certain properties of the IP Community resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - ipCommunityName - Name of the IP Community +// - ipCommunityName - Name of the IP Community. // - body - IP Community properties to update. // - options - IPCommunitiesClientBeginUpdateOptions contains the optional parameters for the IPCommunitiesClient.BeginUpdate // method. @@ -387,7 +372,7 @@ func (client *IPCommunitiesClient) BeginUpdate(ctx context.Context, resourceGrou // Update - API to update certain properties of the IP Community resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *IPCommunitiesClient) update(ctx context.Context, resourceGroupName string, ipCommunityName string, body IPCommunityPatch, options *IPCommunitiesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, ipCommunityName, body, options) if err != nil { @@ -406,9 +391,6 @@ func (client *IPCommunitiesClient) update(ctx context.Context, resourceGroupName // updateCreateRequest creates the Update request. func (client *IPCommunitiesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, ipCommunityName string, body IPCommunityPatch, options *IPCommunitiesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -423,7 +405,7 @@ func (client *IPCommunitiesClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipcommunities_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipcommunities_client_example_test.go index c8c36040ffd3..66890a439c9c 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipcommunities_client_example_test.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipcommunities_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunities_Create_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Create_MaximumSet_Gen.json func ExampleIPCommunitiesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,21 +29,22 @@ func ExampleIPCommunitiesClient_BeginCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewIPCommunitiesClient().BeginCreate(ctx, "rgIpCommunityLists", "example-ipCommunity", armmanagednetworkfabric.IPCommunity{ - Location: to.Ptr("EastUS"), + poller, err := clientFactory.NewIPCommunitiesClient().BeginCreate(ctx, "example-rg", "example-ipcommunity", armmanagednetworkfabric.IPCommunity{ + Location: to.Ptr("eastus"), Tags: map[string]*string{ - "key2814": to.Ptr(""), + "keyId": to.Ptr("KeyValue"), }, Properties: &armmanagednetworkfabric.IPCommunityProperties{ - Annotation: to.Ptr("annotationValue"), - Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - CommunityMembers: []*string{ - to.Ptr("1234:5678")}, - WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ - to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet), - to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesLocalAS), - to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesNoExport), - to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesGShut)}, + Annotation: to.Ptr("annotation"), + IPCommunityRules: []*armmanagednetworkfabric.IPCommunityRule{ + { + Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + CommunityMembers: []*string{ + to.Ptr("1:1")}, + SequenceNumber: to.Ptr[int64](4155123341), + WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ + to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet)}, + }}, }, }, nil) if err != nil { @@ -57,37 +58,40 @@ func ExampleIPCommunitiesClient_BeginCreate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.IPCommunity = armmanagednetworkfabric.IPCommunity{ - // Name: to.Ptr("example-ipCommunity"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipCommunities"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity"), + // Name: to.Ptr("example-ipcommunity"), + // Type: to.Ptr("microsoft.managednetworkfabric/ipcommunities"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipcommunity"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:05:16.579Z"); return t}()), - // CreatedBy: to.Ptr("user@email.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:05:16.579Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUS"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key2814": to.Ptr(""), + // "keyId": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.IPCommunityProperties{ - // Annotation: to.Ptr("annotationValue"), - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // CommunityMembers: []*string{ - // to.Ptr("1234:5678")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet), - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesLocalAS), - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesNoExport), - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesGShut)}, + // Annotation: to.Ptr("annotation"), + // IPCommunityRules: []*armmanagednetworkfabric.IPCommunityRule{ + // { + // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + // CommunityMembers: []*string{ + // to.Ptr("1:1")}, + // SequenceNumber: to.Ptr[int64](4155123341), + // WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ + // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet)}, + // }}, + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunities_Get_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Get_MaximumSet_Gen.json func ExampleIPCommunitiesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -98,7 +102,7 @@ func ExampleIPCommunitiesClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewIPCommunitiesClient().Get(ctx, "resourceGroupName", "example-ipCommunity", nil) + res, err := clientFactory.NewIPCommunitiesClient().Get(ctx, "example-rg", "example-ipcommunity", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -106,37 +110,40 @@ func ExampleIPCommunitiesClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.IPCommunity = armmanagednetworkfabric.IPCommunity{ - // Name: to.Ptr("example-ipCommunity"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipCommunities"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity"), + // Name: to.Ptr("example-ipcommunity"), + // Type: to.Ptr("microsoft.managednetworkfabric/ipcommunities"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipcommunity"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:05:16.579Z"); return t}()), - // CreatedBy: to.Ptr("user@email.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:05:16.579Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUS"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key2814": to.Ptr(""), + // "keyId": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.IPCommunityProperties{ - // Annotation: to.Ptr("annotationValue"), - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // CommunityMembers: []*string{ - // to.Ptr("1234:5678")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet), - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesLocalAS), - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesNoExport), - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesGShut)}, + // Annotation: to.Ptr("annotation"), + // IPCommunityRules: []*armmanagednetworkfabric.IPCommunityRule{ + // { + // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + // CommunityMembers: []*string{ + // to.Ptr("1:1")}, + // SequenceNumber: to.Ptr[int64](4155123341), + // WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ + // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet)}, + // }}, + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunities_Update_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Update_MaximumSet_Gen.json func ExampleIPCommunitiesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -147,9 +154,17 @@ func ExampleIPCommunitiesClient_BeginUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewIPCommunitiesClient().BeginUpdate(ctx, "resourceGroupName", "example-ipCommunity", armmanagednetworkfabric.IPCommunityPatch{ - Tags: map[string]*string{ - "key2814": to.Ptr(""), + poller, err := clientFactory.NewIPCommunitiesClient().BeginUpdate(ctx, "example-rg", "example-ipcommunity", armmanagednetworkfabric.IPCommunityPatch{ + Properties: &armmanagednetworkfabric.IPCommunityPatchableProperties{ + IPCommunityRules: []*armmanagednetworkfabric.IPCommunityRule{ + { + Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + CommunityMembers: []*string{ + to.Ptr("1:1")}, + SequenceNumber: to.Ptr[int64](4155123341), + WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ + to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet)}, + }}, }, }, nil) if err != nil { @@ -163,37 +178,40 @@ func ExampleIPCommunitiesClient_BeginUpdate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.IPCommunity = armmanagednetworkfabric.IPCommunity{ - // Name: to.Ptr("example-ipCommunity"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipCommunities"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity"), + // Name: to.Ptr("example-ipcommunity"), + // Type: to.Ptr("microsoft.managednetworkfabric/ipcommunities"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipcommunity"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:05:16.579Z"); return t}()), - // CreatedBy: to.Ptr("user@email.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:05:16.579Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUS"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key2814": to.Ptr(""), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.IPCommunityProperties{ - // Annotation: to.Ptr("annotationValue"), - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // CommunityMembers: []*string{ - // to.Ptr("1234:5678")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet), - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesLocalAS), - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesNoExport), - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesGShut)}, + // Annotation: to.Ptr("annotation"), + // IPCommunityRules: []*armmanagednetworkfabric.IPCommunityRule{ + // { + // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + // CommunityMembers: []*string{ + // to.Ptr("1:1")}, + // SequenceNumber: to.Ptr[int64](4155123341), + // WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ + // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet)}, + // }}, + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunities_Delete_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Delete_MaximumSet_Gen.json func ExampleIPCommunitiesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -204,7 +222,7 @@ func ExampleIPCommunitiesClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewIPCommunitiesClient().BeginDelete(ctx, "resourceGroupName", "IpCommunityList1", nil) + poller, err := clientFactory.NewIPCommunitiesClient().BeginDelete(ctx, "example-rg", "example-ipcommunity", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -214,7 +232,7 @@ func ExampleIPCommunitiesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunities_ListByResourceGroup_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_ListByResourceGroup_MaximumSet_Gen.json func ExampleIPCommunitiesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -225,7 +243,7 @@ func ExampleIPCommunitiesClient_NewListByResourceGroupPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewIPCommunitiesClient().NewListByResourceGroupPager("resourceGroupName", nil) + pager := clientFactory.NewIPCommunitiesClient().NewListByResourceGroupPager("example-rg", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -239,39 +257,42 @@ func ExampleIPCommunitiesClient_NewListByResourceGroupPager() { // page.IPCommunitiesListResult = armmanagednetworkfabric.IPCommunitiesListResult{ // Value: []*armmanagednetworkfabric.IPCommunity{ // { - // Name: to.Ptr("example-ipCommunity"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipCommunities"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity"), + // Name: to.Ptr("example-ipcommunity"), + // Type: to.Ptr("microsoft.managednetworkfabric/ipcommunities"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipcommunity"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:05:16.579Z"); return t}()), - // CreatedBy: to.Ptr("user@email.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:05:16.579Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUS"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key2814": to.Ptr(""), + // "keyId": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.IPCommunityProperties{ - // Annotation: to.Ptr("annotationValue"), - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // CommunityMembers: []*string{ - // to.Ptr("1234:5678")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet), - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesLocalAS), - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesNoExport), - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesGShut)}, + // Annotation: to.Ptr("annotation"), + // IPCommunityRules: []*armmanagednetworkfabric.IPCommunityRule{ + // { + // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + // CommunityMembers: []*string{ + // to.Ptr("1:1")}, + // SequenceNumber: to.Ptr[int64](4155123341), + // WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ + // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet)}, + // }}, + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunities_ListBySubscription_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_ListBySubscription_MaximumSet_Gen.json func ExampleIPCommunitiesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -296,32 +317,35 @@ func ExampleIPCommunitiesClient_NewListBySubscriptionPager() { // page.IPCommunitiesListResult = armmanagednetworkfabric.IPCommunitiesListResult{ // Value: []*armmanagednetworkfabric.IPCommunity{ // { - // Name: to.Ptr("example-ipCommunity"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipCommunities"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity"), + // Name: to.Ptr("example-ipcommunity"), + // Type: to.Ptr("microsoft.managednetworkfabric/ipcommunities"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipcommunity"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:05:16.579Z"); return t}()), - // CreatedBy: to.Ptr("user@email.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:05:16.579Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUS"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key2814": to.Ptr(""), + // "keyId": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.IPCommunityProperties{ - // Annotation: to.Ptr("annotationValue"), - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // CommunityMembers: []*string{ - // to.Ptr("1234:5678")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet), - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesLocalAS), - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesNoExport), - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesGShut)}, + // Annotation: to.Ptr("annotation"), + // IPCommunityRules: []*armmanagednetworkfabric.IPCommunityRule{ + // { + // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + // CommunityMembers: []*string{ + // to.Ptr("1:1")}, + // SequenceNumber: to.Ptr[int64](4155123341), + // WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ + // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet)}, + // }}, + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // }}, // } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipextendedcommunities_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipextendedcommunities_client.go index 4e99065026a1..c85e8b13eb41 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipextendedcommunities_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipextendedcommunities_client.go @@ -29,7 +29,7 @@ type IPExtendedCommunitiesClient struct { } // NewIPExtendedCommunitiesClient creates a new instance of IPExtendedCommunitiesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewIPExtendedCommunitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IPExtendedCommunitiesClient, error) { @@ -47,9 +47,9 @@ func NewIPExtendedCommunitiesClient(subscriptionID string, credential azcore.Tok // BeginCreate - Implements IP Extended Community PUT method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - ipExtendedCommunityName - Name of the IP Extended Community +// - ipExtendedCommunityName - Name of the IP Extended Community. // - body - Request payload. // - options - IPExtendedCommunitiesClientBeginCreateOptions contains the optional parameters for the IPExtendedCommunitiesClient.BeginCreate // method. @@ -70,7 +70,7 @@ func (client *IPExtendedCommunitiesClient) BeginCreate(ctx context.Context, reso // Create - Implements IP Extended Community PUT method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *IPExtendedCommunitiesClient) create(ctx context.Context, resourceGroupName string, ipExtendedCommunityName string, body IPExtendedCommunity, options *IPExtendedCommunitiesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, ipExtendedCommunityName, body, options) if err != nil { @@ -89,9 +89,6 @@ func (client *IPExtendedCommunitiesClient) create(ctx context.Context, resourceG // createCreateRequest creates the Create request. func (client *IPExtendedCommunitiesClient) createCreateRequest(ctx context.Context, resourceGroupName string, ipExtendedCommunityName string, body IPExtendedCommunity, options *IPExtendedCommunitiesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -106,7 +103,7 @@ func (client *IPExtendedCommunitiesClient) createCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -115,9 +112,9 @@ func (client *IPExtendedCommunitiesClient) createCreateRequest(ctx context.Conte // BeginDelete - Implements IP Extended Community DELETE method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - ipExtendedCommunityName - Name of the IP Extended Community +// - ipExtendedCommunityName - Name of the IP Extended Community. // - options - IPExtendedCommunitiesClientBeginDeleteOptions contains the optional parameters for the IPExtendedCommunitiesClient.BeginDelete // method. func (client *IPExtendedCommunitiesClient) BeginDelete(ctx context.Context, resourceGroupName string, ipExtendedCommunityName string, options *IPExtendedCommunitiesClientBeginDeleteOptions) (*runtime.Poller[IPExtendedCommunitiesClientDeleteResponse], error) { @@ -137,7 +134,7 @@ func (client *IPExtendedCommunitiesClient) BeginDelete(ctx context.Context, reso // Delete - Implements IP Extended Community DELETE method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *IPExtendedCommunitiesClient) deleteOperation(ctx context.Context, resourceGroupName string, ipExtendedCommunityName string, options *IPExtendedCommunitiesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, ipExtendedCommunityName, options) if err != nil { @@ -147,7 +144,7 @@ func (client *IPExtendedCommunitiesClient) deleteOperation(ctx context.Context, if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -156,9 +153,6 @@ func (client *IPExtendedCommunitiesClient) deleteOperation(ctx context.Context, // deleteCreateRequest creates the Delete request. func (client *IPExtendedCommunitiesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ipExtendedCommunityName string, options *IPExtendedCommunitiesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -173,7 +167,7 @@ func (client *IPExtendedCommunitiesClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,9 +176,9 @@ func (client *IPExtendedCommunitiesClient) deleteCreateRequest(ctx context.Conte // Get - Implements IP Extended Community GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - ipExtendedCommunityName - Name of the IP Extended Community +// - ipExtendedCommunityName - Name of the IP Extended Community. // - options - IPExtendedCommunitiesClientGetOptions contains the optional parameters for the IPExtendedCommunitiesClient.Get // method. func (client *IPExtendedCommunitiesClient) Get(ctx context.Context, resourceGroupName string, ipExtendedCommunityName string, options *IPExtendedCommunitiesClientGetOptions) (IPExtendedCommunitiesClientGetResponse, error) { @@ -205,9 +199,6 @@ func (client *IPExtendedCommunitiesClient) Get(ctx context.Context, resourceGrou // getCreateRequest creates the Get request. func (client *IPExtendedCommunitiesClient) getCreateRequest(ctx context.Context, resourceGroupName string, ipExtendedCommunityName string, options *IPExtendedCommunitiesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -222,7 +213,7 @@ func (client *IPExtendedCommunitiesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -239,7 +230,7 @@ func (client *IPExtendedCommunitiesClient) getHandleResponse(resp *http.Response // NewListByResourceGroupPager - Implements IpExtendedCommunities list by resource group GET method. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - IPExtendedCommunitiesClientListByResourceGroupOptions contains the optional parameters for the IPExtendedCommunitiesClient.NewListByResourceGroupPager // method. @@ -274,9 +265,6 @@ func (client *IPExtendedCommunitiesClient) NewListByResourceGroupPager(resourceG // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *IPExtendedCommunitiesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *IPExtendedCommunitiesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -287,7 +275,7 @@ func (client *IPExtendedCommunitiesClient) listByResourceGroupCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -304,7 +292,7 @@ func (client *IPExtendedCommunitiesClient) listByResourceGroupHandleResponse(res // NewListBySubscriptionPager - Implements IpExtendedCommunities list by subscription GET method. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - options - IPExtendedCommunitiesClientListBySubscriptionOptions contains the optional parameters for the IPExtendedCommunitiesClient.NewListBySubscriptionPager // method. func (client *IPExtendedCommunitiesClient) NewListBySubscriptionPager(options *IPExtendedCommunitiesClientListBySubscriptionOptions) *runtime.Pager[IPExtendedCommunitiesClientListBySubscriptionResponse] { @@ -338,16 +326,13 @@ func (client *IPExtendedCommunitiesClient) NewListBySubscriptionPager(options *I // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *IPExtendedCommunitiesClient) listBySubscriptionCreateRequest(ctx context.Context, options *IPExtendedCommunitiesClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,9 +350,9 @@ func (client *IPExtendedCommunitiesClient) listBySubscriptionHandleResponse(resp // BeginUpdate - API to update certain properties of the IP Extended Community resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - ipExtendedCommunityName - Name of the IP Extended Community +// - ipExtendedCommunityName - Name of the IP Extended Community. // - body - IP Extended Community properties to update. // - options - IPExtendedCommunitiesClientBeginUpdateOptions contains the optional parameters for the IPExtendedCommunitiesClient.BeginUpdate // method. @@ -388,7 +373,7 @@ func (client *IPExtendedCommunitiesClient) BeginUpdate(ctx context.Context, reso // Update - API to update certain properties of the IP Extended Community resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *IPExtendedCommunitiesClient) update(ctx context.Context, resourceGroupName string, ipExtendedCommunityName string, body IPExtendedCommunityPatch, options *IPExtendedCommunitiesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, ipExtendedCommunityName, body, options) if err != nil { @@ -407,9 +392,6 @@ func (client *IPExtendedCommunitiesClient) update(ctx context.Context, resourceG // updateCreateRequest creates the Update request. func (client *IPExtendedCommunitiesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, ipExtendedCommunityName string, body IPExtendedCommunityPatch, options *IPExtendedCommunitiesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -424,7 +406,7 @@ func (client *IPExtendedCommunitiesClient) updateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipextendedcommunities_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipextendedcommunities_client_example_test.go index db6f9a8716db..eb83bd0fa5b3 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipextendedcommunities_client_example_test.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipextendedcommunities_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpExtendedCommunities_Create_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Create_MaximumSet_Gen.json func ExampleIPExtendedCommunitiesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,16 +29,20 @@ func ExampleIPExtendedCommunitiesClient_BeginCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewIPExtendedCommunitiesClient().BeginCreate(ctx, "rgIpExtendedCommunityLists", "example_ipExtendedCommunity", armmanagednetworkfabric.IPExtendedCommunity{ - Location: to.Ptr("EastUs"), + poller, err := clientFactory.NewIPExtendedCommunitiesClient().BeginCreate(ctx, "example-rg", "example-ipExtendedCommunity", armmanagednetworkfabric.IPExtendedCommunity{ + Location: to.Ptr("eastus"), Tags: map[string]*string{ - "key5054": to.Ptr("key"), + "keyID": to.Ptr("KeyValue"), }, Properties: &armmanagednetworkfabric.IPExtendedCommunityProperties{ - Annotation: to.Ptr("annotationValue"), - Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - RouteTargets: []*string{ - to.Ptr("1234:5678")}, + Annotation: to.Ptr("annotation"), + IPExtendedCommunityRules: []*armmanagednetworkfabric.IPExtendedCommunityRule{ + { + Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + RouteTargets: []*string{ + to.Ptr("1234:2345")}, + SequenceNumber: to.Ptr[int64](4155123341), + }}, }, }, nil) if err != nil { @@ -52,32 +56,38 @@ func ExampleIPExtendedCommunitiesClient_BeginCreate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.IPExtendedCommunity = armmanagednetworkfabric.IPExtendedCommunity{ - // Name: to.Ptr("example_ipExtendedCommunity"), + // Name: to.Ptr("example-ipExtendedCommunity"), // Type: to.Ptr("microsoft.managednetworkfabric/ipExtendedCommunities"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example_ipExtendedCommunity"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:44:01.092Z"); return t}()), - // CreatedBy: to.Ptr("User"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:44:01.092Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUs"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key5054": to.Ptr("key"), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.IPExtendedCommunityProperties{ - // Annotation: to.Ptr("annotationValue"), - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RouteTargets: []*string{ - // to.Ptr("1234:5678")}, + // Annotation: to.Ptr("annotation"), + // IPExtendedCommunityRules: []*armmanagednetworkfabric.IPExtendedCommunityRule{ + // { + // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + // RouteTargets: []*string{ + // to.Ptr("1234:2345")}, + // SequenceNumber: to.Ptr[int64](4155123341), + // }}, + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpExtendedCommunities_Get_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Get_MaximumSet_Gen.json func ExampleIPExtendedCommunitiesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -88,7 +98,7 @@ func ExampleIPExtendedCommunitiesClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewIPExtendedCommunitiesClient().Get(ctx, "rgIpExtendedCommunityLists", "example_ipExtendedCommunity", nil) + res, err := clientFactory.NewIPExtendedCommunitiesClient().Get(ctx, "example-rg", "example-ipExtendedCommunity", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -96,32 +106,38 @@ func ExampleIPExtendedCommunitiesClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.IPExtendedCommunity = armmanagednetworkfabric.IPExtendedCommunity{ - // Name: to.Ptr("example_ipExtendedCommunity"), + // Name: to.Ptr("example-ipExtendedCommunity"), // Type: to.Ptr("microsoft.managednetworkfabric/ipExtendedCommunities"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example_ipExtendedCommunity"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:44:01.092Z"); return t}()), - // CreatedBy: to.Ptr("User"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:44:01.092Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUs"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key5054": to.Ptr("key"), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.IPExtendedCommunityProperties{ - // Annotation: to.Ptr("annotationValue"), - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RouteTargets: []*string{ - // to.Ptr("1234:5678")}, + // Annotation: to.Ptr("annotation"), + // IPExtendedCommunityRules: []*armmanagednetworkfabric.IPExtendedCommunityRule{ + // { + // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + // RouteTargets: []*string{ + // to.Ptr("1234:2345")}, + // SequenceNumber: to.Ptr[int64](4155123341), + // }}, + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpExtendedCommunities_Update_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Update_MaximumSet_Gen.json func ExampleIPExtendedCommunitiesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -132,9 +148,18 @@ func ExampleIPExtendedCommunitiesClient_BeginUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewIPExtendedCommunitiesClient().BeginUpdate(ctx, "rgIpExtendedCommunityLists", "example_ipExtendedCommunity", armmanagednetworkfabric.IPExtendedCommunityPatch{ + poller, err := clientFactory.NewIPExtendedCommunitiesClient().BeginUpdate(ctx, "example-rg", "example-ipExtendedCommunity", armmanagednetworkfabric.IPExtendedCommunityPatch{ Tags: map[string]*string{ - "key5054": to.Ptr("key1"), + "keyID": to.Ptr("KeyValue"), + }, + Properties: &armmanagednetworkfabric.IPExtendedCommunityPatchProperties{ + IPExtendedCommunityRules: []*armmanagednetworkfabric.IPExtendedCommunityRule{ + { + Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + RouteTargets: []*string{ + to.Ptr("1234:2345")}, + SequenceNumber: to.Ptr[int64](4155123341), + }}, }, }, nil) if err != nil { @@ -148,32 +173,38 @@ func ExampleIPExtendedCommunitiesClient_BeginUpdate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.IPExtendedCommunity = armmanagednetworkfabric.IPExtendedCommunity{ - // Name: to.Ptr("example_ipExtendedCommunity"), + // Name: to.Ptr("example-ipExtendedCommunity"), // Type: to.Ptr("microsoft.managednetworkfabric/ipExtendedCommunities"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example_ipExtendedCommunity"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:44:01.092Z"); return t}()), - // CreatedBy: to.Ptr("User"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:44:01.092Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUs"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key5054": to.Ptr("key"), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.IPExtendedCommunityProperties{ - // Annotation: to.Ptr("annotationValue"), - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RouteTargets: []*string{ - // to.Ptr("1234:5678")}, + // Annotation: to.Ptr("annotation"), + // IPExtendedCommunityRules: []*armmanagednetworkfabric.IPExtendedCommunityRule{ + // { + // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + // RouteTargets: []*string{ + // to.Ptr("1234:2345")}, + // SequenceNumber: to.Ptr[int64](4155123341), + // }}, + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpExtendedCommunities_Delete_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Delete_MaximumSet_Gen.json func ExampleIPExtendedCommunitiesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -184,7 +215,7 @@ func ExampleIPExtendedCommunitiesClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewIPExtendedCommunitiesClient().BeginDelete(ctx, "rgIpExtendedCommunityLists", "example_ipExtendedCommunity", nil) + poller, err := clientFactory.NewIPExtendedCommunitiesClient().BeginDelete(ctx, "example-rg", "example-ipExtendedCommunity", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -194,7 +225,7 @@ func ExampleIPExtendedCommunitiesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpExtendedCommunities_ListByResourceGroup_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_ListByResourceGroup_MaximumSet_Gen.json func ExampleIPExtendedCommunitiesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -205,7 +236,7 @@ func ExampleIPExtendedCommunitiesClient_NewListByResourceGroupPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewIPExtendedCommunitiesClient().NewListByResourceGroupPager("rgIpExtendedCommunityLists", nil) + pager := clientFactory.NewIPExtendedCommunitiesClient().NewListByResourceGroupPager("example-rg", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -219,34 +250,40 @@ func ExampleIPExtendedCommunitiesClient_NewListByResourceGroupPager() { // page.IPExtendedCommunityListResult = armmanagednetworkfabric.IPExtendedCommunityListResult{ // Value: []*armmanagednetworkfabric.IPExtendedCommunity{ // { - // Name: to.Ptr("example_ipExtendedCommunity"), + // Name: to.Ptr("example-ipExtendedCommunity"), // Type: to.Ptr("microsoft.managednetworkfabric/ipExtendedCommunities"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example_ipExtendedCommunity"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:44:01.092Z"); return t}()), - // CreatedBy: to.Ptr("User"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:44:01.092Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUs"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key5054": to.Ptr("key"), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.IPExtendedCommunityProperties{ - // Annotation: to.Ptr("annotationValue"), - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RouteTargets: []*string{ - // to.Ptr("1234:5678")}, + // Annotation: to.Ptr("annotation"), + // IPExtendedCommunityRules: []*armmanagednetworkfabric.IPExtendedCommunityRule{ + // { + // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + // RouteTargets: []*string{ + // to.Ptr("1234:2345")}, + // SequenceNumber: to.Ptr[int64](4155123341), + // }}, + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpExtendedCommunities_ListBySubscription_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_ListBySubscription_MaximumSet_Gen.json func ExampleIPExtendedCommunitiesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -271,27 +308,33 @@ func ExampleIPExtendedCommunitiesClient_NewListBySubscriptionPager() { // page.IPExtendedCommunityListResult = armmanagednetworkfabric.IPExtendedCommunityListResult{ // Value: []*armmanagednetworkfabric.IPExtendedCommunity{ // { - // Name: to.Ptr("example_ipExtendedCommunity"), + // Name: to.Ptr("example-ipExtendedCommunity"), // Type: to.Ptr("microsoft.managednetworkfabric/ipExtendedCommunities"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example_ipExtendedCommunity"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:44:01.092Z"); return t}()), - // CreatedBy: to.Ptr("User"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T14:44:01.092Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUs"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key5054": to.Ptr("key"), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.IPExtendedCommunityProperties{ - // Annotation: to.Ptr("annotationValue"), - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RouteTargets: []*string{ - // to.Ptr("1234:5678")}, + // Annotation: to.Ptr("annotation"), + // IPExtendedCommunityRules: []*armmanagednetworkfabric.IPExtendedCommunityRule{ + // { + // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + // RouteTargets: []*string{ + // to.Ptr("1234:2345")}, + // SequenceNumber: to.Ptr[int64](4155123341), + // }}, + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // }}, // } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipprefixes_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipprefixes_client.go index 6d4a063ac3a3..1803e80f9091 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipprefixes_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipprefixes_client.go @@ -29,7 +29,7 @@ type IPPrefixesClient struct { } // NewIPPrefixesClient creates a new instance of IPPrefixesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewIPPrefixesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IPPrefixesClient, error) { @@ -47,9 +47,9 @@ func NewIPPrefixesClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreate - Implements IP Prefix PUT method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - ipPrefixName - Name of the IP Prefix +// - ipPrefixName - Name of the IP Prefix. // - body - Request payload. // - options - IPPrefixesClientBeginCreateOptions contains the optional parameters for the IPPrefixesClient.BeginCreate method. func (client *IPPrefixesClient) BeginCreate(ctx context.Context, resourceGroupName string, ipPrefixName string, body IPPrefix, options *IPPrefixesClientBeginCreateOptions) (*runtime.Poller[IPPrefixesClientCreateResponse], error) { @@ -69,7 +69,7 @@ func (client *IPPrefixesClient) BeginCreate(ctx context.Context, resourceGroupNa // Create - Implements IP Prefix PUT method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *IPPrefixesClient) create(ctx context.Context, resourceGroupName string, ipPrefixName string, body IPPrefix, options *IPPrefixesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, ipPrefixName, body, options) if err != nil { @@ -88,9 +88,6 @@ func (client *IPPrefixesClient) create(ctx context.Context, resourceGroupName st // createCreateRequest creates the Create request. func (client *IPPrefixesClient) createCreateRequest(ctx context.Context, resourceGroupName string, ipPrefixName string, body IPPrefix, options *IPPrefixesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -105,7 +102,7 @@ func (client *IPPrefixesClient) createCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -114,9 +111,9 @@ func (client *IPPrefixesClient) createCreateRequest(ctx context.Context, resourc // BeginDelete - Implements IP Prefix DELETE method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - ipPrefixName - Name of the IP Prefix +// - ipPrefixName - Name of the IP Prefix. // - options - IPPrefixesClientBeginDeleteOptions contains the optional parameters for the IPPrefixesClient.BeginDelete method. func (client *IPPrefixesClient) BeginDelete(ctx context.Context, resourceGroupName string, ipPrefixName string, options *IPPrefixesClientBeginDeleteOptions) (*runtime.Poller[IPPrefixesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { @@ -135,7 +132,7 @@ func (client *IPPrefixesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Implements IP Prefix DELETE method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *IPPrefixesClient) deleteOperation(ctx context.Context, resourceGroupName string, ipPrefixName string, options *IPPrefixesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, ipPrefixName, options) if err != nil { @@ -145,7 +142,7 @@ func (client *IPPrefixesClient) deleteOperation(ctx context.Context, resourceGro if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -154,9 +151,6 @@ func (client *IPPrefixesClient) deleteOperation(ctx context.Context, resourceGro // deleteCreateRequest creates the Delete request. func (client *IPPrefixesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ipPrefixName string, options *IPPrefixesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -171,7 +165,7 @@ func (client *IPPrefixesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,9 +174,9 @@ func (client *IPPrefixesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Implements IP Prefix GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - ipPrefixName - Name of the IP Prefix +// - ipPrefixName - Name of the IP Prefix. // - options - IPPrefixesClientGetOptions contains the optional parameters for the IPPrefixesClient.Get method. func (client *IPPrefixesClient) Get(ctx context.Context, resourceGroupName string, ipPrefixName string, options *IPPrefixesClientGetOptions) (IPPrefixesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, ipPrefixName, options) @@ -202,9 +196,6 @@ func (client *IPPrefixesClient) Get(ctx context.Context, resourceGroupName strin // getCreateRequest creates the Get request. func (client *IPPrefixesClient) getCreateRequest(ctx context.Context, resourceGroupName string, ipPrefixName string, options *IPPrefixesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -219,7 +210,7 @@ func (client *IPPrefixesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -236,7 +227,7 @@ func (client *IPPrefixesClient) getHandleResponse(resp *http.Response) (IPPrefix // NewListByResourceGroupPager - Implements IpPrefixes list by resource group GET method. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - IPPrefixesClientListByResourceGroupOptions contains the optional parameters for the IPPrefixesClient.NewListByResourceGroupPager // method. @@ -271,9 +262,6 @@ func (client *IPPrefixesClient) NewListByResourceGroupPager(resourceGroupName st // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *IPPrefixesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *IPPrefixesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -284,7 +272,7 @@ func (client *IPPrefixesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -301,7 +289,7 @@ func (client *IPPrefixesClient) listByResourceGroupHandleResponse(resp *http.Res // NewListBySubscriptionPager - Implements IpPrefixes list by subscription GET method. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - options - IPPrefixesClientListBySubscriptionOptions contains the optional parameters for the IPPrefixesClient.NewListBySubscriptionPager // method. func (client *IPPrefixesClient) NewListBySubscriptionPager(options *IPPrefixesClientListBySubscriptionOptions) *runtime.Pager[IPPrefixesClientListBySubscriptionResponse] { @@ -335,16 +323,13 @@ func (client *IPPrefixesClient) NewListBySubscriptionPager(options *IPPrefixesCl // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *IPPrefixesClient) listBySubscriptionCreateRequest(ctx context.Context, options *IPPrefixesClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -362,9 +347,9 @@ func (client *IPPrefixesClient) listBySubscriptionHandleResponse(resp *http.Resp // BeginUpdate - API to update certain properties of the IP Prefix resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - ipPrefixName - Name of the IP Prefix +// - ipPrefixName - Name of the IP Prefix. // - body - IP Prefix properties to update. // - options - IPPrefixesClientBeginUpdateOptions contains the optional parameters for the IPPrefixesClient.BeginUpdate method. func (client *IPPrefixesClient) BeginUpdate(ctx context.Context, resourceGroupName string, ipPrefixName string, body IPPrefixPatch, options *IPPrefixesClientBeginUpdateOptions) (*runtime.Poller[IPPrefixesClientUpdateResponse], error) { @@ -384,7 +369,7 @@ func (client *IPPrefixesClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - API to update certain properties of the IP Prefix resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *IPPrefixesClient) update(ctx context.Context, resourceGroupName string, ipPrefixName string, body IPPrefixPatch, options *IPPrefixesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, ipPrefixName, body, options) if err != nil { @@ -403,9 +388,6 @@ func (client *IPPrefixesClient) update(ctx context.Context, resourceGroupName st // updateCreateRequest creates the Update request. func (client *IPPrefixesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, ipPrefixName string, body IPPrefixPatch, options *IPPrefixesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -420,7 +402,7 @@ func (client *IPPrefixesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipprefixes_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipprefixes_client_example_test.go index f22e3f24fcbb..f2664fe33ae7 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipprefixes_client_example_test.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipprefixes_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixes_Create_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Create_MaximumSet_Gen.json func ExampleIPPrefixesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,20 +29,20 @@ func ExampleIPPrefixesClient_BeginCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewIPPrefixesClient().BeginCreate(ctx, "resourcegroupname", "example-ipPrefix", armmanagednetworkfabric.IPPrefix{ - Location: to.Ptr("EastUS"), + poller, err := clientFactory.NewIPPrefixesClient().BeginCreate(ctx, "example-rg", "example-ipPrefix", armmanagednetworkfabric.IPPrefix{ + Location: to.Ptr("eastus"), Tags: map[string]*string{ - "key6404": to.Ptr(""), + "keyID": to.Ptr("KeyValue"), }, Properties: &armmanagednetworkfabric.IPPrefixProperties{ - Annotation: to.Ptr("annotationValue"), - IPPrefixRules: []*armmanagednetworkfabric.IPPrefixPropertiesIPPrefixRulesItem{ + Annotation: to.Ptr("annotation"), + IPPrefixRules: []*armmanagednetworkfabric.IPPrefixRule{ { Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - Condition: to.Ptr(armmanagednetworkfabric.ConditionEqualTo), - NetworkPrefix: to.Ptr("1.1.1.0/24"), - SequenceNumber: to.Ptr[int64](12), - SubnetMaskLength: to.Ptr[int32](28), + Condition: to.Ptr(armmanagednetworkfabric.ConditionGreaterThanOrEqualTo), + NetworkPrefix: to.Ptr("10.10.10.10/30"), + SequenceNumber: to.Ptr[int64](4155123341), + SubnetMaskLength: to.Ptr("10"), }}, }, }, nil) @@ -59,35 +59,37 @@ func ExampleIPPrefixesClient_BeginCreate() { // res.IPPrefix = armmanagednetworkfabric.IPPrefix{ // Name: to.Ptr("example-ipPrefix"), // Type: to.Ptr("microsoft.managednetworkfabric/ipPrefixes"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T15:43:02.233Z"); return t}()), - // CreatedBy: to.Ptr("User"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.656Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T15:43:02.233Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.657Z"); return t}()), // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUS"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key6404": to.Ptr(""), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.IPPrefixProperties{ - // Annotation: to.Ptr("annotationValue"), - // IPPrefixRules: []*armmanagednetworkfabric.IPPrefixPropertiesIPPrefixRulesItem{ + // Annotation: to.Ptr("annotation"), + // IPPrefixRules: []*armmanagednetworkfabric.IPPrefixRule{ // { // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // Condition: to.Ptr(armmanagednetworkfabric.ConditionEqualTo), - // NetworkPrefix: to.Ptr("1.1.1.0/24"), - // SequenceNumber: to.Ptr[int64](12), - // SubnetMaskLength: to.Ptr[int32](28), + // Condition: to.Ptr(armmanagednetworkfabric.ConditionGreaterThanOrEqualTo), + // NetworkPrefix: to.Ptr("10.10.10.10/30"), + // SequenceNumber: to.Ptr[int64](4155123341), + // SubnetMaskLength: to.Ptr("10"), // }}, + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixes_Get_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Get_MaximumSet_Gen.json func ExampleIPPrefixesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -98,7 +100,7 @@ func ExampleIPPrefixesClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewIPPrefixesClient().Get(ctx, "resourcegroupname", "example-ipPrefix", nil) + res, err := clientFactory.NewIPPrefixesClient().Get(ctx, "example-rg", "example-ipPrefix", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -108,35 +110,37 @@ func ExampleIPPrefixesClient_Get() { // res.IPPrefix = armmanagednetworkfabric.IPPrefix{ // Name: to.Ptr("example-ipPrefix"), // Type: to.Ptr("microsoft.managednetworkfabric/ipPrefixes"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T15:43:02.233Z"); return t}()), - // CreatedBy: to.Ptr("User"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.656Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T15:43:02.233Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.657Z"); return t}()), // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUS"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key6404": to.Ptr(""), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.IPPrefixProperties{ - // Annotation: to.Ptr("annotationValue"), - // IPPrefixRules: []*armmanagednetworkfabric.IPPrefixPropertiesIPPrefixRulesItem{ + // Annotation: to.Ptr("annotation"), + // IPPrefixRules: []*armmanagednetworkfabric.IPPrefixRule{ // { // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // Condition: to.Ptr(armmanagednetworkfabric.ConditionEqualTo), - // NetworkPrefix: to.Ptr("1.1.1.0/24"), - // SequenceNumber: to.Ptr[int64](12), - // SubnetMaskLength: to.Ptr[int32](28), + // Condition: to.Ptr(armmanagednetworkfabric.ConditionGreaterThanOrEqualTo), + // NetworkPrefix: to.Ptr("10.10.10.10/30"), + // SequenceNumber: to.Ptr[int64](4155123341), + // SubnetMaskLength: to.Ptr("10"), // }}, + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixes_Update_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Update_MaximumSet_Gen.json func ExampleIPPrefixesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -147,9 +151,20 @@ func ExampleIPPrefixesClient_BeginUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewIPPrefixesClient().BeginUpdate(ctx, "resourcegroupname", "example-ipPrefix", armmanagednetworkfabric.IPPrefixPatch{ + poller, err := clientFactory.NewIPPrefixesClient().BeginUpdate(ctx, "example-rg", "example-ipPrefix", armmanagednetworkfabric.IPPrefixPatch{ Tags: map[string]*string{ - "key3127": to.Ptr("key"), + "keyID": to.Ptr("KeyValue"), + }, + Properties: &armmanagednetworkfabric.IPPrefixPatchProperties{ + Annotation: to.Ptr("annotation"), + IPPrefixRules: []*armmanagednetworkfabric.IPPrefixRule{ + { + Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + Condition: to.Ptr(armmanagednetworkfabric.ConditionGreaterThanOrEqualTo), + NetworkPrefix: to.Ptr("10.10.10.10/30"), + SequenceNumber: to.Ptr[int64](4155123341), + SubnetMaskLength: to.Ptr("10"), + }}, }, }, nil) if err != nil { @@ -165,35 +180,37 @@ func ExampleIPPrefixesClient_BeginUpdate() { // res.IPPrefix = armmanagednetworkfabric.IPPrefix{ // Name: to.Ptr("example-ipPrefix"), // Type: to.Ptr("microsoft.managednetworkfabric/ipPrefixes"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T15:43:02.233Z"); return t}()), - // CreatedBy: to.Ptr("User"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.656Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T15:43:02.233Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.657Z"); return t}()), // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUS"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key6404": to.Ptr(""), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.IPPrefixProperties{ - // Annotation: to.Ptr("annotationValue"), - // IPPrefixRules: []*armmanagednetworkfabric.IPPrefixPropertiesIPPrefixRulesItem{ + // Annotation: to.Ptr("annotation"), + // IPPrefixRules: []*armmanagednetworkfabric.IPPrefixRule{ // { // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // Condition: to.Ptr(armmanagednetworkfabric.ConditionEqualTo), - // NetworkPrefix: to.Ptr("1.1.1.0/24"), - // SequenceNumber: to.Ptr[int64](12), - // SubnetMaskLength: to.Ptr[int32](28), + // Condition: to.Ptr(armmanagednetworkfabric.ConditionGreaterThanOrEqualTo), + // NetworkPrefix: to.Ptr("10.10.10.10/30"), + // SequenceNumber: to.Ptr[int64](4155123341), + // SubnetMaskLength: to.Ptr("10"), // }}, + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixes_Delete_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Delete_MaximumSet_Gen.json func ExampleIPPrefixesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -204,7 +221,7 @@ func ExampleIPPrefixesClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewIPPrefixesClient().BeginDelete(ctx, "rgIpPrefixLists", "example-ipPrefix", nil) + poller, err := clientFactory.NewIPPrefixesClient().BeginDelete(ctx, "example-rg", "example-ipPrefix", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -214,7 +231,7 @@ func ExampleIPPrefixesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixes_ListByResourceGroup_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_ListByResourceGroup_MaximumSet_Gen.json func ExampleIPPrefixesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -225,7 +242,7 @@ func ExampleIPPrefixesClient_NewListByResourceGroupPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewIPPrefixesClient().NewListByResourceGroupPager("resourcegroupname", nil) + pager := clientFactory.NewIPPrefixesClient().NewListByResourceGroupPager("example-rg", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -241,29 +258,31 @@ func ExampleIPPrefixesClient_NewListByResourceGroupPager() { // { // Name: to.Ptr("example-ipPrefix"), // Type: to.Ptr("microsoft.managednetworkfabric/ipPrefixes"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T15:43:02.233Z"); return t}()), - // CreatedBy: to.Ptr("User"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.656Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T15:43:02.233Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.657Z"); return t}()), // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUS"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key6404": to.Ptr(""), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.IPPrefixProperties{ - // Annotation: to.Ptr("annotationValue"), - // IPPrefixRules: []*armmanagednetworkfabric.IPPrefixPropertiesIPPrefixRulesItem{ + // Annotation: to.Ptr("annotation"), + // IPPrefixRules: []*armmanagednetworkfabric.IPPrefixRule{ // { // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // Condition: to.Ptr(armmanagednetworkfabric.ConditionEqualTo), - // NetworkPrefix: to.Ptr("1.1.1.0/24"), - // SequenceNumber: to.Ptr[int64](12), - // SubnetMaskLength: to.Ptr[int32](28), + // Condition: to.Ptr(armmanagednetworkfabric.ConditionGreaterThanOrEqualTo), + // NetworkPrefix: to.Ptr("10.10.10.10/30"), + // SequenceNumber: to.Ptr[int64](4155123341), + // SubnetMaskLength: to.Ptr("10"), // }}, + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // }}, @@ -271,7 +290,7 @@ func ExampleIPPrefixesClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixes_ListBySubscription_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_ListBySubscription_MaximumSet_Gen.json func ExampleIPPrefixesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -298,29 +317,31 @@ func ExampleIPPrefixesClient_NewListBySubscriptionPager() { // { // Name: to.Ptr("example-ipPrefix"), // Type: to.Ptr("microsoft.managednetworkfabric/ipPrefixes"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T15:43:02.233Z"); return t}()), - // CreatedBy: to.Ptr("User"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.656Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T15:43:02.233Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.657Z"); return t}()), // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUS"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key6404": to.Ptr(""), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.IPPrefixProperties{ - // Annotation: to.Ptr("annotationValue"), - // IPPrefixRules: []*armmanagednetworkfabric.IPPrefixPropertiesIPPrefixRulesItem{ + // Annotation: to.Ptr("annotation"), + // IPPrefixRules: []*armmanagednetworkfabric.IPPrefixRule{ // { // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // Condition: to.Ptr(armmanagednetworkfabric.ConditionEqualTo), - // NetworkPrefix: to.Ptr("1.1.1.0/24"), - // SequenceNumber: to.Ptr[int64](12), - // SubnetMaskLength: to.Ptr[int32](28), + // Condition: to.Ptr(armmanagednetworkfabric.ConditionGreaterThanOrEqualTo), + // NetworkPrefix: to.Ptr("10.10.10.10/30"), + // SequenceNumber: to.Ptr[int64](4155123341), + // SubnetMaskLength: to.Ptr("10"), // }}, + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // }}, diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l2isolationdomains_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l2isolationdomains_client.go index 11dde1f8bb46..4e577ea89b5f 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l2isolationdomains_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l2isolationdomains_client.go @@ -29,7 +29,7 @@ type L2IsolationDomainsClient struct { } // NewL2IsolationDomainsClient creates a new instance of L2IsolationDomainsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewL2IsolationDomainsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*L2IsolationDomainsClient, error) { @@ -44,35 +44,34 @@ func NewL2IsolationDomainsClient(subscriptionID string, credential azcore.TokenC return client, nil } -// BeginClearArpTable - Clears ARP tables for this Isolation Domain. +// BeginCommitConfiguration - Commits the configuration of the given resources. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l2IsolationDomainName - Name of the L2IsolationDomain. -// - body - Request payload. -// - options - L2IsolationDomainsClientBeginClearArpTableOptions contains the optional parameters for the L2IsolationDomainsClient.BeginClearArpTable +// - l2IsolationDomainName - Name of the L2 Isolation Domain. +// - options - L2IsolationDomainsClientBeginCommitConfigurationOptions contains the optional parameters for the L2IsolationDomainsClient.BeginCommitConfiguration // method. -func (client *L2IsolationDomainsClient) BeginClearArpTable(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, body EnableDisableOnResources, options *L2IsolationDomainsClientBeginClearArpTableOptions) (*runtime.Poller[L2IsolationDomainsClientClearArpTableResponse], error) { +func (client *L2IsolationDomainsClient) BeginCommitConfiguration(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, options *L2IsolationDomainsClientBeginCommitConfigurationOptions) (*runtime.Poller[L2IsolationDomainsClientCommitConfigurationResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.clearArpTable(ctx, resourceGroupName, l2IsolationDomainName, body, options) + resp, err := client.commitConfiguration(ctx, resourceGroupName, l2IsolationDomainName, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L2IsolationDomainsClientClearArpTableResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L2IsolationDomainsClientCommitConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[L2IsolationDomainsClientClearArpTableResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken[L2IsolationDomainsClientCommitConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } -// ClearArpTable - Clears ARP tables for this Isolation Domain. +// CommitConfiguration - Commits the configuration of the given resources. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview -func (client *L2IsolationDomainsClient) clearArpTable(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, body EnableDisableOnResources, options *L2IsolationDomainsClientBeginClearArpTableOptions) (*http.Response, error) { - req, err := client.clearArpTableCreateRequest(ctx, resourceGroupName, l2IsolationDomainName, body, options) +// Generated from API version 2023-06-15 +func (client *L2IsolationDomainsClient) commitConfiguration(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, options *L2IsolationDomainsClientBeginCommitConfigurationOptions) (*http.Response, error) { + req, err := client.commitConfigurationCreateRequest(ctx, resourceGroupName, l2IsolationDomainName, options) if err != nil { return nil, err } @@ -80,86 +79,15 @@ func (client *L2IsolationDomainsClient) clearArpTable(ctx context.Context, resou if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// clearArpTableCreateRequest creates the ClearArpTable request. -func (client *L2IsolationDomainsClient) clearArpTableCreateRequest(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, body EnableDisableOnResources, options *L2IsolationDomainsClientBeginClearArpTableOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/clearArpTable" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if l2IsolationDomainName == "" { - return nil, errors.New("parameter l2IsolationDomainName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{l2IsolationDomainName}", url.PathEscape(l2IsolationDomainName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) -} - -// BeginClearNeighborTable - Clears IPv6 neighbors for this Isolation Domain. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l2IsolationDomainName - Name of the L2IsolationDomain. -// - body - Request payload. -// - options - L2IsolationDomainsClientBeginClearNeighborTableOptions contains the optional parameters for the L2IsolationDomainsClient.BeginClearNeighborTable -// method. -func (client *L2IsolationDomainsClient) BeginClearNeighborTable(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, body EnableDisableOnResources, options *L2IsolationDomainsClientBeginClearNeighborTableOptions) (*runtime.Poller[L2IsolationDomainsClientClearNeighborTableResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.clearNeighborTable(ctx, resourceGroupName, l2IsolationDomainName, body, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L2IsolationDomainsClientClearNeighborTableResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[L2IsolationDomainsClientClearNeighborTableResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// ClearNeighborTable - Clears IPv6 neighbors for this Isolation Domain. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -func (client *L2IsolationDomainsClient) clearNeighborTable(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, body EnableDisableOnResources, options *L2IsolationDomainsClientBeginClearNeighborTableOptions) (*http.Response, error) { - req, err := client.clearNeighborTableCreateRequest(ctx, resourceGroupName, l2IsolationDomainName, body, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil } -// clearNeighborTableCreateRequest creates the ClearNeighborTable request. -func (client *L2IsolationDomainsClient) clearNeighborTableCreateRequest(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, body EnableDisableOnResources, options *L2IsolationDomainsClientBeginClearNeighborTableOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/clearNeighborTable" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } +// commitConfigurationCreateRequest creates the CommitConfiguration request. +func (client *L2IsolationDomainsClient) commitConfigurationCreateRequest(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, options *L2IsolationDomainsClientBeginCommitConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/commitConfiguration" urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -174,19 +102,19 @@ func (client *L2IsolationDomainsClient) clearNeighborTableCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + return req, nil } // BeginCreate - 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. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l2IsolationDomainName - Name of the L2 Isolation Domain +// - l2IsolationDomainName - Name of the L2 Isolation Domain. // - body - Request payload. // - options - L2IsolationDomainsClientBeginCreateOptions contains the optional parameters for the L2IsolationDomainsClient.BeginCreate // method. @@ -208,7 +136,7 @@ func (client *L2IsolationDomainsClient) BeginCreate(ctx context.Context, resourc // applied on the devices only after the isolation domain is enabled. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *L2IsolationDomainsClient) create(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, body L2IsolationDomain, options *L2IsolationDomainsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, l2IsolationDomainName, body, options) if err != nil { @@ -227,9 +155,6 @@ func (client *L2IsolationDomainsClient) create(ctx context.Context, resourceGrou // createCreateRequest creates the Create request. func (client *L2IsolationDomainsClient) createCreateRequest(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, body L2IsolationDomain, options *L2IsolationDomainsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -244,7 +169,7 @@ func (client *L2IsolationDomainsClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -253,9 +178,9 @@ func (client *L2IsolationDomainsClient) createCreateRequest(ctx context.Context, // BeginDelete - Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l2IsolationDomainName - Name of the L2 Isolation Domain +// - l2IsolationDomainName - Name of the L2 Isolation Domain. // - options - L2IsolationDomainsClientBeginDeleteOptions contains the optional parameters for the L2IsolationDomainsClient.BeginDelete // method. func (client *L2IsolationDomainsClient) BeginDelete(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, options *L2IsolationDomainsClientBeginDeleteOptions) (*runtime.Poller[L2IsolationDomainsClientDeleteResponse], error) { @@ -275,7 +200,7 @@ func (client *L2IsolationDomainsClient) BeginDelete(ctx context.Context, resourc // Delete - Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *L2IsolationDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, options *L2IsolationDomainsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, l2IsolationDomainName, options) if err != nil { @@ -285,7 +210,7 @@ func (client *L2IsolationDomainsClient) deleteOperation(ctx context.Context, res if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -294,9 +219,6 @@ func (client *L2IsolationDomainsClient) deleteOperation(ctx context.Context, res // deleteCreateRequest creates the Delete request. func (client *L2IsolationDomainsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, options *L2IsolationDomainsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -311,7 +233,7 @@ func (client *L2IsolationDomainsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -320,9 +242,9 @@ func (client *L2IsolationDomainsClient) deleteCreateRequest(ctx context.Context, // Get - Implements L2 Isolation Domain GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l2IsolationDomainName - Name of the L2 Isolation Domain +// - l2IsolationDomainName - Name of the L2 Isolation Domain. // - options - L2IsolationDomainsClientGetOptions contains the optional parameters for the L2IsolationDomainsClient.Get method. func (client *L2IsolationDomainsClient) Get(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, options *L2IsolationDomainsClientGetOptions) (L2IsolationDomainsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, l2IsolationDomainName, options) @@ -342,9 +264,6 @@ func (client *L2IsolationDomainsClient) Get(ctx context.Context, resourceGroupNa // getCreateRequest creates the Get request. func (client *L2IsolationDomainsClient) getCreateRequest(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, options *L2IsolationDomainsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -359,7 +278,7 @@ func (client *L2IsolationDomainsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -374,76 +293,9 @@ func (client *L2IsolationDomainsClient) getHandleResponse(resp *http.Response) ( return result, nil } -// BeginGetArpEntries - Clears IPv6 neighbors for this Isolation Domain. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l2IsolationDomainName - Name of the L2IsolationDomain. -// - options - L2IsolationDomainsClientBeginGetArpEntriesOptions contains the optional parameters for the L2IsolationDomainsClient.BeginGetArpEntries -// method. -func (client *L2IsolationDomainsClient) BeginGetArpEntries(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, options *L2IsolationDomainsClientBeginGetArpEntriesOptions) (*runtime.Poller[L2IsolationDomainsClientGetArpEntriesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getArpEntries(ctx, resourceGroupName, l2IsolationDomainName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L2IsolationDomainsClientGetArpEntriesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[L2IsolationDomainsClientGetArpEntriesResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// GetArpEntries - Clears IPv6 neighbors for this Isolation Domain. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -func (client *L2IsolationDomainsClient) getArpEntries(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, options *L2IsolationDomainsClientBeginGetArpEntriesOptions) (*http.Response, error) { - req, err := client.getArpEntriesCreateRequest(ctx, resourceGroupName, l2IsolationDomainName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getArpEntriesCreateRequest creates the GetArpEntries request. -func (client *L2IsolationDomainsClient) getArpEntriesCreateRequest(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, options *L2IsolationDomainsClientBeginGetArpEntriesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/getArpEntries" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if l2IsolationDomainName == "" { - return nil, errors.New("parameter l2IsolationDomainName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{l2IsolationDomainName}", url.PathEscape(l2IsolationDomainName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - // NewListByResourceGroupPager - Displays L2IsolationDomains list by resource group GET method. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - L2IsolationDomainsClientListByResourceGroupOptions contains the optional parameters for the L2IsolationDomainsClient.NewListByResourceGroupPager // method. @@ -478,9 +330,6 @@ func (client *L2IsolationDomainsClient) NewListByResourceGroupPager(resourceGrou // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *L2IsolationDomainsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *L2IsolationDomainsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -491,7 +340,7 @@ func (client *L2IsolationDomainsClient) listByResourceGroupCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -508,7 +357,7 @@ func (client *L2IsolationDomainsClient) listByResourceGroupHandleResponse(resp * // NewListBySubscriptionPager - Displays L2IsolationDomains list by subscription GET method. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - options - L2IsolationDomainsClientListBySubscriptionOptions contains the optional parameters for the L2IsolationDomainsClient.NewListBySubscriptionPager // method. func (client *L2IsolationDomainsClient) NewListBySubscriptionPager(options *L2IsolationDomainsClientListBySubscriptionOptions) *runtime.Pager[L2IsolationDomainsClientListBySubscriptionResponse] { @@ -542,16 +391,13 @@ func (client *L2IsolationDomainsClient) NewListBySubscriptionPager(options *L2Is // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *L2IsolationDomainsClient) listBySubscriptionCreateRequest(ctx context.Context, options *L2IsolationDomainsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -569,9 +415,9 @@ func (client *L2IsolationDomainsClient) listBySubscriptionHandleResponse(resp *h // BeginUpdate - API to update certain properties of the L2 Isolation Domain resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l2IsolationDomainName - Name of the L2 Isolation Domain +// - l2IsolationDomainName - Name of the L2 Isolation Domain. // - body - API to update certain properties of the L2 Isolation Domain resource.. // - options - L2IsolationDomainsClientBeginUpdateOptions contains the optional parameters for the L2IsolationDomainsClient.BeginUpdate // method. @@ -592,7 +438,7 @@ func (client *L2IsolationDomainsClient) BeginUpdate(ctx context.Context, resourc // Update - API to update certain properties of the L2 Isolation Domain resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *L2IsolationDomainsClient) update(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, body L2IsolationDomainPatch, options *L2IsolationDomainsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, l2IsolationDomainName, body, options) if err != nil { @@ -611,9 +457,6 @@ func (client *L2IsolationDomainsClient) update(ctx context.Context, resourceGrou // updateCreateRequest creates the Update request. func (client *L2IsolationDomainsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, body L2IsolationDomainPatch, options *L2IsolationDomainsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -628,7 +471,7 @@ func (client *L2IsolationDomainsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -637,9 +480,9 @@ func (client *L2IsolationDomainsClient) updateCreateRequest(ctx context.Context, // BeginUpdateAdministrativeState - Enables isolation domain across the fabric or on specified racks. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l2IsolationDomainName - Name of the L2IsolationDomain. +// - l2IsolationDomainName - Name of the L2 Isolation Domain. // - body - Request payload. // - options - L2IsolationDomainsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the L2IsolationDomainsClient.BeginUpdateAdministrativeState // method. @@ -660,7 +503,7 @@ func (client *L2IsolationDomainsClient) BeginUpdateAdministrativeState(ctx conte // UpdateAdministrativeState - Enables isolation domain across the fabric or on specified racks. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *L2IsolationDomainsClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, body UpdateAdministrativeState, options *L2IsolationDomainsClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, l2IsolationDomainName, body, options) if err != nil { @@ -670,7 +513,7 @@ func (client *L2IsolationDomainsClient) updateAdministrativeState(ctx context.Co if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -679,9 +522,6 @@ func (client *L2IsolationDomainsClient) updateAdministrativeState(ctx context.Co // updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. func (client *L2IsolationDomainsClient) updateAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, body UpdateAdministrativeState, options *L2IsolationDomainsClientBeginUpdateAdministrativeStateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/updateAdministrativeState" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -696,8 +536,72 @@ func (client *L2IsolationDomainsClient) updateAdministrativeStateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) } + +// BeginValidateConfiguration - Validates the configuration of the resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - l2IsolationDomainName - Name of the L2 Isolation Domain. +// - options - L2IsolationDomainsClientBeginValidateConfigurationOptions contains the optional parameters for the L2IsolationDomainsClient.BeginValidateConfiguration +// method. +func (client *L2IsolationDomainsClient) BeginValidateConfiguration(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, options *L2IsolationDomainsClientBeginValidateConfigurationOptions) (*runtime.Poller[L2IsolationDomainsClientValidateConfigurationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.validateConfiguration(ctx, resourceGroupName, l2IsolationDomainName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L2IsolationDomainsClientValidateConfigurationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[L2IsolationDomainsClientValidateConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ValidateConfiguration - Validates the configuration of the resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *L2IsolationDomainsClient) validateConfiguration(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, options *L2IsolationDomainsClientBeginValidateConfigurationOptions) (*http.Response, error) { + req, err := client.validateConfigurationCreateRequest(ctx, resourceGroupName, l2IsolationDomainName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// validateConfigurationCreateRequest creates the ValidateConfiguration request. +func (client *L2IsolationDomainsClient) validateConfigurationCreateRequest(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, options *L2IsolationDomainsClientBeginValidateConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/validateConfiguration" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if l2IsolationDomainName == "" { + return nil, errors.New("parameter l2IsolationDomainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{l2IsolationDomainName}", url.PathEscape(l2IsolationDomainName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l2isolationdomains_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l2isolationdomains_client_example_test.go index eab0d5b29197..76a789c5e225 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l2isolationdomains_client_example_test.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l2isolationdomains_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_Create_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Create_MaximumSet_Gen.json func ExampleL2IsolationDomainsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,11 +29,15 @@ func ExampleL2IsolationDomainsClient_BeginCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewL2IsolationDomainsClient().BeginCreate(ctx, "resourceGroupName", "example-l2domain", armmanagednetworkfabric.L2IsolationDomain{ + poller, err := clientFactory.NewL2IsolationDomainsClient().BeginCreate(ctx, "example-rg", "example-l2domain", armmanagednetworkfabric.L2IsolationDomain{ Location: to.Ptr("eastus"), + Tags: map[string]*string{ + "keyID": to.Ptr("keyValue"), + }, Properties: &armmanagednetworkfabric.L2IsolationDomainProperties{ + Annotation: to.Ptr("annotation"), Mtu: to.Ptr[int32](1500), - NetworkFabricID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName"), + NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), VlanID: to.Ptr[int32](501), }, }, nil) @@ -48,29 +52,34 @@ func ExampleL2IsolationDomainsClient_BeginCreate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.L2IsolationDomain = armmanagednetworkfabric.L2IsolationDomain{ - // Name: to.Ptr("wcpalyqmig"), - // Type: to.Ptr("vvl"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain"), + // Name: to.Ptr("example-l2domain"), + // Type: to.Ptr("microsoft.managednetworkfabric/l2IsolationDomains"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-21T01:57:02.777Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.977Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-14T06:25:58.985Z"); return t}()), - // LastModifiedBy: to.Ptr("UserID"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.978Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("keyValue"), + // }, // Properties: &armmanagednetworkfabric.L2IsolationDomainProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), // Mtu: to.Ptr[int32](1500), - // NetworkFabricID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName"), + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // VlanID: to.Ptr[int32](501), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_Get_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Get_MaximumSet_Gen.json func ExampleL2IsolationDomainsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -81,7 +90,7 @@ func ExampleL2IsolationDomainsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewL2IsolationDomainsClient().Get(ctx, "resourceGroupName", "l2IsolationDomainName", nil) + res, err := clientFactory.NewL2IsolationDomainsClient().Get(ctx, "example-rg", "example-l2Domain", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -89,29 +98,34 @@ func ExampleL2IsolationDomainsClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.L2IsolationDomain = armmanagednetworkfabric.L2IsolationDomain{ - // Name: to.Ptr("wcpalyqmig"), - // Type: to.Ptr("vvl"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain"), + // Name: to.Ptr("example-l2domain"), + // Type: to.Ptr("microsoft.managednetworkfabric/l2IsolationDomains"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-21T01:57:02.777Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.977Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-14T06:25:58.985Z"); return t}()), - // LastModifiedBy: to.Ptr("UserID"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.978Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("keyValue"), + // }, // Properties: &armmanagednetworkfabric.L2IsolationDomainProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), // Mtu: to.Ptr[int32](1500), - // NetworkFabricID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName"), + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // VlanID: to.Ptr[int32](501), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_Update_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Update_MaximumSet_Gen.json func ExampleL2IsolationDomainsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -122,9 +136,13 @@ func ExampleL2IsolationDomainsClient_BeginUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewL2IsolationDomainsClient().BeginUpdate(ctx, "resourceGroupName", "l2IsolationDomainName", armmanagednetworkfabric.L2IsolationDomainPatch{ + poller, err := clientFactory.NewL2IsolationDomainsClient().BeginUpdate(ctx, "example-rg", "example-l2Domain", armmanagednetworkfabric.L2IsolationDomainPatch{ + Tags: map[string]*string{ + "keyID": to.Ptr("keyValue"), + }, Properties: &armmanagednetworkfabric.L2IsolationDomainPatchProperties{ - Mtu: to.Ptr[int32](9000), + Annotation: to.Ptr("annotation1"), + Mtu: to.Ptr[int32](6000), }, }, nil) if err != nil { @@ -138,29 +156,34 @@ func ExampleL2IsolationDomainsClient_BeginUpdate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.L2IsolationDomain = armmanagednetworkfabric.L2IsolationDomain{ - // Name: to.Ptr("wcpalyqmig"), - // Type: to.Ptr("vvl"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain"), + // Name: to.Ptr("example-l2domain"), + // Type: to.Ptr("microsoft.managednetworkfabric/l2IsolationDomains"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-21T01:57:02.777Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.977Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-14T06:25:58.985Z"); return t}()), - // LastModifiedBy: to.Ptr("UserID"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.978Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("keyValue"), + // }, // Properties: &armmanagednetworkfabric.L2IsolationDomainProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // Mtu: to.Ptr[int32](9000), - // NetworkFabricID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName"), + // Annotation: to.Ptr("annotation1"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // Mtu: to.Ptr[int32](1500), + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // VlanID: to.Ptr[int32](501), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_Delete_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Delete_MaximumSet_Gen.json func ExampleL2IsolationDomainsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -171,7 +194,7 @@ func ExampleL2IsolationDomainsClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewL2IsolationDomainsClient().BeginDelete(ctx, "resourceGroupName", "example-l2domain", nil) + poller, err := clientFactory.NewL2IsolationDomainsClient().BeginDelete(ctx, "example-rg", "example-l2Domain", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -181,7 +204,7 @@ func ExampleL2IsolationDomainsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_updateAdministrativeState_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_updateAdministrativeState_MaximumSet_Gen.json func ExampleL2IsolationDomainsClient_BeginUpdateAdministrativeState() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -192,46 +215,45 @@ func ExampleL2IsolationDomainsClient_BeginUpdateAdministrativeState() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewL2IsolationDomainsClient().BeginUpdateAdministrativeState(ctx, "resourceGroupName", "l2IsolationDomainName", armmanagednetworkfabric.UpdateAdministrativeState{ + poller, err := clientFactory.NewL2IsolationDomainsClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-l2Domain", armmanagednetworkfabric.UpdateAdministrativeState{ ResourceIDs: []*string{ - to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain")}, - State: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnable), + to.Ptr("")}, + State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_clearArpTable_MaximumSet_Gen.json -func ExampleL2IsolationDomainsClient_BeginClearArpTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewL2IsolationDomainsClient().BeginClearArpTable(ctx, "resourceGroupName", "example-l2domain", armmanagednetworkfabric.EnableDisableOnResources{ - ResourceIDs: []*string{ - to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForDeviceUpdate = armmanagednetworkfabric.CommonPostActionResponseForDeviceUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // FailedDevices: []*string{ + // to.Ptr("")}, + // SuccessfulDevices: []*string{ + // to.Ptr("")}, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_clearNeighborTable_MaximumSet_Gen.json -func ExampleL2IsolationDomainsClient_BeginClearNeighborTable() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_ValidateConfiguration_MaximumSet_Gen.json +func ExampleL2IsolationDomainsClient_BeginValidateConfiguration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -241,21 +263,38 @@ func ExampleL2IsolationDomainsClient_BeginClearNeighborTable() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewL2IsolationDomainsClient().BeginClearNeighborTable(ctx, "rgL2IsolationDomains", "oz", armmanagednetworkfabric.EnableDisableOnResources{ - ResourceIDs: []*string{ - to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain")}, - }, nil) + poller, err := clientFactory.NewL2IsolationDomainsClient().BeginValidateConfiguration(ctx, "example-rg", "example-l2domain", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ValidateConfigurationResponse = armmanagednetworkfabric.ValidateConfigurationResponse{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // URL: to.Ptr("https://ActionDetails"), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_getArpEntries_MaximumSet_Gen.json -func ExampleL2IsolationDomainsClient_BeginGetArpEntries() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_CommitConfiguration_MaximumSet_Gen.json +func ExampleL2IsolationDomainsClient_BeginCommitConfiguration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -265,17 +304,36 @@ func ExampleL2IsolationDomainsClient_BeginGetArpEntries() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewL2IsolationDomainsClient().BeginGetArpEntries(ctx, "resourceGroupName", "l2IsolationDomainName", nil) + poller, err := clientFactory.NewL2IsolationDomainsClient().BeginCommitConfiguration(ctx, "example-rg", "example-l2domain", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_ListByResourceGroup_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_ListByResourceGroup_MaximumSet_Gen.json func ExampleL2IsolationDomainsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -286,7 +344,7 @@ func ExampleL2IsolationDomainsClient_NewListByResourceGroupPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewL2IsolationDomainsClient().NewListByResourceGroupPager("resourceGroupName", nil) + pager := clientFactory.NewL2IsolationDomainsClient().NewListByResourceGroupPager("example-rg", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -300,22 +358,27 @@ func ExampleL2IsolationDomainsClient_NewListByResourceGroupPager() { // page.L2IsolationDomainsListResult = armmanagednetworkfabric.L2IsolationDomainsListResult{ // Value: []*armmanagednetworkfabric.L2IsolationDomain{ // { - // Name: to.Ptr("wcpalyqmig"), - // Type: to.Ptr("vvl"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain"), + // Name: to.Ptr("example-l2domain"), + // Type: to.Ptr("microsoft.managednetworkfabric/l2IsolationDomains"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-21T01:57:02.777Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.977Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-14T06:25:58.985Z"); return t}()), - // LastModifiedBy: to.Ptr("UserID"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.978Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("keyValue"), + // }, // Properties: &armmanagednetworkfabric.L2IsolationDomainProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), // Mtu: to.Ptr[int32](1500), - // NetworkFabricID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName"), + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // VlanID: to.Ptr[int32](501), // }, @@ -324,7 +387,7 @@ func ExampleL2IsolationDomainsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_ListBySubscription_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_ListBySubscription_MaximumSet_Gen.json func ExampleL2IsolationDomainsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -349,32 +412,31 @@ func ExampleL2IsolationDomainsClient_NewListBySubscriptionPager() { // page.L2IsolationDomainsListResult = armmanagednetworkfabric.L2IsolationDomainsListResult{ // Value: []*armmanagednetworkfabric.L2IsolationDomain{ // { - // Name: to.Ptr("c"), - // Type: to.Ptr("itmwcuyyfszkpdlothpvaapua"), - // ID: to.Ptr("unraggwhhbsxgdpgpvcmhjmilsoueg"), + // Name: to.Ptr("example-l2domain"), + // Type: to.Ptr("microsoft.managednetworkfabric/l2IsolationDomains"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-14T06:25:58.985Z"); return t}()), - // CreatedBy: to.Ptr("ctnmjhhireuhzyyswimpgepwoozsjj"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.977Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-14T06:25:58.985Z"); return t}()), - // LastModifiedBy: to.Ptr("mqwaqcbithfotieyfedyyqbp"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.978Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("uyucxonjxcdvkryhqmyopvqlwueu"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key4169": to.Ptr("hqxdrtnvspqpqpskanhyesj"), + // "keyID": to.Ptr("keyValue"), // }, // Properties: &armmanagednetworkfabric.L2IsolationDomainProperties{ - // Annotation: to.Ptr("agtpcaqqboaiztvbjsxdpmw"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // DisabledOnResources: []*string{ - // to.Ptr("vbynlxy")}, - // Mtu: to.Ptr[int32](5), - // NetworkFabricID: to.Ptr("gbfqosedebmtcyueqjbxa"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // VlanID: to.Ptr[int32](2), - // }, - // }}, - // } + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // Mtu: to.Ptr[int32](1500), + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // VlanID: to.Ptr[int32](501), + // }, + // }}, + // } } } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l3isolationdomains_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l3isolationdomains_client.go index e6470aab0415..04deb3e7a893 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l3isolationdomains_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l3isolationdomains_client.go @@ -29,7 +29,7 @@ type L3IsolationDomainsClient struct { } // NewL3IsolationDomainsClient creates a new instance of L3IsolationDomainsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewL3IsolationDomainsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*L3IsolationDomainsClient, error) { @@ -44,103 +44,34 @@ func NewL3IsolationDomainsClient(subscriptionID string, credential azcore.TokenC return client, nil } -// BeginClearArpTable - Clears ARP tables for this Isolation Domain. +// BeginCommitConfiguration - Commits the configuration of the given resources. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain. -// - body - Request payload. -// - options - L3IsolationDomainsClientBeginClearArpTableOptions contains the optional parameters for the L3IsolationDomainsClient.BeginClearArpTable -// method. -func (client *L3IsolationDomainsClient) BeginClearArpTable(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, body EnableDisableOnResources, options *L3IsolationDomainsClientBeginClearArpTableOptions) (*runtime.Poller[L3IsolationDomainsClientClearArpTableResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.clearArpTable(ctx, resourceGroupName, l3IsolationDomainName, body, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L3IsolationDomainsClientClearArpTableResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[L3IsolationDomainsClientClearArpTableResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// ClearArpTable - Clears ARP tables for this Isolation Domain. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -func (client *L3IsolationDomainsClient) clearArpTable(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, body EnableDisableOnResources, options *L3IsolationDomainsClientBeginClearArpTableOptions) (*http.Response, error) { - req, err := client.clearArpTableCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, body, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// clearArpTableCreateRequest creates the ClearArpTable request. -func (client *L3IsolationDomainsClient) clearArpTableCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, body EnableDisableOnResources, options *L3IsolationDomainsClientBeginClearArpTableOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/clearArpTable" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if l3IsolationDomainName == "" { - return nil, errors.New("parameter l3IsolationDomainName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{l3IsolationDomainName}", url.PathEscape(l3IsolationDomainName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) -} - -// BeginClearNeighborTable - Clears IPv6 neighbor tables for this Isolation Domain. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain. -// - body - Request payload. -// - options - L3IsolationDomainsClientBeginClearNeighborTableOptions contains the optional parameters for the L3IsolationDomainsClient.BeginClearNeighborTable +// - l3IsolationDomainName - Name of the L3 Isolation Domain. +// - options - L3IsolationDomainsClientBeginCommitConfigurationOptions contains the optional parameters for the L3IsolationDomainsClient.BeginCommitConfiguration // method. -func (client *L3IsolationDomainsClient) BeginClearNeighborTable(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, body EnableDisableOnResources, options *L3IsolationDomainsClientBeginClearNeighborTableOptions) (*runtime.Poller[L3IsolationDomainsClientClearNeighborTableResponse], error) { +func (client *L3IsolationDomainsClient) BeginCommitConfiguration(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *L3IsolationDomainsClientBeginCommitConfigurationOptions) (*runtime.Poller[L3IsolationDomainsClientCommitConfigurationResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.clearNeighborTable(ctx, resourceGroupName, l3IsolationDomainName, body, options) + resp, err := client.commitConfiguration(ctx, resourceGroupName, l3IsolationDomainName, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L3IsolationDomainsClientClearNeighborTableResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L3IsolationDomainsClientCommitConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[L3IsolationDomainsClientClearNeighborTableResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken[L3IsolationDomainsClientCommitConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } -// ClearNeighborTable - Clears IPv6 neighbor tables for this Isolation Domain. +// CommitConfiguration - Commits the configuration of the given resources. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview -func (client *L3IsolationDomainsClient) clearNeighborTable(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, body EnableDisableOnResources, options *L3IsolationDomainsClientBeginClearNeighborTableOptions) (*http.Response, error) { - req, err := client.clearNeighborTableCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, body, options) +// Generated from API version 2023-06-15 +func (client *L3IsolationDomainsClient) commitConfiguration(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *L3IsolationDomainsClientBeginCommitConfigurationOptions) (*http.Response, error) { + req, err := client.commitConfigurationCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, options) if err != nil { return nil, err } @@ -148,18 +79,15 @@ func (client *L3IsolationDomainsClient) clearNeighborTable(ctx context.Context, if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil } -// clearNeighborTableCreateRequest creates the ClearNeighborTable request. -func (client *L3IsolationDomainsClient) clearNeighborTableCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, body EnableDisableOnResources, options *L3IsolationDomainsClientBeginClearNeighborTableOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/clearNeighborTable" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } +// commitConfigurationCreateRequest creates the CommitConfiguration request. +func (client *L3IsolationDomainsClient) commitConfigurationCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *L3IsolationDomainsClientBeginCommitConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/commitConfiguration" urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -174,10 +102,10 @@ func (client *L3IsolationDomainsClient) clearNeighborTableCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + return req, nil } // BeginCreate - Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with @@ -185,9 +113,9 @@ func (client *L3IsolationDomainsClient) clearNeighborTableCreateRequest(ctx cont // networks is completed and isolation domain is enabled. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3 Isolation Domain +// - l3IsolationDomainName - Name of the L3 Isolation Domain. // - body - Request payload. // - options - L3IsolationDomainsClientBeginCreateOptions contains the optional parameters for the L3IsolationDomainsClient.BeginCreate // method. @@ -210,7 +138,7 @@ func (client *L3IsolationDomainsClient) BeginCreate(ctx context.Context, resourc // networks is completed and isolation domain is enabled. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *L3IsolationDomainsClient) create(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, body L3IsolationDomain, options *L3IsolationDomainsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, body, options) if err != nil { @@ -229,9 +157,6 @@ func (client *L3IsolationDomainsClient) create(ctx context.Context, resourceGrou // createCreateRequest creates the Create request. func (client *L3IsolationDomainsClient) createCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, body L3IsolationDomain, options *L3IsolationDomainsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -246,7 +171,7 @@ func (client *L3IsolationDomainsClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -255,9 +180,9 @@ func (client *L3IsolationDomainsClient) createCreateRequest(ctx context.Context, // BeginDelete - Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3 Isolation Domain +// - l3IsolationDomainName - Name of the L3 Isolation Domain. // - options - L3IsolationDomainsClientBeginDeleteOptions contains the optional parameters for the L3IsolationDomainsClient.BeginDelete // method. func (client *L3IsolationDomainsClient) BeginDelete(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *L3IsolationDomainsClientBeginDeleteOptions) (*runtime.Poller[L3IsolationDomainsClientDeleteResponse], error) { @@ -277,7 +202,7 @@ func (client *L3IsolationDomainsClient) BeginDelete(ctx context.Context, resourc // Delete - Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *L3IsolationDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *L3IsolationDomainsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, options) if err != nil { @@ -287,7 +212,7 @@ func (client *L3IsolationDomainsClient) deleteOperation(ctx context.Context, res if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -296,9 +221,6 @@ func (client *L3IsolationDomainsClient) deleteOperation(ctx context.Context, res // deleteCreateRequest creates the Delete request. func (client *L3IsolationDomainsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *L3IsolationDomainsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -313,7 +235,7 @@ func (client *L3IsolationDomainsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,9 +244,9 @@ func (client *L3IsolationDomainsClient) deleteCreateRequest(ctx context.Context, // Get - Retrieves details of this L3 Isolation Domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3 Isolation Domain +// - l3IsolationDomainName - Name of the L3 Isolation Domain. // - options - L3IsolationDomainsClientGetOptions contains the optional parameters for the L3IsolationDomainsClient.Get method. func (client *L3IsolationDomainsClient) Get(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *L3IsolationDomainsClientGetOptions) (L3IsolationDomainsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, options) @@ -344,9 +266,6 @@ func (client *L3IsolationDomainsClient) Get(ctx context.Context, resourceGroupNa // getCreateRequest creates the Get request. func (client *L3IsolationDomainsClient) getCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *L3IsolationDomainsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -361,7 +280,7 @@ func (client *L3IsolationDomainsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -378,7 +297,7 @@ func (client *L3IsolationDomainsClient) getHandleResponse(resp *http.Response) ( // NewListByResourceGroupPager - Displays L3IsolationDomains list by resource group GET method. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - L3IsolationDomainsClientListByResourceGroupOptions contains the optional parameters for the L3IsolationDomainsClient.NewListByResourceGroupPager // method. @@ -413,9 +332,6 @@ func (client *L3IsolationDomainsClient) NewListByResourceGroupPager(resourceGrou // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *L3IsolationDomainsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *L3IsolationDomainsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -426,7 +342,7 @@ func (client *L3IsolationDomainsClient) listByResourceGroupCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -443,7 +359,7 @@ func (client *L3IsolationDomainsClient) listByResourceGroupHandleResponse(resp * // NewListBySubscriptionPager - Displays L3IsolationDomains list by subscription GET method. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - options - L3IsolationDomainsClientListBySubscriptionOptions contains the optional parameters for the L3IsolationDomainsClient.NewListBySubscriptionPager // method. func (client *L3IsolationDomainsClient) NewListBySubscriptionPager(options *L3IsolationDomainsClientListBySubscriptionOptions) *runtime.Pager[L3IsolationDomainsClientListBySubscriptionResponse] { @@ -477,16 +393,13 @@ func (client *L3IsolationDomainsClient) NewListBySubscriptionPager(options *L3Is // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *L3IsolationDomainsClient) listBySubscriptionCreateRequest(ctx context.Context, options *L3IsolationDomainsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -504,9 +417,9 @@ func (client *L3IsolationDomainsClient) listBySubscriptionHandleResponse(resp *h // BeginUpdate - API to update certain properties of the L3 Isolation Domain resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3 Isolation Domain +// - l3IsolationDomainName - Name of the L3 Isolation Domain. // - body - API to update certain properties of the L3 Isolation Domain resource. // - options - L3IsolationDomainsClientBeginUpdateOptions contains the optional parameters for the L3IsolationDomainsClient.BeginUpdate // method. @@ -527,7 +440,7 @@ func (client *L3IsolationDomainsClient) BeginUpdate(ctx context.Context, resourc // Update - API to update certain properties of the L3 Isolation Domain resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *L3IsolationDomainsClient) update(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, body L3IsolationDomainPatch, options *L3IsolationDomainsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, body, options) if err != nil { @@ -546,9 +459,6 @@ func (client *L3IsolationDomainsClient) update(ctx context.Context, resourceGrou // updateCreateRequest creates the Update request. func (client *L3IsolationDomainsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, body L3IsolationDomainPatch, options *L3IsolationDomainsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -563,7 +473,7 @@ func (client *L3IsolationDomainsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -572,9 +482,9 @@ func (client *L3IsolationDomainsClient) updateCreateRequest(ctx context.Context, // BeginUpdateAdministrativeState - Enables racks for this Isolation Domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain. +// - l3IsolationDomainName - Name of the L3 Isolation Domain. // - body - Request payload. // - options - L3IsolationDomainsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the L3IsolationDomainsClient.BeginUpdateAdministrativeState // method. @@ -595,7 +505,7 @@ func (client *L3IsolationDomainsClient) BeginUpdateAdministrativeState(ctx conte // UpdateAdministrativeState - Enables racks for this Isolation Domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *L3IsolationDomainsClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, body UpdateAdministrativeState, options *L3IsolationDomainsClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, body, options) if err != nil { @@ -605,7 +515,7 @@ func (client *L3IsolationDomainsClient) updateAdministrativeState(ctx context.Co if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -614,9 +524,6 @@ func (client *L3IsolationDomainsClient) updateAdministrativeState(ctx context.Co // updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. func (client *L3IsolationDomainsClient) updateAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, body UpdateAdministrativeState, options *L3IsolationDomainsClientBeginUpdateAdministrativeStateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/updateAdministrativeState" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -631,41 +538,40 @@ func (client *L3IsolationDomainsClient) updateAdministrativeStateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) } -// BeginUpdateOptionBAdministrativeState - Update administrative state of option B on CE devices +// BeginValidateConfiguration - Validates the configuration of the resources. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - l3IsolationDomainName - Name of the L3IsolationDomain. -// - body - Request payload. -// - options - L3IsolationDomainsClientBeginUpdateOptionBAdministrativeStateOptions contains the optional parameters for the -// L3IsolationDomainsClient.BeginUpdateOptionBAdministrativeState method. -func (client *L3IsolationDomainsClient) BeginUpdateOptionBAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, body UpdateAdministrativeState, options *L3IsolationDomainsClientBeginUpdateOptionBAdministrativeStateOptions) (*runtime.Poller[L3IsolationDomainsClientUpdateOptionBAdministrativeStateResponse], error) { +// - l3IsolationDomainName - Name of the L3 Isolation Domain. +// - options - L3IsolationDomainsClientBeginValidateConfigurationOptions contains the optional parameters for the L3IsolationDomainsClient.BeginValidateConfiguration +// method. +func (client *L3IsolationDomainsClient) BeginValidateConfiguration(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *L3IsolationDomainsClientBeginValidateConfigurationOptions) (*runtime.Poller[L3IsolationDomainsClientValidateConfigurationResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.updateOptionBAdministrativeState(ctx, resourceGroupName, l3IsolationDomainName, body, options) + resp, err := client.validateConfiguration(ctx, resourceGroupName, l3IsolationDomainName, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L3IsolationDomainsClientUpdateOptionBAdministrativeStateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L3IsolationDomainsClientValidateConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[L3IsolationDomainsClientUpdateOptionBAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken[L3IsolationDomainsClientValidateConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } -// UpdateOptionBAdministrativeState - Update administrative state of option B on CE devices +// ValidateConfiguration - Validates the configuration of the resources. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview -func (client *L3IsolationDomainsClient) updateOptionBAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, body UpdateAdministrativeState, options *L3IsolationDomainsClientBeginUpdateOptionBAdministrativeStateOptions) (*http.Response, error) { - req, err := client.updateOptionBAdministrativeStateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, body, options) +// Generated from API version 2023-06-15 +func (client *L3IsolationDomainsClient) validateConfiguration(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *L3IsolationDomainsClientBeginValidateConfigurationOptions) (*http.Response, error) { + req, err := client.validateConfigurationCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, options) if err != nil { return nil, err } @@ -673,18 +579,15 @@ func (client *L3IsolationDomainsClient) updateOptionBAdministrativeState(ctx con if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil } -// updateOptionBAdministrativeStateCreateRequest creates the UpdateOptionBAdministrativeState request. -func (client *L3IsolationDomainsClient) updateOptionBAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, body UpdateAdministrativeState, options *L3IsolationDomainsClientBeginUpdateOptionBAdministrativeStateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/updateOptionBAdministrativeState" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } +// validateConfigurationCreateRequest creates the ValidateConfiguration request. +func (client *L3IsolationDomainsClient) validateConfigurationCreateRequest(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *L3IsolationDomainsClientBeginValidateConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/validateConfiguration" urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -699,8 +602,8 @@ func (client *L3IsolationDomainsClient) updateOptionBAdministrativeStateCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + return req, nil } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l3isolationdomains_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l3isolationdomains_client_example_test.go index 173c429d94ab..c419be63d524 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l3isolationdomains_client_example_test.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l3isolationdomains_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_Create_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Create_MaximumSet_Gen.json func ExampleL3IsolationDomainsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,10 +29,13 @@ func ExampleL3IsolationDomainsClient_BeginCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewL3IsolationDomainsClient().BeginCreate(ctx, "resourceGroupName", "example-l3domain", armmanagednetworkfabric.L3IsolationDomain{ + poller, err := clientFactory.NewL3IsolationDomainsClient().BeginCreate(ctx, "example-rg", "example-l3domain", armmanagednetworkfabric.L3IsolationDomain{ Location: to.Ptr("eastus"), + Tags: map[string]*string{ + "keyID": to.Ptr("KeyValue"), + }, Properties: &armmanagednetworkfabric.L3IsolationDomainProperties{ - Description: to.Ptr("creating L3 isolation domain"), + Annotation: to.Ptr("annotation"), AggregateRouteConfiguration: &armmanagednetworkfabric.AggregateRouteConfiguration{ IPv4Routes: []*armmanagednetworkfabric.AggregateRoute{ { @@ -40,15 +43,19 @@ func ExampleL3IsolationDomainsClient_BeginCreate() { }}, IPv6Routes: []*armmanagednetworkfabric.AggregateRoute{ { - Prefix: to.Ptr("10.0.0.1"), + Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), }}, }, - ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy{ - ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2"), + ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.ConnectedSubnetRoutePolicy{ + ExportRoutePolicy: &armmanagednetworkfabric.L3ExportRoutePolicy{ + ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + }, + ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), }, RedistributeConnectedSubnets: to.Ptr(armmanagednetworkfabric.RedistributeConnectedSubnetsTrue), RedistributeStaticRoutes: to.Ptr(armmanagednetworkfabric.RedistributeStaticRoutesFalse), - NetworkFabricID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName"), + NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), }, }, nil) if err != nil { @@ -64,18 +71,21 @@ func ExampleL3IsolationDomainsClient_BeginCreate() { // res.L3IsolationDomain = armmanagednetworkfabric.L3IsolationDomain{ // Name: to.Ptr("example-l3domain"), // Type: to.Ptr("microsoft.managednetworkfabric/l3isolationdomains"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), // LastModifiedBy: to.Ptr("UserId"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("KeyValue"), + // }, // Properties: &armmanagednetworkfabric.L3IsolationDomainProperties{ - // Description: to.Ptr("creating L3 isolation domain"), + // Annotation: to.Ptr("annotation"), // AggregateRouteConfiguration: &armmanagednetworkfabric.AggregateRouteConfiguration{ // IPv4Routes: []*armmanagednetworkfabric.AggregateRoute{ // { @@ -86,24 +96,24 @@ func ExampleL3IsolationDomainsClient_BeginCreate() { // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), // }}, // }, - // ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.ConnectedSubnetRoutePolicy{ + // ExportRoutePolicy: &armmanagednetworkfabric.L3ExportRoutePolicy{ + // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // }, + // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), // }, // RedistributeConnectedSubnets: to.Ptr(armmanagednetworkfabric.RedistributeConnectedSubnetsTrue), // RedistributeStaticRoutes: to.Ptr(armmanagednetworkfabric.RedistributeStaticRoutesFalse), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // DisabledOnResources: []*string{ - // to.Ptr("")}, - // NetworkFabricID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName"), - // OptionBDisabledOnResources: []*string{ - // to.Ptr("")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_Get_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Get_MaximumSet_Gen.json func ExampleL3IsolationDomainsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -114,7 +124,7 @@ func ExampleL3IsolationDomainsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewL3IsolationDomainsClient().Get(ctx, "resourceGroupName", "example-l3domain", nil) + res, err := clientFactory.NewL3IsolationDomainsClient().Get(ctx, "example-rg", "example-l3domain", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -124,18 +134,21 @@ func ExampleL3IsolationDomainsClient_Get() { // res.L3IsolationDomain = armmanagednetworkfabric.L3IsolationDomain{ // Name: to.Ptr("example-l3domain"), // Type: to.Ptr("microsoft.managednetworkfabric/l3isolationdomains"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), // LastModifiedBy: to.Ptr("UserId"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("KeyValue"), + // }, // Properties: &armmanagednetworkfabric.L3IsolationDomainProperties{ - // Description: to.Ptr("creating L3 isolation domain"), + // Annotation: to.Ptr("annotation"), // AggregateRouteConfiguration: &armmanagednetworkfabric.AggregateRouteConfiguration{ // IPv4Routes: []*armmanagednetworkfabric.AggregateRoute{ // { @@ -146,24 +159,24 @@ func ExampleL3IsolationDomainsClient_Get() { // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), // }}, // }, - // ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.ConnectedSubnetRoutePolicy{ + // ExportRoutePolicy: &armmanagednetworkfabric.L3ExportRoutePolicy{ + // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // }, + // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), // }, // RedistributeConnectedSubnets: to.Ptr(armmanagednetworkfabric.RedistributeConnectedSubnetsTrue), // RedistributeStaticRoutes: to.Ptr(armmanagednetworkfabric.RedistributeStaticRoutesFalse), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // DisabledOnResources: []*string{ - // to.Ptr("")}, - // NetworkFabricID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName"), - // OptionBDisabledOnResources: []*string{ - // to.Ptr("")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_Update_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Update_MaximumSet_Gen.json func ExampleL3IsolationDomainsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -174,9 +187,12 @@ func ExampleL3IsolationDomainsClient_BeginUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewL3IsolationDomainsClient().BeginUpdate(ctx, "resourceGroupName", "example-l3domain", armmanagednetworkfabric.L3IsolationDomainPatch{ + poller, err := clientFactory.NewL3IsolationDomainsClient().BeginUpdate(ctx, "example-rg", "example-l3domain", armmanagednetworkfabric.L3IsolationDomainPatch{ + Tags: map[string]*string{ + "key4953": to.Ptr("1234"), + }, Properties: &armmanagednetworkfabric.L3IsolationDomainPatchProperties{ - Description: to.Ptr("creating L3 isolation domain"), + Annotation: to.Ptr("annotation1"), AggregateRouteConfiguration: &armmanagednetworkfabric.AggregateRouteConfiguration{ IPv4Routes: []*armmanagednetworkfabric.AggregateRoute{ { @@ -187,8 +203,12 @@ func ExampleL3IsolationDomainsClient_BeginUpdate() { Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), }}, }, - ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy{ - ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.ConnectedSubnetRoutePolicy{ + ExportRoutePolicy: &armmanagednetworkfabric.L3ExportRoutePolicy{ + ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), + ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), + }, + ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), }, RedistributeConnectedSubnets: to.Ptr(armmanagednetworkfabric.RedistributeConnectedSubnetsTrue), RedistributeStaticRoutes: to.Ptr(armmanagednetworkfabric.RedistributeStaticRoutesFalse), @@ -207,18 +227,21 @@ func ExampleL3IsolationDomainsClient_BeginUpdate() { // res.L3IsolationDomain = armmanagednetworkfabric.L3IsolationDomain{ // Name: to.Ptr("example-l3domain"), // Type: to.Ptr("microsoft.managednetworkfabric/l3isolationdomains"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), // LastModifiedBy: to.Ptr("UserId"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "key4953": to.Ptr("1234"), + // }, // Properties: &armmanagednetworkfabric.L3IsolationDomainProperties{ - // Description: to.Ptr("creating L3 isolation domain"), + // Annotation: to.Ptr("annotation"), // AggregateRouteConfiguration: &armmanagednetworkfabric.AggregateRouteConfiguration{ // IPv4Routes: []*armmanagednetworkfabric.AggregateRoute{ // { @@ -229,24 +252,24 @@ func ExampleL3IsolationDomainsClient_BeginUpdate() { // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), // }}, // }, - // ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.ConnectedSubnetRoutePolicy{ + // ExportRoutePolicy: &armmanagednetworkfabric.L3ExportRoutePolicy{ + // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), + // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), + // }, + // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), // }, // RedistributeConnectedSubnets: to.Ptr(armmanagednetworkfabric.RedistributeConnectedSubnetsTrue), // RedistributeStaticRoutes: to.Ptr(armmanagednetworkfabric.RedistributeStaticRoutesFalse), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // DisabledOnResources: []*string{ - // to.Ptr("")}, - // NetworkFabricID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName"), - // OptionBDisabledOnResources: []*string{ - // to.Ptr("")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_Delete_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Delete_MaximumSet_Gen.json func ExampleL3IsolationDomainsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -257,7 +280,7 @@ func ExampleL3IsolationDomainsClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewL3IsolationDomainsClient().BeginDelete(ctx, "resourceGroupName", "example-l3domain", nil) + poller, err := clientFactory.NewL3IsolationDomainsClient().BeginDelete(ctx, "example-rg", "example-l3domain", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -267,7 +290,7 @@ func ExampleL3IsolationDomainsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_ListByResourceGroup_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_ListByResourceGroup_MaximumSet_Gen.json func ExampleL3IsolationDomainsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -278,7 +301,7 @@ func ExampleL3IsolationDomainsClient_NewListByResourceGroupPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewL3IsolationDomainsClient().NewListByResourceGroupPager("resourceGroupName", nil) + pager := clientFactory.NewL3IsolationDomainsClient().NewListByResourceGroupPager("example-rg", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -294,18 +317,21 @@ func ExampleL3IsolationDomainsClient_NewListByResourceGroupPager() { // { // Name: to.Ptr("example-l3domain"), // Type: to.Ptr("microsoft.managednetworkfabric/l3isolationdomains"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), // LastModifiedBy: to.Ptr("UserId"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("KeyValue"), + // }, // Properties: &armmanagednetworkfabric.L3IsolationDomainProperties{ - // Description: to.Ptr("creating L3 isolation domain"), + // Annotation: to.Ptr("annotation"), // AggregateRouteConfiguration: &armmanagednetworkfabric.AggregateRouteConfiguration{ // IPv4Routes: []*armmanagednetworkfabric.AggregateRoute{ // { @@ -316,26 +342,26 @@ func ExampleL3IsolationDomainsClient_NewListByResourceGroupPager() { // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), // }}, // }, - // ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.ConnectedSubnetRoutePolicy{ + // ExportRoutePolicy: &armmanagednetworkfabric.L3ExportRoutePolicy{ + // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // }, + // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), // }, // RedistributeConnectedSubnets: to.Ptr(armmanagednetworkfabric.RedistributeConnectedSubnetsTrue), // RedistributeStaticRoutes: to.Ptr(armmanagednetworkfabric.RedistributeStaticRoutesFalse), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // DisabledOnResources: []*string{ - // to.Ptr("")}, - // NetworkFabricID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName"), - // OptionBDisabledOnResources: []*string{ - // to.Ptr("")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_ListBySubscription_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_ListBySubscription_MaximumSet_Gen.json func ExampleL3IsolationDomainsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -362,18 +388,21 @@ func ExampleL3IsolationDomainsClient_NewListBySubscriptionPager() { // { // Name: to.Ptr("example-l3domain"), // Type: to.Ptr("microsoft.managednetworkfabric/l3isolationdomains"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-09T18:35:44.070Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), // LastModifiedBy: to.Ptr("UserId"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("KeyValue"), + // }, // Properties: &armmanagednetworkfabric.L3IsolationDomainProperties{ - // Description: to.Ptr("creating L3 isolation domain"), + // Annotation: to.Ptr("annotation"), // AggregateRouteConfiguration: &armmanagednetworkfabric.AggregateRouteConfiguration{ // IPv4Routes: []*armmanagednetworkfabric.AggregateRoute{ // { @@ -384,26 +413,26 @@ func ExampleL3IsolationDomainsClient_NewListBySubscriptionPager() { // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), // }}, // }, - // ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.ConnectedSubnetRoutePolicy{ + // ExportRoutePolicy: &armmanagednetworkfabric.L3ExportRoutePolicy{ + // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // }, + // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), // }, // RedistributeConnectedSubnets: to.Ptr(armmanagednetworkfabric.RedistributeConnectedSubnetsTrue), // RedistributeStaticRoutes: to.Ptr(armmanagednetworkfabric.RedistributeStaticRoutesFalse), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // DisabledOnResources: []*string{ - // to.Ptr("")}, - // NetworkFabricID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName"), - // OptionBDisabledOnResources: []*string{ - // to.Ptr("")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_updateAdministrativeState_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_updateAdministrativeState_MaximumSet_Gen.json func ExampleL3IsolationDomainsClient_BeginUpdateAdministrativeState() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -414,47 +443,45 @@ func ExampleL3IsolationDomainsClient_BeginUpdateAdministrativeState() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewL3IsolationDomainsClient().BeginUpdateAdministrativeState(ctx, "resourceGroupName", "example-l3domain", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")}, - State: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnable), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_updateOptionBAdministrativeState_MaximumSet_Gen.json -func ExampleL3IsolationDomainsClient_BeginUpdateOptionBAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewL3IsolationDomainsClient().BeginUpdateOptionBAdministrativeState(ctx, "resourceGroupName", "example-l3domain", armmanagednetworkfabric.UpdateAdministrativeState{ + poller, err := clientFactory.NewL3IsolationDomainsClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-l3domain", armmanagednetworkfabric.UpdateAdministrativeState{ ResourceIDs: []*string{ - to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")}, - State: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnable), + to.Ptr("")}, + State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForDeviceUpdate = armmanagednetworkfabric.CommonPostActionResponseForDeviceUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // FailedDevices: []*string{ + // to.Ptr("")}, + // SuccessfulDevices: []*string{ + // to.Ptr("")}, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_clearArpTable_MaximumSet_Gen.json -func ExampleL3IsolationDomainsClient_BeginClearArpTable() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_ValidateConfiguration_MaximumSet_Gen.json +func ExampleL3IsolationDomainsClient_BeginValidateConfiguration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -464,21 +491,38 @@ func ExampleL3IsolationDomainsClient_BeginClearArpTable() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewL3IsolationDomainsClient().BeginClearArpTable(ctx, "resourceGroupName", "l3IsolationDomainName", armmanagednetworkfabric.EnableDisableOnResources{ - ResourceIDs: []*string{ - to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")}, - }, nil) + poller, err := clientFactory.NewL3IsolationDomainsClient().BeginValidateConfiguration(ctx, "example-rg", "example-l3domain", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ValidateConfigurationResponse = armmanagednetworkfabric.ValidateConfigurationResponse{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // URL: to.Ptr("https://ActionDetails"), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_clearNeighborTable_MaximumSet_Gen.json -func ExampleL3IsolationDomainsClient_BeginClearNeighborTable() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_CommitConfiguration_MaximumSet_Gen.json +func ExampleL3IsolationDomainsClient_BeginCommitConfiguration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -488,15 +532,31 @@ func ExampleL3IsolationDomainsClient_BeginClearNeighborTable() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewL3IsolationDomainsClient().BeginClearNeighborTable(ctx, "resourceGroupName", "example-l3domain", armmanagednetworkfabric.EnableDisableOnResources{ - ResourceIDs: []*string{ - to.Ptr("wnaxqikneofcni")}, - }, nil) + poller, err := clientFactory.NewL3IsolationDomainsClient().BeginCommitConfiguration(ctx, "example-rg", "example-l3domain", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/models.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/models.go index e812ef717e68..8f244ef7785e 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/models.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/models.go @@ -11,25 +11,7 @@ package armmanagednetworkfabric import "time" -// ARPProperties - Show ARP table entry properties -type ARPProperties struct { - // REQUIRED; Ipv4 or Ipv6 address - Address *string - - // REQUIRED; Duration in seconds. - Age *string - - // REQUIRED; Layer 2 interface name. - Interface *string - - // REQUIRED; Hardware address. - MacAddress *string - - // ARP status - State *string -} - -// AccessControlList - The AccessControlList resource definition. +// AccessControlList - The Access Control List resource definition. type AccessControlList struct { // REQUIRED; The geo-location where the resource lives Location *string @@ -40,7 +22,7 @@ type AccessControlList struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -53,77 +35,178 @@ type AccessControlList struct { Type *string } -// AccessControlListConditionProperties - Access Control List condition model. -type AccessControlListConditionProperties struct { - // REQUIRED; action. Example: allow | deny. - Action *ConditionActionType +// AccessControlListAction - Action that need to performed. +type AccessControlListAction struct { + // Name of the counter block to get match count information. + CounterName *string + + // Type of actions that can be performed. + Type *ACLActionType +} + +// AccessControlListMatchCondition - Defines the match condition that is supported to filter the traffic. +type AccessControlListMatchCondition struct { + // List of DSCP Markings that needs to be matched. + DscpMarkings []*string - // REQUIRED; destinationAddress. Example: any | 1.1.1.0/24 | 1.1.10.10 - DestinationAddress *string + // List of ether type values that needs to be matched. + EtherTypes []*string - // REQUIRED; destinationPort. Example: any | 1253 - DestinationPort *string + // List of IP fragment packets that needs to be matched. + Fragments []*string - // REQUIRED; TCP/IP protocol as defined in the list of IP protocol numbers. Example: 255 (any) | 0 | 1. - Protocol *int32 + // IP condition that needs to be matched. + IPCondition *IPMatchCondition - // REQUIRED; sequenceNumber of the Access Control List. - SequenceNumber *int32 + // List of IP Lengths that needs to be matched. + IPLengths []*string - // REQUIRED; sourceAddress. Example: any | 1.1.1.0/24 | 1.1.10.10 - SourceAddress *string + // Defines the port condition that needs to be matched. + PortCondition *AccessControlListPortCondition - // REQUIRED; sourcePort. Example: any | 1253 - SourcePort *string + // List of the protocols that need to be matched. + ProtocolTypes []*string - // Switch configuration description. - Annotation *string + // List of TTL [Time To Live] values that needs to be matched. + TTLValues []*string + + // Vlan match condition that needs to be matched. + VlanMatchCondition *VlanMatchCondition +} + +// AccessControlListMatchConfiguration - Defines the match configuration that are supported to filter the traffic. +type AccessControlListMatchConfiguration struct { + // List of actions that need to be performed for the matched conditions. + Actions []*AccessControlListAction + + // Type of IP Address. IPv4 or IPv6 + IPAddressType *IPAddressType + + // List of the match conditions. + MatchConditions []*AccessControlListMatchCondition + + // The name of the match configuration. + MatchConfigurationName *string + + // Sequence Number of the match configuration. + SequenceNumber *int64 } -// AccessControlListPatch - The AccessControlList patch resource definition. +// AccessControlListPatch - The Access Control Lists patch resource definition. type AccessControlListPatch struct { - // Resource properties. + // Access Control Lists patch properties. Properties *AccessControlListPatchProperties // Resource tags Tags map[string]*string } -// AccessControlListPatchProperties define the patchable resource properties. +// AccessControlListPatchProperties - Access Control Lists patch properties. type AccessControlListPatchProperties struct { - // IP address family. Example: ipv4 | ipv6. - AddressFamily *AddressFamily + // Access Control List file URL. + ACLsURL *string // Switch configuration description. Annotation *string - // Access Control List conditions. - Conditions []*AccessControlListConditionProperties + // Input method to configure Access Control List. + ConfigurationType *ConfigurationType + + // List of dynamic match configurations. + DynamicMatchConfigurations []*CommonDynamicMatchConfiguration + + // List of match configurations. + MatchConfigurations []*AccessControlListMatchConfiguration } -// AccessControlListProperties define the resource properties. -type AccessControlListProperties struct { - // REQUIRED; IP address family. Example: ipv4 | ipv6. - AddressFamily *AddressFamily +// AccessControlListPortCondition - Defines the port condition that needs to be matched. +type AccessControlListPortCondition struct { + // REQUIRED; Layer4 protocol type that needs to be matched. + Layer4Protocol *Layer4Protocol - // REQUIRED; Access Control List conditions. - Conditions []*AccessControlListConditionProperties + // List of protocol flags that needs to be matched. + Flags []*string + + // List of the port Group Names that to be matched. + PortGroupNames []*string + + // Port type that needs to be matched. + PortType *PortType + + // List of the Ports that need to be matched. + Ports []*string +} + +// AccessControlListProperties - Access Control List Properties defines the resource properties. +type AccessControlListProperties struct { + // Access Control List file URL. + ACLsURL *string // Switch configuration description. Annotation *string - // READ-ONLY; Gets the provisioning state of the resource. + // Input method to configure Access Control List. + ConfigurationType *ConfigurationType + + // List of dynamic match configurations. + DynamicMatchConfigurations []*CommonDynamicMatchConfiguration + + // List of match configurations. + MatchConfigurations []*AccessControlListMatchConfiguration + + // READ-ONLY; Administrative state of the resource. + AdministrativeState *AdministrativeState + + // READ-ONLY; Configuration state of the resource. + ConfigurationState *ConfigurationState + + // READ-ONLY; The last synced timestamp. + LastSyncedTime *time.Time + + // READ-ONLY; Provisioning state of the resource. ProvisioningState *ProvisioningState } -// AccessControlListsClientCreateOptions contains the optional parameters for the AccessControlListsClient.Create method. -type AccessControlListsClientCreateOptions struct { - // placeholder for future optional parameters +// AccessControlListsClientBeginCreateOptions contains the optional parameters for the AccessControlListsClient.BeginCreate +// method. +type AccessControlListsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } -// AccessControlListsClientDeleteOptions contains the optional parameters for the AccessControlListsClient.Delete method. -type AccessControlListsClientDeleteOptions struct { - // placeholder for future optional parameters +// AccessControlListsClientBeginDeleteOptions contains the optional parameters for the AccessControlListsClient.BeginDelete +// method. +type AccessControlListsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccessControlListsClientBeginResyncOptions contains the optional parameters for the AccessControlListsClient.BeginResync +// method. +type AccessControlListsClientBeginResyncOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccessControlListsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the AccessControlListsClient.BeginUpdateAdministrativeState +// method. +type AccessControlListsClientBeginUpdateAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccessControlListsClientBeginUpdateOptions contains the optional parameters for the AccessControlListsClient.BeginUpdate +// method. +type AccessControlListsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccessControlListsClientBeginValidateConfigurationOptions contains the optional parameters for the AccessControlListsClient.BeginValidateConfiguration +// method. +type AccessControlListsClientBeginValidateConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } // AccessControlListsClientGetOptions contains the optional parameters for the AccessControlListsClient.Get method. @@ -143,76 +226,68 @@ type AccessControlListsClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// AccessControlListsClientUpdateOptions contains the optional parameters for the AccessControlListsClient.Update method. -type AccessControlListsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// AccessControlListsListResult - List of AccessControlLists. +// AccessControlListsListResult - List of Access Control Lists. type AccessControlListsListResult struct { // Url to follow for getting next page of resources. NextLink *string - // List of AccessControlList resources. + // List of Access Control List resources. Value []*AccessControlList } // ActionIPCommunityProperties - IP Community Properties. type ActionIPCommunityProperties struct { - // IP Community ID list properties. + // List of IP Community IDs. Add *IPCommunityIDList - // IP Community ID list properties. + // List of IP Community IDs. Delete *IPCommunityIDList - // IP Community ID list properties. + // List of IP Community IDs. Set *IPCommunityIDList } // ActionIPExtendedCommunityProperties - IP Extended Community Properties. type ActionIPExtendedCommunityProperties struct { - // IP Extended Community Id list properties. + // List of IP Extended Community IDs. Add *IPExtendedCommunityIDList - // IP Extended Community Id list properties. + // List of IP Extended Community IDs. Delete *IPExtendedCommunityIDList - // IP Extended Community Id list properties. + // List of IP Extended Community IDs. Set *IPExtendedCommunityIDList } -// AggregateRoute - Aggregate Route properties. +// AggregateRoute - aggregateIpv4Route model. type AggregateRoute struct { - // Prefix of the aggregate Route. + // REQUIRED; IPv4 Prefix of the aggregate Ipv4Route. Prefix *string } -// AggregateRouteConfiguration - List of IPv4 and IPv6 route configurations. +// AggregateRouteConfiguration - List of IPv4 and IPv6 aggregate routes. type AggregateRouteConfiguration struct { // List of IPv4 Route prefixes. IPv4Routes []*AggregateRoute - // List of IPv6 Routes prefixes. + // List of Ipv6Routes prefixes. IPv6Routes []*AggregateRoute } // BfdConfiguration - BFD configuration properties type BfdConfiguration struct { - // READ-ONLY; Administrative state of the BfdConfiguration. Example: Enabled | Disabled. - AdministrativeState *EnabledDisabledState + // Interval in milliseconds. Example: 300. + IntervalInMilliSeconds *int32 - // READ-ONLY; interval in milliseconds. Example: 300. - Interval *int32 - - // READ-ONLY; Multiplier for the Bfd Configuration. Example: 3. + // Multiplier for the Bfd Configuration. Example: 5. Multiplier *int32 + + // READ-ONLY; Administrative state of the BfdConfiguration. Example: Enabled | Disabled. + AdministrativeState *BfdAdministrativeState } // BgpConfiguration - BGP configuration properties type BgpConfiguration struct { - // REQUIRED; Peer ASN. Example: 65047. - PeerASN *int32 - // 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. AllowAS *int32 @@ -229,29 +304,87 @@ type BgpConfiguration struct { // Originate a defaultRoute. Ex: "True" | "False". DefaultRouteOriginate *BooleanEnumProperty - // BGP Ipv4 ListenRange. + // List of BGP IPv4 Listen Range prefixes. IPv4ListenRangePrefixes []*string - // List with stringified ipv4NeighborAddresses. + // List with stringified IPv4 Neighbor Addresses. IPv4NeighborAddress []*NeighborAddress - // BGP Ipv6 ListenRange. + // List of BGP IPv6 Listen Ranges prefixes. IPv6ListenRangePrefixes []*string // List with stringified IPv6 Neighbor Address. IPv6NeighborAddress []*NeighborAddress + // Peer ASN. Example: 65047. + PeerASN *int64 + // READ-ONLY; ASN of Network Fabric. Example: 65048. - FabricASN *int32 + FabricASN *int64 +} + +// CommonDynamicMatchConfiguration - Dynamic match configuration object. +type CommonDynamicMatchConfiguration struct { + // List of IP Groups. + IPGroups []*IPGroupProperties + + // List of the port group. + PortGroups []*PortGroupProperties + + // List of vlan groups. + VlanGroups []*VlanGroupProperties +} + +// CommonPostActionResponseForDeviceUpdate - Common response for device updates. +type CommonPostActionResponseForDeviceUpdate struct { + // The error object. + Error *ErrorDetail + + // List of ARM Resource IDs for which the given action failed to apply. + FailedDevices []*string + + // List of ARM Resource IDs for which the given action applied successfully. + SuccessfulDevices []*string + + // READ-ONLY; Gets the configuration state. + ConfigurationState *ConfigurationState +} + +// CommonPostActionResponseForStateUpdate - Common response for the state updates. +type CommonPostActionResponseForStateUpdate struct { + // The error object. + Error *ErrorDetail + + // READ-ONLY; Gets the configuration state. + ConfigurationState *ConfigurationState } // ConnectedSubnet - Connected Subnet properties. type ConnectedSubnet struct { + // REQUIRED; Prefix of the Connected Subnet. + Prefix *string + // Switch configuration description. Annotation *string +} - // Prefix of the connected Subnet. - Prefix *string +// ConnectedSubnetRoutePolicy - Connected Subnet Route Policy properties. +type ConnectedSubnetRoutePolicy struct { + // Array of ARM Resource ID of the RoutePolicies. + ExportRoutePolicy *L3ExportRoutePolicy + + // ARM Resource ID of the Route Policy. This is used for the backward compatibility. + ExportRoutePolicyID *string +} + +// ControllerServices - Network Fabric Controller services. +type ControllerServices struct { + // The IPv4 Address space is optional, if the value is not defined at the time of NFC creation, then the default value 10.0.0.0/19 + // is considered. The IPV4 address subnet is an optional attribute. + IPv4AddressSpaces []*string + + // The IPv6 is not supported right now. + IPv6AddressSpaces []*string } // DeviceInterfaceProperties - Network device interface properties. @@ -266,31 +399,49 @@ type DeviceInterfaceProperties struct { SupportedConnectorTypes []*SupportedConnectorProperties } -// DeviceLimits - Network device limits. -type DeviceLimits struct { - // Maximum number of Bidirectional Forwarding Detection (BFD) peers. - MaxBidirectionalForwardingDetectionPeers *int32 +// ErrorAdditionalInfo - The resource management error additional info. +type ErrorAdditionalInfo struct { + // READ-ONLY; The additional info. + Info any + + // READ-ONLY; The additional info type. + Type *string +} - // Maximum number of Border Gateway Protocol (BGP) peers. - MaxBorderGatewayProtocolPeers *int32 +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo - // Maximum number of sub-interfaces. - MaxSubInterfaces *int32 + // READ-ONLY; The error code. + Code *string - // Maximum number of tunnel interfaces. - MaxTunnelInterfaces *int32 + // READ-ONLY; The error details. + Details []*ErrorDetail - // Maximum number of virtual router functions. - MaxVirtualRouterFunctions *int32 + // READ-ONLY; The error message. + Message *string - // Maximum number of physical interfaces. - PhysicalInterfaceCount *int32 + // READ-ONLY; The error target. + Target *string } -// EnableDisableOnResources - Update administrative state on list of resources. -type EnableDisableOnResources struct { - // Network Fabrics or Network Rack resource Id. - ResourceIDs []*string +// ExportRoutePolicy - Export Route Policy either IPv4 or IPv6. +type ExportRoutePolicy struct { + // ARM resource ID of RoutePolicy. + ExportIPv4RoutePolicyID *string + + // ARM resource ID of RoutePolicy. + ExportIPv6RoutePolicyID *string +} + +// ExportRoutePolicyInformation - Export Route Policy Configuration. +type ExportRoutePolicyInformation struct { + // Export IPv4 Route Policy Id. + ExportIPv4RoutePolicyID *string + + // Export IPv6 Route Policy Id. + ExportIPv6RoutePolicyID *string } // ExpressRouteConnectionInformation - The ExpressRoute circuit ID and the Auth Key are required for you to successfully deploy @@ -305,12 +456,12 @@ type ExpressRouteConnectionInformation struct { ExpressRouteCircuitID *string } -// ExternalNetwork - Defines the ExternalNetwork item. +// ExternalNetwork - Defines the External Network resource. type ExternalNetwork struct { // REQUIRED; Resource properties. Properties *ExternalNetworkProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -334,22 +485,64 @@ type ExternalNetworkPatchProperties struct { // Switch configuration description. Annotation *string - // ARM resource ID of exportRoutePolicy. + // Export Route Policy either IPv4 or IPv6. + ExportRoutePolicy *ExportRoutePolicy + + // ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. ExportRoutePolicyID *string - // ARM resource ID of importRoutePolicy. + // Import Route Policy either IPv4 or IPv6. + ImportRoutePolicy *ImportRoutePolicy + + // ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. ImportRoutePolicyID *string // option A properties object - OptionAProperties *Layer3OptionAProperties + OptionAProperties *ExternalNetworkPatchPropertiesOptionAProperties // option B properties object - OptionBProperties *OptionBProperties + OptionBProperties *L3OptionBProperties // Peering option list. PeeringOption *PeeringOption } +// ExternalNetworkPatchPropertiesOptionAProperties - option A properties object +type ExternalNetworkPatchPropertiesOptionAProperties struct { + // BFD configuration properties + BfdConfiguration *BfdConfiguration + + // Egress Acl. ARM resource ID of Access Control Lists. + EgressACLID *string + + // Ingress Acl. ARM resource ID of Access Control Lists. + IngressACLID *string + + // MTU to use for option A peering. + Mtu *int32 + + // Peer ASN number.Example : 28 + PeerASN *int64 + + // IPv4 Address Prefix. + PrimaryIPv4Prefix *string + + // IPv6 Address Prefix. + PrimaryIPv6Prefix *string + + // Secondary IPv4 Address Prefix. + SecondaryIPv4Prefix *string + + // Secondary IPv6 Address Prefix. + SecondaryIPv6Prefix *string + + // Vlan identifier. Example : 501 + VlanID *int32 + + // READ-ONLY; Fabric ASN number. Example 65001 + FabricASN *int64 +} + // ExternalNetworkProperties - External Network Properties. type ExternalNetworkProperties struct { // REQUIRED; Peering option list. @@ -358,28 +551,34 @@ type ExternalNetworkProperties struct { // Switch configuration description. Annotation *string - // ARM resource ID of exportRoutePolicy. + // Export Route Policy either IPv4 or IPv6. + ExportRoutePolicy *ExportRoutePolicy + + // ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. ExportRoutePolicyID *string - // ARM resource ID of importRoutePolicy. + // Import Route Policy either IPv4 or IPv6. + ImportRoutePolicy *ImportRoutePolicy + + // ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. ImportRoutePolicyID *string // option A properties object OptionAProperties *ExternalNetworkPropertiesOptionAProperties // option B properties object - OptionBProperties *OptionBProperties + OptionBProperties *L3OptionBProperties - // READ-ONLY; AdministrativeState of the externalNetwork. Example: Enabled | Disabled. - AdministrativeState *EnabledDisabledState + // READ-ONLY; Administrative state of the resource. + AdministrativeState *AdministrativeState - // READ-ONLY; List of resources the externalNetwork is disabled on. Can be either entire NetworkFabric or NetworkRack. - DisabledOnResources []*string + // READ-ONLY; Configuration state of the resource. + ConfigurationState *ConfigurationState // READ-ONLY; Gets the networkToNetworkInterconnectId of the resource. NetworkToNetworkInterconnectID *string - // READ-ONLY; Gets the provisioning state of the resource. + // READ-ONLY; Provisioning state of the resource. ProvisioningState *ProvisioningState } @@ -388,55 +587,35 @@ type ExternalNetworkPropertiesOptionAProperties struct { // BFD configuration properties BfdConfiguration *BfdConfiguration + // Egress Acl. ARM resource ID of Access Control Lists. + EgressACLID *string + + // Ingress Acl. ARM resource ID of Access Control Lists. + IngressACLID *string + // MTU to use for option A peering. Mtu *int32 // Peer ASN number.Example : 28 - PeerASN *int32 + PeerASN *int64 - // IPv4 Address Prefix of CE-PE interconnect links. Example: 172.31.0.0/31. The values can be specified at the time of creation - // or can be updated afterwards. Any update to the values post-provisioning - // may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. The 2nd and 4th IPs - // are to be configured on PE1 and PE2 for Option B interfaces. + // IPv4 Address Prefix. PrimaryIPv4Prefix *string - // IPv6 Address Prefix of CE-PE interconnect links. Example: 3FFE:FFFF:0:CD30::a0/126. The values can be specified at the - // time of creation or can be updated afterwards. Any update to the values - // post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. - // The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + // IPv6 Address Prefix. PrimaryIPv6Prefix *string - // Secondary IPv4 Address Prefix of CE-PE interconnect links. Example: 172.31.0.20/31. The values can be specified at the - // time of creation or can be updated afterwards. Any update to the values - // post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. - // The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + // Secondary IPv4 Address Prefix. SecondaryIPv4Prefix *string - // Secondary IPv6 Address Prefix of CE-PE interconnect links. Example: 3FFE:FFFF:0:CD30::a4/126. The values can be specified - // at the time of creation or can be updated afterwards. Any update to the values - // post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. - // The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + // Secondary IPv6 Address Prefix. SecondaryIPv6Prefix *string // Vlan identifier. Example : 501 VlanID *int32 // READ-ONLY; Fabric ASN number. Example 65001 - FabricASN *int32 -} - -// ExternalNetworksClientBeginClearArpEntriesOptions contains the optional parameters for the ExternalNetworksClient.BeginClearArpEntries -// method. -type ExternalNetworksClientBeginClearArpEntriesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExternalNetworksClientBeginClearIPv6NeighborsOptions contains the optional parameters for the ExternalNetworksClient.BeginClearIPv6Neighbors -// method. -type ExternalNetworksClientBeginClearIPv6NeighborsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string + FabricASN *int64 } // ExternalNetworksClientBeginCreateOptions contains the optional parameters for the ExternalNetworksClient.BeginCreate method. @@ -458,22 +637,15 @@ type ExternalNetworksClientBeginUpdateAdministrativeStateOptions struct { ResumeToken string } -// ExternalNetworksClientBeginUpdateBfdForBgpAdministrativeStateOptions contains the optional parameters for the ExternalNetworksClient.BeginUpdateBfdForBgpAdministrativeState -// method. -type ExternalNetworksClientBeginUpdateBfdForBgpAdministrativeStateOptions struct { +// ExternalNetworksClientBeginUpdateOptions contains the optional parameters for the ExternalNetworksClient.BeginUpdate method. +type ExternalNetworksClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// ExternalNetworksClientBeginUpdateBgpAdministrativeStateOptions contains the optional parameters for the ExternalNetworksClient.BeginUpdateBgpAdministrativeState +// ExternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions contains the optional parameters for the ExternalNetworksClient.BeginUpdateStaticRouteBfdAdministrativeState // method. -type ExternalNetworksClientBeginUpdateBgpAdministrativeStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExternalNetworksClientBeginUpdateOptions contains the optional parameters for the ExternalNetworksClient.BeginUpdate method. -type ExternalNetworksClientBeginUpdateOptions struct { +type ExternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } @@ -483,89 +655,21 @@ type ExternalNetworksClientGetOptions struct { // placeholder for future optional parameters } -// ExternalNetworksClientListOptions contains the optional parameters for the ExternalNetworksClient.NewListPager method. -type ExternalNetworksClientListOptions struct { +// ExternalNetworksClientListByL3IsolationDomainOptions contains the optional parameters for the ExternalNetworksClient.NewListByL3IsolationDomainPager +// method. +type ExternalNetworksClientListByL3IsolationDomainOptions struct { // placeholder for future optional parameters } -// ExternalNetworksList - List of ExternalNetworks. +// ExternalNetworksList - List of External Networks. type ExternalNetworksList struct { // Url to follow for getting next page of resources. NextLink *string - // List of ExternalNetworks resources. + // List of External Network resources. Value []*ExternalNetwork } -// FabricBfdConfiguration - BFD Configuration properties. -type FabricBfdConfiguration struct { - // READ-ONLY; interval in seconds. Example: 300. - Interval *int32 - - // READ-ONLY; multiplier. Example: 3. - Multiplier *int32 -} - -// GetDeviceStatusProperties - Get Device status response properties. -type GetDeviceStatusProperties struct { - // REQUIRED; Primary or Secondary power end. - OperationalStatus *OperationalStatus - - // REQUIRED; On or Off power cycle state. - PowerCycleState *PowerCycleState - - // REQUIRED; The serial number of the device - SerialNumber *string -} - -// GetDynamicInterfaceMapsPropertiesItem - Get Device static interface maps as per topology. -type GetDynamicInterfaceMapsPropertiesItem struct { - // Connected to ARM resource or external interface - ConnectedTo *string - - // The interface name. - Name *string - - // The interface operational status. - OperationalStatus *string - - // The physical status. - PhyStatus *string - - // The interface transceiver type. Example: up or down - TransceiverStatus *string - - // READ-ONLY; The interface administrative state. - AdministrativeState *EnabledDisabledState -} - -// GetStaticInterfaceMapsPropertiesItem - Get Device static interface maps as per topology. -type GetStaticInterfaceMapsPropertiesItem struct { - // The port channel group id. - ChannelGroupID *float32 - - // Connected to ARM resource or external interface - ConnectedTo *string - - // The physical cable connector type. Example: Optical - ConnectorType *string - - // The interface description. - Description *string - - // The interface identifier. - Identifier *string - - // The interface type. Example: Ethernet - InterfaceType *string - - // The interface name. - Name *string - - // The interface speed. Example: 100 - Speed *float32 -} - // IPCommunitiesClientBeginCreateOptions contains the optional parameters for the IPCommunitiesClient.BeginCreate method. type IPCommunitiesClientBeginCreateOptions struct { // Resumes the LRO from the provided token. @@ -601,27 +705,27 @@ type IPCommunitiesClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// IPCommunitiesListResult - List of IPCommunities. +// IPCommunitiesListResult - List of IP Communities. type IPCommunitiesListResult struct { // Url to follow for getting next page of resources. NextLink *string - // List of IpCommunity resources. + // List of IP Community resources. Value []*IPCommunity } -// IPCommunity - The IpCommunity resource definition. +// IPCommunity - The IP Community resource definition. type IPCommunity struct { // REQUIRED; The geo-location where the resource lives Location *string - // Resource properties. + // REQUIRED; Resource properties. Properties *IPCommunityProperties // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -640,28 +744,54 @@ type IPCommunityIDList struct { IPCommunityIDs []*string } -// IPCommunityPatch - The IPCommunity patch resource definition. +// IPCommunityPatch - The IP Community patch resource definition. type IPCommunityPatch struct { + // IP Community patchable properties. + Properties *IPCommunityPatchableProperties + // Resource tags Tags map[string]*string } -// IPCommunityProperties - IpCommunityProperties define the resource properties. +// IPCommunityPatchableProperties - IP Community patchable properties. +type IPCommunityPatchableProperties struct { + // List of IP Community Rules. + IPCommunityRules []*IPCommunityRule +} + +// IPCommunityProperties - IP Community Properties defines the resource properties. type IPCommunityProperties struct { + // Switch configuration description. + Annotation *string + + // List of IP Community Rules. + IPCommunityRules []*IPCommunityRule + + // READ-ONLY; Administrative state of the resource. + AdministrativeState *AdministrativeState + + // READ-ONLY; Configuration state of the resource. + ConfigurationState *ConfigurationState + + // READ-ONLY; Provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// IPCommunityRule - IP Community patchable properties. +type IPCommunityRule struct { // REQUIRED; Action to be taken on the configuration. Example: Permit | Deny. Action *CommunityActionTypes - // REQUIRED; List the communityMembers of IP Community . + // REQUIRED; List the community members of IP Community. CommunityMembers []*string - // Switch configuration description. - Annotation *string + // REQUIRED; Sequence to insert to/delete from existing route. Prefix lists are evaluated starting with the lowest sequence + // number and continue down the list until a match is made. Once a match is made, the permit + // or deny statement is applied to that network and the rest of the list is ignored. + SequenceNumber *int64 // Supported well known Community List. WellKnownCommunities []*WellKnownCommunities - - // READ-ONLY; Gets the provisioning state of the resource. - ProvisioningState *ProvisioningState } // IPExtendedCommunitiesClientBeginCreateOptions contains the optional parameters for the IPExtendedCommunitiesClient.BeginCreate @@ -702,18 +832,18 @@ type IPExtendedCommunitiesClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// IPExtendedCommunity - The IpExtendedCommunity resource definition. +// IPExtendedCommunity - The IP Extended Community resource definition. type IPExtendedCommunity struct { // REQUIRED; The geo-location where the resource lives Location *string - // Resource properties. + // REQUIRED; Resource properties. Properties *IPExtendedCommunityProperties // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -732,23 +862,53 @@ type IPExtendedCommunityIDList struct { IPExtendedCommunityIDs []*string } -// IPExtendedCommunityListResult - List of IpExtendedCommunities. +// IPExtendedCommunityListResult - List of IP Extended Communities. type IPExtendedCommunityListResult struct { // Url to follow for getting next page of resources. NextLink *string - // List of IpExtendedCommunities resources. + // List of IP Extended Communities resources. Value []*IPExtendedCommunity } -// IPExtendedCommunityPatch - The IpExtendedCommunities patch resource definition. +// IPExtendedCommunityPatch - The IP Extended Communities patch resource definition. type IPExtendedCommunityPatch struct { + // IP Extended Community patchable properties. + Properties *IPExtendedCommunityPatchProperties + // Resource tags Tags map[string]*string } -// IPExtendedCommunityProperties - IpExtendedCommunityProperties define the resource properties. +// IPExtendedCommunityPatchProperties - IP Extended Community patchable properties. +type IPExtendedCommunityPatchProperties struct { + // REQUIRED; List of IP Extended Community Rules. + IPExtendedCommunityRules []*IPExtendedCommunityRule + + // Switch configuration description. + Annotation *string +} + +// IPExtendedCommunityProperties - IP Extended Community Properties defines the resource properties. type IPExtendedCommunityProperties struct { + // REQUIRED; List of IP Extended Community Rules. + IPExtendedCommunityRules []*IPExtendedCommunityRule + + // Switch configuration description. + Annotation *string + + // READ-ONLY; Administrative state of the resource. + AdministrativeState *AdministrativeState + + // READ-ONLY; Configuration state of the resource. + ConfigurationState *ConfigurationState + + // READ-ONLY; Provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// IPExtendedCommunityRule - List of IP Extended Community Rules. +type IPExtendedCommunityRule struct { // REQUIRED; Action to be taken on the configuration. Example: Permit | Deny. Action *CommunityActionTypes @@ -757,14 +917,40 @@ type IPExtendedCommunityProperties struct { // in range of 0-65535, ASN(plain) is in range of 0-4294967295. RouteTargets []*string - // Switch configuration description. - Annotation *string + // REQUIRED; Sequence to insert to/delete from existing route. Prefix lists are evaluated starting with the lowest sequence + // number and continue down the list until a match is made. Once a match is made, the permit + // or deny statement is applied to that network and the rest of the list is ignored. + SequenceNumber *int64 +} - // READ-ONLY; Gets the provisioning state of the resource. - ProvisioningState *ProvisioningState +// IPGroupProperties - IP Group properties. +type IPGroupProperties struct { + // IP Address type. + IPAddressType *IPAddressType + + // List of IP Prefixes. + IPPrefixes []*string + + // IP Group name. + Name *string +} + +// IPMatchCondition - Defines the condition that can be filtered using the selected IPs. +type IPMatchCondition struct { + // The List of IP Group Names that need to be matched. + IPGroupNames []*string + + // The list of IP Prefixes. + IPPrefixValues []*string + + // IP Prefix Type. + PrefixType *PrefixType + + // IP Address type. + Type *SourceDestinationType } -// IPPrefix - The IPPrefix resource definition. +// IPPrefix - The IP Prefix resource definition. type IPPrefix struct { // REQUIRED; The geo-location where the resource lives Location *string @@ -775,7 +961,7 @@ type IPPrefix struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -788,29 +974,48 @@ type IPPrefix struct { Type *string } -// IPPrefixPatch - The IPPrefix patch resource definition. +// IPPrefixPatch - The IP Prefix patch resource definition. type IPPrefixPatch struct { + // IP Prefix patchable properties. + Properties *IPPrefixPatchProperties + // Resource tags Tags map[string]*string } -// IPPrefixProperties - IpPrefixProperties define the resource properties. -type IPPrefixProperties struct { - // REQUIRED; IpPrefix contains the list of IP PrefixRules objects. - IPPrefixRules []*IPPrefixPropertiesIPPrefixRulesItem - +// IPPrefixPatchProperties - IP Prefix patchable properties. +type IPPrefixPatchProperties struct { // Switch configuration description. Annotation *string - // READ-ONLY; Gets the provisioning state of the resource. - ProvisioningState *ProvisioningState + // The list of IP Prefix Rules. + IPPrefixRules []*IPPrefixRule } -type IPPrefixPropertiesIPPrefixRulesItem struct { - // REQUIRED; Action to be taken on the configuration. Example: Permit | Deny. - Action *CommunityActionTypes - - // REQUIRED; Network Prefix specifying IPv4/IPv6 packets to be permitted or denied. Example: 1.1.1.0/24 | 3FFE:FFFF:0:CD30::/126 +// IPPrefixProperties - IP Prefix Properties defines the properties of the resource. +type IPPrefixProperties struct { + // Switch configuration description. + Annotation *string + + // The list of IP Prefix Rules. + IPPrefixRules []*IPPrefixRule + + // READ-ONLY; Administrative state of the resource. + AdministrativeState *AdministrativeState + + // READ-ONLY; Configuration state of the resource. + ConfigurationState *ConfigurationState + + // READ-ONLY; Provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// IPPrefixRule - IP Prefix Rule properties. +type IPPrefixRule struct { + // REQUIRED; Action to be taken on the configuration. Example: Permit | Deny. + Action *CommunityActionTypes + + // REQUIRED; Network Prefix specifying IPv4/IPv6 packets to be permitted or denied. Example: 1.1.1.0/24 | 3FFE:FFFF:0:CD30::/126 NetworkPrefix *string // REQUIRED; Sequence to insert to/delete from existing route. Prefix lists are evaluated starting with the lowest sequence @@ -821,9 +1026,9 @@ type IPPrefixPropertiesIPPrefixRulesItem struct { // Specify prefix-list bounds. Condition *Condition - // SubnetMaskLength gives the minimum NetworkPrefix length to be matched.Possible values for IPv4 are 1 - 32. Possible values + // SubnetMaskLength gives the minimum NetworkPrefix length to be matched. Possible values for IPv4 are 1 - 32 . Possible values // of IPv6 are 1 - 128. - SubnetMaskLength *int32 + SubnetMaskLength *string } // IPPrefixesClientBeginCreateOptions contains the optional parameters for the IPPrefixesClient.BeginCreate method. @@ -861,49 +1066,39 @@ type IPPrefixesClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// IPPrefixesListResult - List of IpPrefixes. +// IPPrefixesListResult - List of IP Prefixes. type IPPrefixesListResult struct { // Url to follow for getting next page of resources. NextLink *string - // List of IPPrefix resources. + // List of IP Prefix resources. Value []*IPPrefix } -// InfrastructureServices IP ranges. -type InfrastructureServices struct { - // The IPv4 Address space is optional, if the value is not defined at the time of NFC creation, then the default value 10.0.0.0/19 - // is considered. The IPV4 address subnet is an optional attribute. - IPv4AddressSpaces []*string +// ImportRoutePolicy - Import Route Policy either IPv4 or IPv6. +type ImportRoutePolicy struct { + // ARM resource ID of RoutePolicy. + ImportIPv4RoutePolicyID *string - // The IPv6 is not supported right now. - IPv6AddressSpaces []*string + // ARM resource ID of RoutePolicy. + ImportIPv6RoutePolicyID *string } -// InterfaceStatus - Interface running status properties -type InterfaceStatus struct { - // Connected to ARM resource or external interface - ConnectedTo *string - - // The interface operational status. - OperationalStatus *string - - // The physical status. - PhyStatus *string +// ImportRoutePolicyInformation - Import Route Policy Configuration. +type ImportRoutePolicyInformation struct { + // Import IPv4 Route Policy Id. + ImportIPv4RoutePolicyID *string - // The interface transceiver type. Example: up or down - TransceiverStatus *string - - // READ-ONLY; The interface administrative state. - AdministrativeState *EnabledDisabledState + // Import IPv6 Route Policy Id. + ImportIPv6RoutePolicyID *string } -// InternalNetwork - Defines the InternalNetwork item. +// InternalNetwork - Defines the Internal Network resource. type InternalNetwork struct { // REQUIRED; Resource properties. Properties *InternalNetworkProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -927,21 +1122,36 @@ type InternalNetworkPatchProperties struct { // Switch configuration description. Annotation *string - // BGP configuration properties + // BGP configuration properties. BgpConfiguration *BgpConfiguration - // List with object connected IPv4 Subnets. + // List of Connected IPv4 Subnets. ConnectedIPv4Subnets []*ConnectedSubnet - // List with object connected IPv6 Subnets. + // List of connected IPv6 Subnets. ConnectedIPv6Subnets []*ConnectedSubnet - // ARM resource ID of importRoutePolicy. + // Egress Acl. ARM resource ID of Access Control Lists. + EgressACLID *string + + // Export Route Policy either IPv4 or IPv6. + ExportRoutePolicy *ExportRoutePolicy + + // ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. ExportRoutePolicyID *string - // ARM resource ID of importRoutePolicy. + // Import Route Policy either IPv4 or IPv6. + ImportRoutePolicy *ImportRoutePolicy + + // ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. ImportRoutePolicyID *string + // Ingress Acl. ARM resource ID of Access Control Lists. + IngressACLID *string + + // To check whether monitoring of internal network is enabled or not. + IsMonitoringEnabled *IsMonitoringEnabled + // Maximum transmission unit. Default value is 1500. Mtu *int32 @@ -949,7 +1159,7 @@ type InternalNetworkPatchProperties struct { StaticRouteConfiguration *StaticRouteConfiguration } -// InternalNetworkProperties - Internal Network Properties +// InternalNetworkProperties - Internal Network Properties defines the properties of the resource. type InternalNetworkProperties struct { // REQUIRED; Vlan identifier. Example: 1001. VlanID *int32 @@ -957,137 +1167,386 @@ type InternalNetworkProperties struct { // Switch configuration description. Annotation *string - // BGP configuration properties - BgpConfiguration *BgpConfiguration + // BGP configuration properties. + BgpConfiguration *InternalNetworkPropertiesBgpConfiguration - // List with object connected IPv4 Subnets. + // List of Connected IPv4 Subnets. ConnectedIPv4Subnets []*ConnectedSubnet - // List with object connected IPv6 Subnets. + // List of connected IPv6 Subnets. ConnectedIPv6Subnets []*ConnectedSubnet - // ARM resource ID of importRoutePolicy. + // Egress Acl. ARM resource ID of Access Control Lists. + EgressACLID *string + + // Export Route Policy either IPv4 or IPv6. + ExportRoutePolicy *ExportRoutePolicy + + // ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. ExportRoutePolicyID *string - // ARM resource ID of importRoutePolicy. + // Extension. Example: NoExtension | NPB. + Extension *Extension + + // Import Route Policy either IPv4 or IPv6. + ImportRoutePolicy *ImportRoutePolicy + + // ARM Resource ID of the RoutePolicy. This is used for the backward compatibility. ImportRoutePolicyID *string + // Ingress Acl. ARM resource ID of Access Control Lists. + IngressACLID *string + + // To check whether monitoring of internal network is enabled or not. + IsMonitoringEnabled *IsMonitoringEnabled + // Maximum transmission unit. Default value is 1500. Mtu *int32 // Static Route Configuration properties. - StaticRouteConfiguration *StaticRouteConfiguration + StaticRouteConfiguration *InternalNetworkPropertiesStaticRouteConfiguration - // READ-ONLY; Administrative state of the InternalNetwork. Example: Enabled | Disabled. - AdministrativeState *EnabledDisabledState + // READ-ONLY; Administrative state of the resource. + AdministrativeState *AdministrativeState - // READ-ONLY; List of resources the BFD for BGP is disabled on. Can be either entire NetworkFabric or NetworkRack. - BfdDisabledOnResources []*string + // READ-ONLY; Configuration state of the resource. + ConfigurationState *ConfigurationState - // READ-ONLY; List of resources the BFD of StaticRoutes is disabled on. Can be either entire NetworkFabric or NetworkRack. - BfdForStaticRoutesDisabledOnResources []*string + // READ-ONLY; Provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// InternalNetworkPropertiesBgpConfiguration - BGP configuration properties. +type InternalNetworkPropertiesBgpConfiguration struct { + // 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. + AllowAS *int32 - // READ-ONLY; List of resources the BGP is disabled on. Can be either entire NetworkFabric or NetworkRack. - BgpDisabledOnResources []*string + // Enable Or Disable state. + AllowASOverride *AllowASOverride - // READ-ONLY; List of resources the InternalNetwork is disabled on. Can be either entire NetworkFabric or NetworkRack. - DisabledOnResources []*string + // Switch configuration description. + Annotation *string - // READ-ONLY; Gets the provisioning state of the resource. - ProvisioningState *ProvisioningState + // BFD configuration properties + BfdConfiguration *BfdConfiguration + + // Originate a defaultRoute. Ex: "True" | "False". + DefaultRouteOriginate *BooleanEnumProperty + + // List of BGP IPv4 Listen Range prefixes. + IPv4ListenRangePrefixes []*string + + // List with stringified IPv4 Neighbor Addresses. + IPv4NeighborAddress []*NeighborAddress + + // List of BGP IPv6 Listen Ranges prefixes. + IPv6ListenRangePrefixes []*string + + // List with stringified IPv6 Neighbor Address. + IPv6NeighborAddress []*NeighborAddress + + // Peer ASN. Example: 65047. + PeerASN *int64 + + // READ-ONLY; ASN of Network Fabric. Example: 65048. + FabricASN *int64 } -// InternalNetworksClientBeginClearArpEntriesOptions contains the optional parameters for the InternalNetworksClient.BeginClearArpEntries +// InternalNetworkPropertiesStaticRouteConfiguration - Static Route Configuration properties. +type InternalNetworkPropertiesStaticRouteConfiguration struct { + // BFD configuration properties + BfdConfiguration *BfdConfiguration + + // Extension. Example: NoExtension | NPB. + Extension *Extension + + // List of IPv4 Routes. + IPv4Routes []*StaticRouteProperties + + // List of IPv6 Routes. + IPv6Routes []*StaticRouteProperties +} + +// InternalNetworksClientBeginCreateOptions contains the optional parameters for the InternalNetworksClient.BeginCreate method. +type InternalNetworksClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InternalNetworksClientBeginDeleteOptions contains the optional parameters for the InternalNetworksClient.BeginDelete method. +type InternalNetworksClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InternalNetworksClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdateAdministrativeState // method. -type InternalNetworksClientBeginClearArpEntriesOptions struct { +type InternalNetworksClientBeginUpdateAdministrativeStateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// InternalNetworksClientBeginClearIPv6NeighborsOptions contains the optional parameters for the InternalNetworksClient.BeginClearIPv6Neighbors +// InternalNetworksClientBeginUpdateBgpAdministrativeStateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdateBgpAdministrativeState // method. -type InternalNetworksClientBeginClearIPv6NeighborsOptions struct { +type InternalNetworksClientBeginUpdateBgpAdministrativeStateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// InternalNetworksClientBeginCreateOptions contains the optional parameters for the InternalNetworksClient.BeginCreate method. -type InternalNetworksClientBeginCreateOptions struct { +// InternalNetworksClientBeginUpdateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdate method. +type InternalNetworksClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// InternalNetworksClientBeginDeleteOptions contains the optional parameters for the InternalNetworksClient.BeginDelete method. -type InternalNetworksClientBeginDeleteOptions struct { +// InternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdateStaticRouteBfdAdministrativeState +// method. +type InternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// InternalNetworksClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdateAdministrativeState +// InternalNetworksClientGetOptions contains the optional parameters for the InternalNetworksClient.Get method. +type InternalNetworksClientGetOptions struct { + // placeholder for future optional parameters +} + +// InternalNetworksClientListByL3IsolationDomainOptions contains the optional parameters for the InternalNetworksClient.NewListByL3IsolationDomainPager // method. -type InternalNetworksClientBeginUpdateAdministrativeStateOptions struct { +type InternalNetworksClientListByL3IsolationDomainOptions struct { + // placeholder for future optional parameters +} + +// InternalNetworksList - List of Internal Networks. +type InternalNetworksList struct { + // Url to follow for getting next page of resources. + NextLink *string + + // List of Internal Network resources. + Value []*InternalNetwork +} + +// InternetGateway - The Internet Gateway resource definition. +type InternetGateway struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // REQUIRED; Resource properties. + Properties *InternetGatewayProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// InternetGatewayPatch - The Internet Gateway patch resource definition. +type InternetGatewayPatch struct { + // Resource properties. + Properties *InternetGatewayPatchableProperties + + // Resource tags + Tags map[string]*string +} + +// InternetGatewayPatchableProperties - Internet Gateway Patchable Properties defines the patchable properties of the resource. +type InternetGatewayPatchableProperties struct { + // ARM Resource ID of the Internet Gateway Rule. + InternetGatewayRuleID *string +} + +// InternetGatewayProperties - Internet Gateway Properties defines the properties of the resource. +type InternetGatewayProperties struct { + // REQUIRED; ARM Resource ID of the Network Fabric Controller. + NetworkFabricControllerID *string + + // REQUIRED; Gateway Type of the resource. + Type *GatewayType + + // Switch configuration description. + Annotation *string + + // ARM Resource ID of the Internet Gateway Rule. + InternetGatewayRuleID *string + + // READ-ONLY; IPv4 Address of Internet Gateway. + IPv4Address *string + + // READ-ONLY; Port number of Internet Gateway. + Port *int32 + + // READ-ONLY; Provisioning state of resource. + ProvisioningState *ProvisioningState +} + +// InternetGatewayRule - The Internet Gateway Rule resource definition. +type InternetGatewayRule struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // REQUIRED; Resource properties. + Properties *InternetGatewayRuleProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// InternetGatewayRulePatch - The Internet Gateway Rules patch resource definition. +type InternetGatewayRulePatch struct { + // Resource tags + Tags map[string]*string +} + +// InternetGatewayRuleProperties - Internet Gateway Rule Properties defines the resource properties. +type InternetGatewayRuleProperties struct { + // REQUIRED; Rules for the InternetGateways + RuleProperties *RuleProperties + + // Switch configuration description. + Annotation *string + + // READ-ONLY; List of Internet Gateway resource Id. + InternetGatewayIDs []*string + + // READ-ONLY; Provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// InternetGatewayRulesClientBeginCreateOptions contains the optional parameters for the InternetGatewayRulesClient.BeginCreate +// method. +type InternetGatewayRulesClientBeginCreateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// InternalNetworksClientBeginUpdateBfdForBgpAdministrativeStateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdateBfdForBgpAdministrativeState +// InternetGatewayRulesClientBeginDeleteOptions contains the optional parameters for the InternetGatewayRulesClient.BeginDelete // method. -type InternalNetworksClientBeginUpdateBfdForBgpAdministrativeStateOptions struct { +type InternetGatewayRulesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// InternalNetworksClientBeginUpdateBfdForStaticRouteAdministrativeStateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdateBfdForStaticRouteAdministrativeState +// InternetGatewayRulesClientBeginUpdateOptions contains the optional parameters for the InternetGatewayRulesClient.BeginUpdate // method. -type InternalNetworksClientBeginUpdateBfdForStaticRouteAdministrativeStateOptions struct { +type InternetGatewayRulesClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// InternalNetworksClientBeginUpdateBgpAdministrativeStateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdateBgpAdministrativeState +// InternetGatewayRulesClientGetOptions contains the optional parameters for the InternetGatewayRulesClient.Get method. +type InternetGatewayRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// InternetGatewayRulesClientListByResourceGroupOptions contains the optional parameters for the InternetGatewayRulesClient.NewListByResourceGroupPager // method. -type InternalNetworksClientBeginUpdateBgpAdministrativeStateOptions struct { +type InternetGatewayRulesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// InternetGatewayRulesClientListBySubscriptionOptions contains the optional parameters for the InternetGatewayRulesClient.NewListBySubscriptionPager +// method. +type InternetGatewayRulesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// InternetGatewayRulesListResult - List of Internet Gateway Rules. +type InternetGatewayRulesListResult struct { + // Url to follow for getting next page of resources. + NextLink *string + + // List of Internet Gateway Rule resources. + Value []*InternetGatewayRule +} + +// InternetGatewaysClientBeginCreateOptions contains the optional parameters for the InternetGatewaysClient.BeginCreate method. +type InternetGatewaysClientBeginCreateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// InternalNetworksClientBeginUpdateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdate method. -type InternalNetworksClientBeginUpdateOptions struct { +// InternetGatewaysClientBeginDeleteOptions contains the optional parameters for the InternetGatewaysClient.BeginDelete method. +type InternetGatewaysClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// InternalNetworksClientGetOptions contains the optional parameters for the InternalNetworksClient.Get method. -type InternalNetworksClientGetOptions struct { +// InternetGatewaysClientBeginUpdateOptions contains the optional parameters for the InternetGatewaysClient.BeginUpdate method. +type InternetGatewaysClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InternetGatewaysClientGetOptions contains the optional parameters for the InternetGatewaysClient.Get method. +type InternetGatewaysClientGetOptions struct { // placeholder for future optional parameters } -// InternalNetworksClientListOptions contains the optional parameters for the InternalNetworksClient.NewListPager method. -type InternalNetworksClientListOptions struct { +// InternetGatewaysClientListByResourceGroupOptions contains the optional parameters for the InternetGatewaysClient.NewListByResourceGroupPager +// method. +type InternetGatewaysClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// InternalNetworksList - List of InternalNetworks. -type InternalNetworksList struct { +// InternetGatewaysClientListBySubscriptionOptions contains the optional parameters for the InternetGatewaysClient.NewListBySubscriptionPager +// method. +type InternetGatewaysClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// InternetGatewaysListResult - List of InternetGateways. +type InternetGatewaysListResult struct { // Url to follow for getting next page of resources. NextLink *string - // List of InternalNetworks resources. - Value []*InternalNetwork + // Displays list of Internet Gateway resources. + Value []*InternetGateway +} + +// IsolationDomainProperties - Isolation Domain Properties. +type IsolationDomainProperties struct { + // Type of encapsulation. + Encapsulation *Encapsulation + + // List of Neighbor Group IDs. + NeighborGroupIDs []*string } -// L2IsolationDomain - The L2IsolationDomain resource definition. +// L2IsolationDomain - The L2 Isolation Domain resource definition. type L2IsolationDomain struct { // REQUIRED; The geo-location where the resource lives Location *string - // Resource properties. + // REQUIRED; Resource properties. Properties *L2IsolationDomainProperties // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -1100,7 +1559,7 @@ type L2IsolationDomain struct { Type *string } -// L2IsolationDomainPatch - The L2IsolationDomain patch resource definition. +// L2IsolationDomainPatch - The L2 Isolation Domain patch resource definition. type L2IsolationDomainPatch struct { // Resource properties. Properties *L2IsolationDomainPatchProperties @@ -1109,51 +1568,42 @@ type L2IsolationDomainPatch struct { Tags map[string]*string } -// L2IsolationDomainPatchProperties define the patchable resource properties. +// L2IsolationDomainPatchProperties - L2 Isolation Domain Patch Properties defines the patchable properties of the resource. type L2IsolationDomainPatchProperties struct { // Switch configuration description. Annotation *string - // maximum transmission unit. Default value is 1500. + // Maximum transmission unit. Default value is 1500. Mtu *int32 } -// L2IsolationDomainProperties define the resource properties. +// L2IsolationDomainProperties - L2Isolation Domain Properties defines the properties of the resource. type L2IsolationDomainProperties struct { - // REQUIRED; Network Fabric ARM resource id. + // REQUIRED; ARM Resource ID of the Network Fabric. NetworkFabricID *string - // REQUIRED; vlanId. Example: 501. + // REQUIRED; Vlan Identifier of the Network Fabric. Example: 501. VlanID *int32 // Switch configuration description. Annotation *string - // maximum transmission unit. Default value is 1500. + // Maximum transmission unit. Default value is 1500. Mtu *int32 - // READ-ONLY; state. Example: Enabled | Disabled. It indicates administrative state of the isolationDomain, whether it is - // enabled or disabled. If enabled, the configuration is applied on the devices. If disabled, - // the configuration is removed from the devices - AdministrativeState *EnabledDisabledState + // READ-ONLY; Administrative state of the resource. + AdministrativeState *AdministrativeState - // READ-ONLY; List of resources the L2 Isolation Domain is disabled on. Can be either entire NetworkFabric or NetworkRack. - DisabledOnResources []*string + // READ-ONLY; Configuration state of the resource. + ConfigurationState *ConfigurationState - // READ-ONLY; Gets the provisioning state of the resource. + // READ-ONLY; Provisioning state of the resource. ProvisioningState *ProvisioningState } -// L2IsolationDomainsClientBeginClearArpTableOptions contains the optional parameters for the L2IsolationDomainsClient.BeginClearArpTable -// method. -type L2IsolationDomainsClientBeginClearArpTableOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// L2IsolationDomainsClientBeginClearNeighborTableOptions contains the optional parameters for the L2IsolationDomainsClient.BeginClearNeighborTable +// L2IsolationDomainsClientBeginCommitConfigurationOptions contains the optional parameters for the L2IsolationDomainsClient.BeginCommitConfiguration // method. -type L2IsolationDomainsClientBeginClearNeighborTableOptions struct { +type L2IsolationDomainsClientBeginCommitConfigurationOptions struct { // Resumes the LRO from the provided token. ResumeToken string } @@ -1172,23 +1622,23 @@ type L2IsolationDomainsClientBeginDeleteOptions struct { ResumeToken string } -// L2IsolationDomainsClientBeginGetArpEntriesOptions contains the optional parameters for the L2IsolationDomainsClient.BeginGetArpEntries +// L2IsolationDomainsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the L2IsolationDomainsClient.BeginUpdateAdministrativeState // method. -type L2IsolationDomainsClientBeginGetArpEntriesOptions struct { +type L2IsolationDomainsClientBeginUpdateAdministrativeStateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// L2IsolationDomainsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the L2IsolationDomainsClient.BeginUpdateAdministrativeState +// L2IsolationDomainsClientBeginUpdateOptions contains the optional parameters for the L2IsolationDomainsClient.BeginUpdate // method. -type L2IsolationDomainsClientBeginUpdateAdministrativeStateOptions struct { +type L2IsolationDomainsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// L2IsolationDomainsClientBeginUpdateOptions contains the optional parameters for the L2IsolationDomainsClient.BeginUpdate +// L2IsolationDomainsClientBeginValidateConfigurationOptions contains the optional parameters for the L2IsolationDomainsClient.BeginValidateConfiguration // method. -type L2IsolationDomainsClientBeginUpdateOptions struct { +type L2IsolationDomainsClientBeginValidateConfigurationOptions struct { // Resumes the LRO from the provided token. ResumeToken string } @@ -1210,27 +1660,36 @@ type L2IsolationDomainsClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// L2IsolationDomainsListResult - List of L2IsolationDomains. +// L2IsolationDomainsListResult - List of L2 Isolation Domains. type L2IsolationDomainsListResult struct { // Url to follow for getting next page of resources. NextLink *string - // Displays list of L2IsolationDomain resources. + // Displays list of L2 Isolation Domain resources. Value []*L2IsolationDomain } -// L3IsolationDomain - The L3IsolationDomain resource definition. +// L3ExportRoutePolicy - Array of ARM Resource ID of the RoutePolicies. +type L3ExportRoutePolicy struct { + // ARM Resource ID of the RoutePolicy. + ExportIPv4RoutePolicyID *string + + // ARM Resource ID of the RoutePolicy. + ExportIPv6RoutePolicyID *string +} + +// L3IsolationDomain - The L3 Isolation Domain resource definition. type L3IsolationDomain struct { // REQUIRED; The geo-location where the resource lives Location *string - // Resource properties. + // REQUIRED; Resource properties. Properties *L3IsolationDomainProperties // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -1243,7 +1702,7 @@ type L3IsolationDomain struct { Type *string } -// L3IsolationDomainPatch - The L3IsolationDomain patch resource definition. +// L3IsolationDomainPatch - The L3 Isolation Domain patch resource definition. type L3IsolationDomainPatch struct { // Resource properties. Properties *L3IsolationDomainPatchProperties @@ -1252,16 +1711,16 @@ type L3IsolationDomainPatch struct { Tags map[string]*string } -// L3IsolationDomainPatchProperties define the patch resource properties. +// L3IsolationDomainPatchProperties - Resource properties. type L3IsolationDomainPatchProperties struct { - // List of Ipv4 and Ipv6 route configurations. + // Aggregate route configurations. AggregateRouteConfiguration *AggregateRouteConfiguration - // Connected Subnet RoutePolicy - ConnectedSubnetRoutePolicy *L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy + // Switch configuration description. + Annotation *string - // L3 Isolation Domain description. - Description *string + // Connected Subnet RoutePolicy + ConnectedSubnetRoutePolicy *ConnectedSubnetRoutePolicy // Advertise Connected Subnets. Ex: "True" | "False". RedistributeConnectedSubnets *RedistributeConnectedSubnets @@ -1270,31 +1729,19 @@ type L3IsolationDomainPatchProperties struct { RedistributeStaticRoutes *RedistributeStaticRoutes } -// L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy - Connected Subnet RoutePolicy -type L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy struct { - // exportRoutePolicyId value. - ExportRoutePolicyID *string - - // READ-ONLY; Enabled/Disabled connected subnet route policy. Ex: Enabled | Disabled. - AdministrativeState *EnabledDisabledState -} - -// L3IsolationDomainProperties define the resource properties. +// L3IsolationDomainProperties - L3 Isolation Domain Properties defines the properties of the resource. type L3IsolationDomainProperties struct { - // REQUIRED; Network Fabric ARM resource id. + // REQUIRED; ARM Resource ID of the Network Fabric. NetworkFabricID *string - // List of Ipv4 and Ipv6 route configurations. + // Aggregate route configurations. AggregateRouteConfiguration *AggregateRouteConfiguration // Switch configuration description. Annotation *string // Connected Subnet RoutePolicy - ConnectedSubnetRoutePolicy *L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy - - // L3 Isolation Domain description. - Description *string + ConnectedSubnetRoutePolicy *ConnectedSubnetRoutePolicy // Advertise Connected Subnets. Ex: "True" | "False". RedistributeConnectedSubnets *RedistributeConnectedSubnets @@ -1302,29 +1749,19 @@ type L3IsolationDomainProperties struct { // Advertise Static Routes. Ex: "True" | "False". RedistributeStaticRoutes *RedistributeStaticRoutes - // READ-ONLY; Administrative state of the IsolationDomain. Example: Enabled | Disabled. - AdministrativeState *EnabledDisabledState - - // READ-ONLY; List of resources the L3 Isolation Domain is disabled on. Can be either entire NetworkFabric or NetworkRack. - DisabledOnResources []*string + // READ-ONLY; Administrative state of the resource. + AdministrativeState *AdministrativeState - // READ-ONLY; List of resources the OptionB is disabled on. Can be either entire NetworkFabric or NetworkRack. - OptionBDisabledOnResources []*string + // READ-ONLY; Configuration state of the resource. + ConfigurationState *ConfigurationState - // READ-ONLY; Gets the provisioning state of the resource. + // READ-ONLY; Provisioning state of the resource. ProvisioningState *ProvisioningState } -// L3IsolationDomainsClientBeginClearArpTableOptions contains the optional parameters for the L3IsolationDomainsClient.BeginClearArpTable +// L3IsolationDomainsClientBeginCommitConfigurationOptions contains the optional parameters for the L3IsolationDomainsClient.BeginCommitConfiguration // method. -type L3IsolationDomainsClientBeginClearArpTableOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// L3IsolationDomainsClientBeginClearNeighborTableOptions contains the optional parameters for the L3IsolationDomainsClient.BeginClearNeighborTable -// method. -type L3IsolationDomainsClientBeginClearNeighborTableOptions struct { +type L3IsolationDomainsClientBeginCommitConfigurationOptions struct { // Resumes the LRO from the provided token. ResumeToken string } @@ -1350,16 +1787,16 @@ type L3IsolationDomainsClientBeginUpdateAdministrativeStateOptions struct { ResumeToken string } -// L3IsolationDomainsClientBeginUpdateOptionBAdministrativeStateOptions contains the optional parameters for the L3IsolationDomainsClient.BeginUpdateOptionBAdministrativeState +// L3IsolationDomainsClientBeginUpdateOptions contains the optional parameters for the L3IsolationDomainsClient.BeginUpdate // method. -type L3IsolationDomainsClientBeginUpdateOptionBAdministrativeStateOptions struct { +type L3IsolationDomainsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// L3IsolationDomainsClientBeginUpdateOptions contains the optional parameters for the L3IsolationDomainsClient.BeginUpdate +// L3IsolationDomainsClientBeginValidateConfigurationOptions contains the optional parameters for the L3IsolationDomainsClient.BeginValidateConfiguration // method. -type L3IsolationDomainsClientBeginUpdateOptions struct { +type L3IsolationDomainsClientBeginValidateConfigurationOptions struct { // Resumes the LRO from the provided token. ResumeToken string } @@ -1381,150 +1818,197 @@ type L3IsolationDomainsClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// L3IsolationDomainsListResult - List of L3IsolationDomains. +// L3IsolationDomainsListResult - List of L3 Isolation Domains. type L3IsolationDomainsListResult struct { // Url to follow for getting next page of resources. NextLink *string - // List of L3IsolationDomain resources. + // List of L3 Isolation Domain resources. Value []*L3IsolationDomain } -// Layer2Configuration - layer2Configuration +// L3OptionBProperties - Option B configuration. +type L3OptionBProperties struct { + // RouteTargets to be applied. This is used for the backward compatibility. + ExportRouteTargets []*string + + // RouteTargets to be applied. This is used for the backward compatibility. + ImportRouteTargets []*string + + // RouteTargets to be applied. + RouteTargets *RouteTargetInformation +} + +// Layer2Configuration - Common properties for Layer2 Configuration. type Layer2Configuration struct { - // REQUIRED; MTU of the packets between PE & CE. + // List of network device interfaces resource IDs. + Interfaces []*string + + // MTU of the packets between PE & CE. Mtu *int32 +} - // Number of ports connected between PE/CE. Maximum value depends on FabricSKU. - PortCount *int32 +// ManagedResourceGroupConfiguration - Managed Resource Group configuration properties. +type ManagedResourceGroupConfiguration struct { + // Managed resource group location. + Location *string - // READ-ONLY; List of network device interfaces resource IDs. - Interfaces []*string + // The NFC service will be hosted in a Managed resource group. + Name *string } -// Layer3Configuration - layer3Configuration -type Layer3Configuration struct { - // exportRoutePolicyId - ExportRoutePolicyID *string +// ManagementNetworkConfigurationPatchableProperties - Configuration to be used to setup the management network. +type ManagementNetworkConfigurationPatchableProperties struct { + // VPN Configuration properties. + InfrastructureVPNConfiguration *VPNConfigurationPatchableProperties - // importRoutePolicyId - ImportRoutePolicyID *string + // VPN Configuration properties. + WorkloadVPNConfiguration *VPNConfigurationPatchableProperties +} - // ASN of PE devices for CE/PE connectivity.Example : 28 - PeerASN *int32 +// ManagementNetworkConfigurationProperties - Configuration to be used to setup the management network. +type ManagementNetworkConfigurationProperties struct { + // REQUIRED; VPN Configuration properties. + InfrastructureVPNConfiguration *VPNConfigurationProperties - // IPv4 Address Prefix of CE-PE interconnect links. Example: 172.31.0.0/31. The values can be specified at the time of creation - // or can be updated afterwards. Any update to the values post-provisioning - // may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. The 2nd and 4th IPs - // are to be configured on PE1 and PE2 for Option B interfaces. - PrimaryIPv4Prefix *string + // REQUIRED; VPN Configuration properties. + WorkloadVPNConfiguration *VPNConfigurationProperties +} - // IPv6 Address Prefix of CE-PE interconnect links. Example: 3FFE:FFFF:0:CD30::a0/126. The values can be specified at the - // time of creation or can be updated afterwards. Any update to the values - // post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. - // The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. - PrimaryIPv6Prefix *string +// NeighborAddress - Neighbor Address properties. +type NeighborAddress struct { + // IP Address. + Address *string - // Secondary IPv4 Address Prefix of CE-PE interconnect links. Example: 172.31.0.20/31. The values can be specified at the - // time of creation or can be updated afterwards. Any update to the values - // post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. - // The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. - SecondaryIPv4Prefix *string + // READ-ONLY; Configuration state of the resource. + ConfigurationState *ConfigurationState +} - // Secondary IPv6 Address Prefix of CE-PE interconnect links. Example: 3FFE:FFFF:0:CD30::a4/126. The values can be specified - // at the time of creation or can be updated afterwards. Any update to the values - // post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. - // The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. - SecondaryIPv6Prefix *string +// NeighborGroup - Defines the Neighbor Group. +type NeighborGroup struct { + // REQUIRED; The geo-location where the resource lives + Location *string - // VLAN for CE/PE Layer 3 connectivity.Example : 501 - VlanID *int32 + // REQUIRED; Resource properties. + Properties *NeighborGroupProperties - // READ-ONLY; ASN of CE devices for CE/PE connectivity. - FabricASN *int32 + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string } -// Layer3OptionAProperties - Peering optionA properties -type Layer3OptionAProperties struct { - // BFD configuration properties - BfdConfiguration *BfdConfiguration +// NeighborGroupDestination - An array of destination IPv4 Addresses or IPv6 Addresses. +type NeighborGroupDestination struct { + // Array of IPv4 Addresses. + IPv4Addresses []*string - // MTU to use for option A peering. - Mtu *int32 + // Array of IPv6 Addresses. + IPv6Addresses []*string +} - // Peer ASN number.Example : 28 - PeerASN *int32 +// NeighborGroupPatch - The Neighbor Group Patch definition. +type NeighborGroupPatch struct { + // Neighbor Group Patch properties. + Properties *NeighborGroupPatchProperties - // IPv4 Address Prefix of CE-PE interconnect links. Example: 172.31.0.0/31. The values can be specified at the time of creation - // or can be updated afterwards. Any update to the values post-provisioning - // may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. The 2nd and 4th IPs - // are to be configured on PE1 and PE2 for Option B interfaces. - PrimaryIPv4Prefix *string + // Resource tags + Tags map[string]*string +} - // IPv6 Address Prefix of CE-PE interconnect links. Example: 3FFE:FFFF:0:CD30::a0/126. The values can be specified at the - // time of creation or can be updated afterwards. Any update to the values - // post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. - // The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. - PrimaryIPv6Prefix *string +// NeighborGroupPatchProperties - Neighbor Group Patch properties. +type NeighborGroupPatchProperties struct { + // Switch configuration description. + Annotation *string - // Secondary IPv4 Address Prefix of CE-PE interconnect links. Example: 172.31.0.20/31. The values can be specified at the - // time of creation or can be updated afterwards. Any update to the values - // post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. - // The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. - SecondaryIPv4Prefix *string + // An array of destination IPv4 Addresses or IPv6 Addresses. + Destination *NeighborGroupDestination +} - // Secondary IPv6 Address Prefix of CE-PE interconnect links. Example: 3FFE:FFFF:0:CD30::a4/126. The values can be specified - // at the time of creation or can be updated afterwards. Any update to the values - // post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. - // The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. - SecondaryIPv6Prefix *string +// NeighborGroupProperties - Neighbor Group Properties defines the properties of the resource. +type NeighborGroupProperties struct { + // Switch configuration description. + Annotation *string - // Vlan identifier. Example : 501 - VlanID *int32 + // An array of destination IPv4 Addresses or IPv6 Addresses. + Destination *NeighborGroupDestination - // READ-ONLY; Fabric ASN number. Example 65001 - FabricASN *int32 + // READ-ONLY; List of NetworkTap IDs where neighbor group is associated. + NetworkTapIDs []*string + + // READ-ONLY; List of Network Tap Rule IDs where neighbor group is associated. + NetworkTapRuleIDs []*string + + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *ProvisioningState } -// ManagedResourceGroupConfiguration - Managed Resource Group configuration properties. -type ManagedResourceGroupConfiguration struct { - // Managed resource group location. - Location *string +// NeighborGroupsClientBeginCreateOptions contains the optional parameters for the NeighborGroupsClient.BeginCreate method. +type NeighborGroupsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} - // The NFC service will be hosted in a Managed resource group. - Name *string +// NeighborGroupsClientBeginDeleteOptions contains the optional parameters for the NeighborGroupsClient.BeginDelete method. +type NeighborGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } -// ManagementNetworkConfiguration - Configuration to be used to setup the management network. -type ManagementNetworkConfiguration struct { - // REQUIRED; Configuration for infrastructure vpn. - InfrastructureVPNConfiguration *VPNConfigurationProperties +// NeighborGroupsClientBeginUpdateOptions contains the optional parameters for the NeighborGroupsClient.BeginUpdate method. +type NeighborGroupsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} - // REQUIRED; Configuration for workload vpn. - WorkloadVPNConfiguration *VPNConfigurationProperties +// NeighborGroupsClientGetOptions contains the optional parameters for the NeighborGroupsClient.Get method. +type NeighborGroupsClientGetOptions struct { + // placeholder for future optional parameters } -// NeighborAddress - Neighbor Address properties. -type NeighborAddress struct { - // IP Address. - Address *string +// NeighborGroupsClientListByResourceGroupOptions contains the optional parameters for the NeighborGroupsClient.NewListByResourceGroupPager +// method. +type NeighborGroupsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} - // READ-ONLY; OperationalState of the NeighborAddress. - OperationalState *string +// NeighborGroupsClientListBySubscriptionOptions contains the optional parameters for the NeighborGroupsClient.NewListBySubscriptionPager +// method. +type NeighborGroupsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters } -// NetworkDevice - The NetworkDevice resource definition. +// NeighborGroupsListResult - List of Neighbor Group. +type NeighborGroupsListResult struct { + // Url to follow for getting next page of resources. + NextLink *string + + // List of Neighbor Group resources. + Value []*NeighborGroup +} + +// NetworkDevice - The Network Device resource definition. type NetworkDevice struct { // REQUIRED; The geo-location where the resource lives Location *string - // Resource properties. + // REQUIRED; Resource properties. Properties *NetworkDeviceProperties // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -1537,12 +2021,12 @@ type NetworkDevice struct { Type *string } -// NetworkDevicePatchParameters - The NetworkDevicePatchParameters resource definition. +// NetworkDevicePatchParameters - The Network Device Patch Parameters defines the patch parameters of the resource. type NetworkDevicePatchParameters struct { // Network Device Patch properties. Properties *NetworkDevicePatchParametersProperties - // Azure resource tags that will replace the existing ones. + // Resource tags Tags map[string]*string } @@ -1551,58 +2035,58 @@ type NetworkDevicePatchParametersProperties struct { // Switch configuration description. Annotation *string - // The host Name of the device. + // The host name of the device. HostName *string - // serialNumber of the format Make;Model;HardwareRevisionId;SerialNumber. Example: Arista;DCS-7280DR3-24;12.05;JPE21116969 + // Serial number of the device. Format of serial Number - Make;Model;HardwareRevisionId;SerialNumber. SerialNumber *string } -// NetworkDeviceProperties define the resource properties. +// NetworkDeviceProperties - Network Device Properties defines the properties of the resource. type NetworkDeviceProperties struct { - // REQUIRED; networkDeviceRole is the device role: Example: CE | ToR. - NetworkDeviceRole *NetworkDeviceRoleTypes - - // REQUIRED; Network Device SKU name. - NetworkDeviceSKU *string - // Switch configuration description. Annotation *string - // The host Name of the device. + // The host name of the device. HostName *string - // serialNumber of the format Make;Model;HardwareRevisionId;SerialNumber. Example: Arista;DCS-7280DR3-24;12.05;JPE21116969 + // Network Device SKU name. + NetworkDeviceSKU *string + + // Serial number of the device. Format of serial Number - Make;Model;HardwareRevisionId;SerialNumber. SerialNumber *string + // READ-ONLY; Administrative state of the resource. + AdministrativeState *AdministrativeState + + // READ-ONLY; Configuration state of the resource. + ConfigurationState *ConfigurationState + + // READ-ONLY; Management IPv4 Address. + ManagementIPv4Address *string + + // READ-ONLY; Management IPv6 Address. + ManagementIPv6Address *string + + // READ-ONLY; NetworkDeviceRole is the device role: Example: CE | ToR. + NetworkDeviceRole *NetworkDeviceRole + // READ-ONLY; Reference to network rack resource id. NetworkRackID *string - // READ-ONLY; Gets the provisioning state of the resource. + // READ-ONLY; Provisioning state of the resource. ProvisioningState *ProvisioningState // READ-ONLY; Current version of the device as defined in SKU. Version *string } -// NetworkDeviceRoleProperties - Network device properties / role for the Network Rack. -type NetworkDeviceRoleProperties struct { - // Name of the associated Network Device SKU. - NetworkDeviceSKUName *string - - // Rack slot for the network device. - RackSlot *int32 - - // Role for the network device. - RoleType *NetworkDeviceRackRoleType -} - // NetworkDeviceSKU - The NetworkDeviceSku resource definition. type NetworkDeviceSKU struct { // REQUIRED; Resource properties. Properties *NetworkDeviceSKUProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -1615,7 +2099,7 @@ type NetworkDeviceSKU struct { Type *string } -// NetworkDeviceSKUProperties - NetworkDeviceSkuProperties define the resource properties. +// NetworkDeviceSKUProperties - Network Device SKU Properties defines the properties of the resource. type NetworkDeviceSKUProperties struct { // REQUIRED; Model of the network device. Model *string @@ -1623,19 +2107,16 @@ type NetworkDeviceSKUProperties struct { // List of network device interfaces. Interfaces []*DeviceInterfaceProperties - // Network device limits. - Limits *DeviceLimits - // Manufacturer of the network device. Manufacturer *string // Available roles for the network device. SupportedRoleTypes []*NetworkDeviceRoleName - // List of network device interfaces. + // List of supported version details of network device. SupportedVersions []*SupportedVersionProperties - // READ-ONLY; Gets the provisioning state of the resource. + // READ-ONLY; Provisioning state of the resource. ProvisioningState *ProvisioningState } @@ -1650,12 +2131,12 @@ type NetworkDeviceSKUsClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// NetworkDeviceSKUsListResult - List of NetworkDeviceSkus. +// NetworkDeviceSKUsListResult - List of Network Device SKUs. type NetworkDeviceSKUsListResult struct { // Url to follow for getting next page of resources. NextLink *string - // List of NetworkDeviceSku resources. + // List of Network Device SKU resources. Value []*NetworkDeviceSKU } @@ -1671,43 +2152,22 @@ type NetworkDevicesClientBeginDeleteOptions struct { ResumeToken string } -// NetworkDevicesClientBeginGenerateSupportPackageOptions contains the optional parameters for the NetworkDevicesClient.BeginGenerateSupportPackage -// method. -type NetworkDevicesClientBeginGenerateSupportPackageOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkDevicesClientBeginGetDynamicInterfaceMapsOptions contains the optional parameters for the NetworkDevicesClient.BeginGetDynamicInterfaceMaps -// method. -type NetworkDevicesClientBeginGetDynamicInterfaceMapsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkDevicesClientBeginGetStaticInterfaceMapsOptions contains the optional parameters for the NetworkDevicesClient.BeginGetStaticInterfaceMaps -// method. -type NetworkDevicesClientBeginGetStaticInterfaceMapsOptions struct { +// NetworkDevicesClientBeginRebootOptions contains the optional parameters for the NetworkDevicesClient.BeginReboot method. +type NetworkDevicesClientBeginRebootOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// NetworkDevicesClientBeginGetStatusOptions contains the optional parameters for the NetworkDevicesClient.BeginGetStatus +// NetworkDevicesClientBeginRefreshConfigurationOptions contains the optional parameters for the NetworkDevicesClient.BeginRefreshConfiguration // method. -type NetworkDevicesClientBeginGetStatusOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkDevicesClientBeginRebootOptions contains the optional parameters for the NetworkDevicesClient.BeginReboot method. -type NetworkDevicesClientBeginRebootOptions struct { +type NetworkDevicesClientBeginRefreshConfigurationOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// NetworkDevicesClientBeginRestoreConfigOptions contains the optional parameters for the NetworkDevicesClient.BeginRestoreConfig +// NetworkDevicesClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkDevicesClient.BeginUpdateAdministrativeState // method. -type NetworkDevicesClientBeginRestoreConfigOptions struct { +type NetworkDevicesClientBeginUpdateAdministrativeStateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } @@ -1718,16 +2178,8 @@ type NetworkDevicesClientBeginUpdateOptions struct { ResumeToken string } -// NetworkDevicesClientBeginUpdatePowerCycleOptions contains the optional parameters for the NetworkDevicesClient.BeginUpdatePowerCycle -// method. -type NetworkDevicesClientBeginUpdatePowerCycleOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkDevicesClientBeginUpdateVersionOptions contains the optional parameters for the NetworkDevicesClient.BeginUpdateVersion -// method. -type NetworkDevicesClientBeginUpdateVersionOptions struct { +// NetworkDevicesClientBeginUpgradeOptions contains the optional parameters for the NetworkDevicesClient.BeginUpgrade method. +type NetworkDevicesClientBeginUpgradeOptions struct { // Resumes the LRO from the provided token. ResumeToken string } @@ -1758,18 +2210,18 @@ type NetworkDevicesListResult struct { Value []*NetworkDevice } -// NetworkFabric - The NetworkFabric resource definition. +// NetworkFabric - The Network Fabric resource definition. type NetworkFabric struct { // REQUIRED; The geo-location where the resource lives Location *string - // Resource properties. + // REQUIRED; Resource properties. Properties *NetworkFabricProperties // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -1782,18 +2234,18 @@ type NetworkFabric struct { Type *string } -// NetworkFabricController - The NetworkFabricController resource definition. +// NetworkFabricController - The Network Fabric Controller resource definition. type NetworkFabricController struct { // REQUIRED; The geo-location where the resource lives Location *string - // Resource properties. + // REQUIRED; Resource properties. Properties *NetworkFabricControllerProperties // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -1806,12 +2258,12 @@ type NetworkFabricController struct { Type *string } -// NetworkFabricControllerPatch - The NetworkFabricControllerPatch payload definition. +// NetworkFabricControllerPatch - The Network Fabric Controller Patch payload definition. type NetworkFabricControllerPatch struct { // Network Fabric Controller patch properties. Properties *NetworkFabricControllerPatchableProperties - // Azure resource tags that will replace the existing ones. + // Resource tags Tags map[string]*string } @@ -1827,7 +2279,7 @@ type NetworkFabricControllerPatchableProperties struct { WorkloadExpressRouteConnections []*ExpressRouteConnectionInformation } -// NetworkFabricControllerProperties define the resource properties. +// NetworkFabricControllerProperties defines the resource properties. type NetworkFabricControllerProperties struct { // Switch configuration description. Annotation *string @@ -1843,33 +2295,41 @@ type NetworkFabricControllerProperties struct { // attribute) InfrastructureExpressRouteConnections []*ExpressRouteConnectionInformation + // 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. + IsWorkloadManagementNetworkEnabled *IsWorkloadManagementNetworkEnabled + // Managed Resource Group configuration properties. ManagedResourceGroupConfiguration *ManagedResourceGroupConfiguration + // Network Fabric Controller SKU. + NfcSKU *NfcSKU + // 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). WorkloadExpressRouteConnections []*ExpressRouteConnectionInformation // READ-ONLY; InfrastructureServices IP ranges. - InfrastructureServices *InfrastructureServices + InfrastructureServices *ControllerServices // READ-ONLY; The NF-ID will be an input parameter used by the NF to link and get associated with the parent NFC Service. NetworkFabricIDs []*string - // READ-ONLY; The Operational Status would always be NULL. Look only in to the Provisioning state for the latest status. - OperationalState *NetworkFabricControllerOperationalState - // READ-ONLY; 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. ProvisioningState *ProvisioningState + // READ-ONLY; List of tenant InternetGateway resource IDs + TenantInternetGatewayIDs []*string + // READ-ONLY; 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. + // endpoints. This is used for the backward compatibility. WorkloadManagementNetwork *bool // READ-ONLY; WorkloadServices IP ranges. - WorkloadServices *WorkloadServices + WorkloadServices *ControllerServices } // NetworkFabricControllersClientBeginCreateOptions contains the optional parameters for the NetworkFabricControllersClient.BeginCreate @@ -1886,20 +2346,6 @@ type NetworkFabricControllersClientBeginDeleteOptions struct { ResumeToken string } -// NetworkFabricControllersClientBeginDisableWorkloadManagementNetworkOptions contains the optional parameters for the NetworkFabricControllersClient.BeginDisableWorkloadManagementNetwork -// method. -type NetworkFabricControllersClientBeginDisableWorkloadManagementNetworkOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkFabricControllersClientBeginEnableWorkloadManagementNetworkOptions contains the optional parameters for the NetworkFabricControllersClient.BeginEnableWorkloadManagementNetwork -// method. -type NetworkFabricControllersClientBeginEnableWorkloadManagementNetworkOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // NetworkFabricControllersClientBeginUpdateOptions contains the optional parameters for the NetworkFabricControllersClient.BeginUpdate // method. type NetworkFabricControllersClientBeginUpdateOptions struct { @@ -1924,50 +2370,86 @@ type NetworkFabricControllersClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// NetworkFabricControllersListResult - List of NetworkFabricControllers. +// NetworkFabricControllersListResult - List of Network Fabric Controllers. type NetworkFabricControllersListResult struct { // Url to follow for getting next page of resources. NextLink *string - // List of NetworkFabricController resources. + // List of Network Fabric Controller resources. Value []*NetworkFabricController } -// NetworkFabricPatchParameters - The NetworkFabric resource definition. -type NetworkFabricPatchParameters struct { +// NetworkFabricPatch - The Network Fabric resource definition. +type NetworkFabricPatch struct { // Network Fabric Patch properties. - Properties *NetworkFabricPatchParametersProperties + Properties *NetworkFabricPatchProperties - // Azure resource tags that will replace the existing ones. + // Resource tags Tags map[string]*string } -// NetworkFabricPatchParametersProperties - Network Fabric Patch properties. -type NetworkFabricPatchParametersProperties struct { +// NetworkFabricPatchProperties - Network Fabric Patch properties. +type NetworkFabricPatchProperties struct { // Switch configuration description. Annotation *string + // ASN of CE devices for CE/PE connectivity. + FabricASN *int64 + + // IPv4Prefix for Management Network. Example: 10.1.0.0/19. + IPv4Prefix *string + + // IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. + IPv6Prefix *string + + // Configuration to be used to setup the management network. + ManagementNetworkConfiguration *ManagementNetworkConfigurationPatchableProperties + + // Number of compute racks associated to Network Fabric. + RackCount *int32 + + // Number of servers.Possible values are from 1-16. + ServerCountPerRack *int32 + // Network and credentials configuration already applied to terminal server. - TerminalServerConfiguration *TerminalServerPatchableProperties + TerminalServerConfiguration *NetworkFabricPatchablePropertiesTerminalServerConfiguration +} - // READ-ONLY; List of L2IsolationDomain resource IDs under the Network Fabric. - L2IsolationDomains []*string +// NetworkFabricPatchablePropertiesTerminalServerConfiguration - Network and credentials configuration already applied to +// terminal server. +type NetworkFabricPatchablePropertiesTerminalServerConfiguration struct { + // Password for the terminal server connection. + Password *string - // READ-ONLY; List of L3IsolationDomain resource IDs under the Network Fabric. - L3IsolationDomains []*string + // IPv4 Address Prefix. + PrimaryIPv4Prefix *string - // READ-ONLY; List of NetworkRack resource IDs under the Network Fabric. The number of racks allowed depends on the Network - // Fabric SKU. - Racks []*string + // IPv6 Address Prefix. + PrimaryIPv6Prefix *string + + // Secondary IPv4 Address Prefix. + SecondaryIPv4Prefix *string + + // Secondary IPv6 Address Prefix. + SecondaryIPv6Prefix *string + + // Serial Number of Terminal server. + SerialNumber *string + + // Username for the terminal server connection. + Username *string } -// NetworkFabricProperties - define the resource properties. +// NetworkFabricProperties - Network Fabric Properties defines the properties of the resource. type NetworkFabricProperties struct { // REQUIRED; ASN of CE devices for CE/PE connectivity. - FabricASN *int32 + FabricASN *int64 + + // REQUIRED; IPv4Prefix for Management Network. Example: 10.1.0.0/19. + IPv4Prefix *string // REQUIRED; Configuration to be used to setup the management network. - ManagementNetworkConfiguration *ManagementNetworkConfiguration + ManagementNetworkConfiguration *ManagementNetworkConfigurationProperties // REQUIRED; Azure resource ID for the NetworkFabricController the NetworkFabric belongs. NetworkFabricControllerID *string @@ -1977,9 +2459,6 @@ type NetworkFabricProperties struct { // single / multi rack Network Fabric. NetworkFabricSKU *string - // REQUIRED; Number of racks associated to Network Fabric.Possible values are from 2-8. - RackCount *int32 - // REQUIRED; Number of servers.Possible values are from 1-16. ServerCountPerRack *int32 @@ -1989,38 +2468,45 @@ type NetworkFabricProperties struct { // Switch configuration description. Annotation *string - // IPv4Prefix for Management Network. Example: 10.1.0.0/19. - IPv4Prefix *string - - // IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. + // IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59 IPv6Prefix *string - // READ-ONLY; List of L2IsolationDomain resource IDs under the Network Fabric. + // Number of compute racks associated to Network Fabric. + RackCount *int32 + + // READ-ONLY; Administrative state of the resource. + AdministrativeState *AdministrativeState + + // READ-ONLY; Configuration state of the resource. + ConfigurationState *ConfigurationState + + // READ-ONLY; The version of Network Fabric. + FabricVersion *string + + // READ-ONLY; List of L2 Isolation Domain resource IDs under the Network Fabric. L2IsolationDomains []*string - // READ-ONLY; List of L3IsolationDomain resource IDs under the Network Fabric. + // READ-ONLY; List of L3 Isolation Domain resource IDs under the Network Fabric. L3IsolationDomains []*string - // READ-ONLY; Gets the operational state of the resource. - OperationalState *NetworkFabricOperationalState - - // READ-ONLY; Gets the provisioning state of the resource. + // READ-ONLY; 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. ProvisioningState *ProvisioningState // READ-ONLY; List of NetworkRack resource IDs under the Network Fabric. The number of racks allowed depends on the Network // Fabric SKU. Racks []*string - // READ-ONLY; Router Id of CE to be used for MP-BGP between PE and CE - RouterID *string + // READ-ONLY; Array of router IDs. + RouterIDs []*string } -// NetworkFabricSKU - The NetworkFabricSku resource definition. +// NetworkFabricSKU - The Network Fabric SKU resource definition. type NetworkFabricSKU struct { // REQUIRED; Resource properties. Properties *NetworkFabricSKUProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -2033,25 +2519,26 @@ type NetworkFabricSKU struct { Type *string } -// NetworkFabricSKUProperties - NetworkFabricSkuProperties define the resource properties. +// NetworkFabricSKUProperties - Network Fabric SKU Properties define properties of the resource. type NetworkFabricSKUProperties struct { - // Maximum number of compute racks available for this 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. MaxComputeRacks *int32 - // READ-ONLY; The URI gives full details of sku. - DetailsURI *string - - // READ-ONLY; Maximum supported version. - MaxSupportedVer *string + // Maximum number of servers available for this Network Fabric SKU. + MaximumServerCount *int32 - // READ-ONLY; Minimum supported version. - MinSupportedVer *string + // READ-ONLY; URL providing detailed configuration of the fabric SKU. + Details *string - // READ-ONLY; Gets the provisioning state of the resource. + // READ-ONLY; Provisioning state of the resource. ProvisioningState *ProvisioningState - // READ-ONLY; Type of Network Fabric Sku. - Type *string + // READ-ONLY; List of supported Network Fabric SKU versions. + SupportedVersions []*string + + // READ-ONLY; Type of Network Fabric SKU. + Type *FabricSKUType } // NetworkFabricSKUsClientGetOptions contains the optional parameters for the NetworkFabricSKUsClient.Get method. @@ -2065,15 +2552,22 @@ type NetworkFabricSKUsClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// NetworkFabricSKUsListResult - List of NetworkFabricSkus. +// NetworkFabricSKUsListResult - List of Network Fabric SKUs. type NetworkFabricSKUsListResult struct { // Url to follow for getting next page of resources. NextLink *string - // List of NetworkFabricSku resources. + // List of Network Fabric SKU resources. Value []*NetworkFabricSKU } +// NetworkFabricsClientBeginCommitConfigurationOptions contains the optional parameters for the NetworkFabricsClient.BeginCommitConfiguration +// method. +type NetworkFabricsClientBeginCommitConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // NetworkFabricsClientBeginCreateOptions contains the optional parameters for the NetworkFabricsClient.BeginCreate method. type NetworkFabricsClientBeginCreateOptions struct { // Resumes the LRO from the provided token. @@ -2093,6 +2587,13 @@ type NetworkFabricsClientBeginDeprovisionOptions struct { ResumeToken string } +// NetworkFabricsClientBeginGetTopologyOptions contains the optional parameters for the NetworkFabricsClient.BeginGetTopology +// method. +type NetworkFabricsClientBeginGetTopologyOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // NetworkFabricsClientBeginProvisionOptions contains the optional parameters for the NetworkFabricsClient.BeginProvision // method. type NetworkFabricsClientBeginProvisionOptions struct { @@ -2100,12 +2601,46 @@ type NetworkFabricsClientBeginProvisionOptions struct { ResumeToken string } +// NetworkFabricsClientBeginRefreshConfigurationOptions contains the optional parameters for the NetworkFabricsClient.BeginRefreshConfiguration +// method. +type NetworkFabricsClientBeginRefreshConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFabricsClientBeginUpdateInfraManagementBfdConfigurationOptions contains the optional parameters for the NetworkFabricsClient.BeginUpdateInfraManagementBfdConfiguration +// method. +type NetworkFabricsClientBeginUpdateInfraManagementBfdConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // NetworkFabricsClientBeginUpdateOptions contains the optional parameters for the NetworkFabricsClient.BeginUpdate method. type NetworkFabricsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } +// NetworkFabricsClientBeginUpdateWorkloadManagementBfdConfigurationOptions contains the optional parameters for the NetworkFabricsClient.BeginUpdateWorkloadManagementBfdConfiguration +// method. +type NetworkFabricsClientBeginUpdateWorkloadManagementBfdConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFabricsClientBeginUpgradeOptions contains the optional parameters for the NetworkFabricsClient.BeginUpgrade method. +type NetworkFabricsClientBeginUpgradeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFabricsClientBeginValidateConfigurationOptions contains the optional parameters for the NetworkFabricsClient.BeginValidateConfiguration +// method. +type NetworkFabricsClientBeginValidateConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // NetworkFabricsClientGetOptions contains the optional parameters for the NetworkFabricsClient.Get method. type NetworkFabricsClientGetOptions struct { // placeholder for future optional parameters @@ -2123,12 +2658,12 @@ type NetworkFabricsClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// NetworkFabricsListResult - List of NetworkFabrics. +// NetworkFabricsListResult - List of Network Fabrics. type NetworkFabricsListResult struct { // Url to follow for getting next page of resources. NextLink *string - // List of NetworkFabric resources. + // List of Network Fabric resources. Value []*NetworkFabric } @@ -2137,7 +2672,7 @@ type NetworkInterface struct { // REQUIRED; Resource properties. Properties *NetworkInterfaceProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -2162,30 +2697,30 @@ type NetworkInterfacePatchProperties struct { Annotation *string } -// NetworkInterfaceProperties define the resource properties. +// NetworkInterfaceProperties - Network Interface Properties defines the properties of the resource. type NetworkInterfaceProperties struct { // Switch configuration description. Annotation *string - // READ-ONLY; administrativeState of the network interface. Example: Enabled | Disabled. - AdministrativeState *EnabledDisabledState + // READ-ONLY; Administrative state of the resource. + AdministrativeState *AdministrativeState - // READ-ONLY; The arm resource id of the interface or compute server its connected to. + // READ-ONLY; The ARM resource id of the interface or compute server its connected to. ConnectedTo *string - // READ-ONLY; ipv4Address. + // READ-ONLY; IPv4Address of the interface. IPv4Address *string - // READ-ONLY; ipv6Address. + // READ-ONLY; IPv6Address of the interface. IPv6Address *string // READ-ONLY; The Interface Type. Example: Management/Data InterfaceType *InterfaceType - // READ-ONLY; physicalIdentifier of the network interface. + // READ-ONLY; Physical Identifier of the network interface. PhysicalIdentifier *string - // READ-ONLY; Gets the provisioning state of the resource. + // READ-ONLY; Provisioning state of the resource. ProvisioningState *ProvisioningState } @@ -2203,13 +2738,6 @@ type NetworkInterfacesClientBeginDeleteOptions struct { ResumeToken string } -// NetworkInterfacesClientBeginGetStatusOptions contains the optional parameters for the NetworkInterfacesClient.BeginGetStatus -// method. -type NetworkInterfacesClientBeginGetStatusOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // NetworkInterfacesClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkInterfacesClient.BeginUpdateAdministrativeState // method. type NetworkInterfacesClientBeginUpdateAdministrativeStateOptions struct { @@ -2229,8 +2757,9 @@ type NetworkInterfacesClientGetOptions struct { // placeholder for future optional parameters } -// NetworkInterfacesClientListOptions contains the optional parameters for the NetworkInterfacesClient.NewListPager method. -type NetworkInterfacesClientListOptions struct { +// NetworkInterfacesClientListByNetworkDeviceOptions contains the optional parameters for the NetworkInterfacesClient.NewListByNetworkDevicePager +// method. +type NetworkInterfacesClientListByNetworkDeviceOptions struct { // placeholder for future optional parameters } @@ -2243,7 +2772,105 @@ type NetworkInterfacesList struct { Value []*NetworkInterface } -// NetworkRack - The NetworkRack resource definition. +// NetworkPacketBroker - The NetworkPacketBroker resource definition. +type NetworkPacketBroker struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // REQUIRED; Resource properties. + Properties *NetworkPacketBrokerProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// NetworkPacketBrokerPatch - The NetworkPacketBroker patch resource definition. +type NetworkPacketBrokerPatch struct { + // Resource tags + Tags map[string]*string +} + +// NetworkPacketBrokerProperties - Network Packet Broker Properties defines the properties of the resource. +type NetworkPacketBrokerProperties struct { + // REQUIRED; ARM resource ID of the Network Fabric. + NetworkFabricID *string + + // READ-ONLY; List of neighbor group IDs configured on NPB. + NeighborGroupIDs []*string + + // READ-ONLY; List of ARM resource IDs of Network Devices [NPB]. + NetworkDeviceIDs []*string + + // READ-ONLY; List of network Tap IDs configured on NPB. + NetworkTapIDs []*string + + // READ-ONLY; Provisioning state of the resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; List of network interfaces across NPB devices that are used to mirror source traffic. + SourceInterfaceIDs []*string +} + +// NetworkPacketBrokersClientBeginCreateOptions contains the optional parameters for the NetworkPacketBrokersClient.BeginCreate +// method. +type NetworkPacketBrokersClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkPacketBrokersClientBeginDeleteOptions contains the optional parameters for the NetworkPacketBrokersClient.BeginDelete +// method. +type NetworkPacketBrokersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkPacketBrokersClientBeginUpdateOptions contains the optional parameters for the NetworkPacketBrokersClient.BeginUpdate +// method. +type NetworkPacketBrokersClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkPacketBrokersClientGetOptions contains the optional parameters for the NetworkPacketBrokersClient.Get method. +type NetworkPacketBrokersClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkPacketBrokersClientListByResourceGroupOptions contains the optional parameters for the NetworkPacketBrokersClient.NewListByResourceGroupPager +// method. +type NetworkPacketBrokersClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// NetworkPacketBrokersClientListBySubscriptionOptions contains the optional parameters for the NetworkPacketBrokersClient.NewListBySubscriptionPager +// method. +type NetworkPacketBrokersClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// NetworkPacketBrokersListResult - List of NetworkPacketBrokers. +type NetworkPacketBrokersListResult struct { + // Url to follow for getting next page of resources. + NextLink *string + + // List of NetworkPacketBroker resources. + Value []*NetworkPacketBroker +} + +// NetworkRack - The Network Rack resource definition. type NetworkRack struct { // REQUIRED; The geo-location where the resource lives Location *string @@ -2254,7 +2881,7 @@ type NetworkRack struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -2267,39 +2894,189 @@ type NetworkRack struct { Type *string } -// NetworkRackPatch - The NetworkRack patch resource definition. -type NetworkRackPatch struct { +// NetworkRackProperties - Network Rack Properties defines the properties of the resource. +type NetworkRackProperties struct { + // REQUIRED; ARM resource ID of the Network Fabric. + NetworkFabricID *string + + // Switch configuration description. + Annotation *string + + // Network Rack SKU name. + NetworkRackType *NetworkRackType + + // READ-ONLY; List of network device ARM resource IDs. + NetworkDevices []*string + + // READ-ONLY; Provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// NetworkRacksClientBeginCreateOptions contains the optional parameters for the NetworkRacksClient.BeginCreate method. +type NetworkRacksClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkRacksClientBeginDeleteOptions contains the optional parameters for the NetworkRacksClient.BeginDelete method. +type NetworkRacksClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkRacksClientBeginUpdateOptions contains the optional parameters for the NetworkRacksClient.BeginUpdate method. +type NetworkRacksClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkRacksClientGetOptions contains the optional parameters for the NetworkRacksClient.Get method. +type NetworkRacksClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkRacksClientListByResourceGroupOptions contains the optional parameters for the NetworkRacksClient.NewListByResourceGroupPager +// method. +type NetworkRacksClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// NetworkRacksClientListBySubscriptionOptions contains the optional parameters for the NetworkRacksClient.NewListBySubscriptionPager +// method. +type NetworkRacksClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// NetworkRacksListResult - List of Network Racks. +type NetworkRacksListResult struct { + // Url to follow for getting next page of resources. + NextLink *string + + // List of Network Rack resources. + Value []*NetworkRack +} + +// NetworkTap - The Network Tap resource definition. +type NetworkTap struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // REQUIRED; Resource properties. + Properties *NetworkTapProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// NetworkTapPatch - The NetworkFabric resource definition. +type NetworkTapPatch struct { // Resource properties. - Properties any + Properties *NetworkTapPatchableParameters // Resource tags Tags map[string]*string } -// NetworkRackProperties define the resource properties. -type NetworkRackProperties struct { - // REQUIRED; Network Fabric ARM resource id. - NetworkFabricID *string +// NetworkTapPatchableParameters - The Network Tap resource patch definition. +type NetworkTapPatchableParameters struct { + // Switch configuration description. + Annotation *string + + // List of destination properties to send the filter traffic. + Destinations []*NetworkTapPatchableParametersDestinationsItem + + // Polling type. + PollingType *PollingType +} + +// NetworkTapPatchableParametersDestinationsItem - Destination. +type NetworkTapPatchableParametersDestinationsItem struct { + // The destination Id. ARM Resource ID of either NNI or Internal Networks. + DestinationID *string + + // ARM Resource ID of destination Tap Rule that contains match configurations. + DestinationTapRuleID *string + + // Type of destination. Input can be IsolationDomain or Direct. + DestinationType *DestinationType - // REQUIRED; Network Rack SKU name. - NetworkRackSKU *string + // Isolation Domain Properties. + IsolationDomainProperties *IsolationDomainProperties + + // Destination name. + Name *string +} + +// NetworkTapProperties - Network Tap Properties defines the properties of the resource. +type NetworkTapProperties struct { + // REQUIRED; List of destinations to send the filter traffic. + Destinations []*NetworkTapPropertiesDestinationsItem + + // REQUIRED; ARM resource ID of the Network Packet Broker. + NetworkPacketBrokerID *string // Switch configuration description. Annotation *string - // READ-ONLY; List of network device ARM resource ids. - NetworkDevices []*string + // Polling type. + PollingType *PollingType + + // READ-ONLY; Administrative state of the resource. Example -Enabled/Disabled + AdministrativeState *AdministrativeState + + // READ-ONLY; Gets the configurations state of the resource. + ConfigurationState *ConfigurationState - // READ-ONLY; Gets the provisioning state of the resource. + // READ-ONLY; 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. ProvisioningState *ProvisioningState + + // READ-ONLY; Source Tap Rule Id. ARM Resource ID of the Network Tap Rule. + SourceTapRuleID *string } -// NetworkRackSKU - The NetworkRackSku resource definition. -type NetworkRackSKU struct { +// NetworkTapPropertiesDestinationsItem - Destination. +type NetworkTapPropertiesDestinationsItem struct { + // The destination Id. ARM Resource ID of either NNI or Internal Networks. + DestinationID *string + + // ARM Resource ID of destination Tap Rule that contains match configurations. + DestinationTapRuleID *string + + // Type of destination. Input can be IsolationDomain or Direct. + DestinationType *DestinationType + + // Isolation Domain Properties. + IsolationDomainProperties *IsolationDomainProperties + + // Destination name. + Name *string +} + +// NetworkTapRule - The NetworkTapRule resource definition. +type NetworkTapRule struct { + // REQUIRED; The geo-location where the resource lives + Location *string + // REQUIRED; Resource properties. - Properties *NetworkRackSKUProperties + Properties *NetworkTapRuleProperties + + // Resource tags. + Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -2312,97 +3089,251 @@ type NetworkRackSKU struct { Type *string } -// NetworkRackSKUProperties - NetworkRackSkuProperties define the resource properties. -type NetworkRackSKUProperties struct { - // REQUIRED; The role of the Network Rack: Aggregate or Compute. - RoleName *NetworkRackRoleName +// NetworkTapRuleAction - Action that need to performed. +type NetworkTapRuleAction struct { + // Destination Id. The ARM resource Id may be either Network To Network Interconnect or NeighborGroup. + DestinationID *string - // Maximum number of servers available for this SKU. - MaximumServerCount *int32 + // The parameter to enable or disable the timestamp. + IsTimestampEnabled *BooleanEnumProperty + + // 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. + MatchConfigurationName *string + + // Truncate. 0 indicates do not truncate. + Truncate *string + + // Type of actions that can be performed. + Type *TapRuleActionType +} + +// NetworkTapRuleMatchCondition - Defines the match condition that is supported to filter the traffic. +type NetworkTapRuleMatchCondition struct { + // Encapsulation Type. + EncapsulationType *EncapsulationType + + // IP condition that needs to be matched. + IPCondition *IPMatchCondition + + // Defines the port condition that needs to be matched. + PortCondition *PortCondition + + // List of the protocols that need to be matched. + ProtocolTypes []*string + + // Vlan match condition that needs to be matched. + VlanMatchCondition *VlanMatchCondition +} + +// NetworkTapRuleMatchConfiguration - Defines the match configuration that are supported to filter the traffic. +type NetworkTapRuleMatchConfiguration struct { + // List of actions that need to be performed for the matched conditions. + Actions []*NetworkTapRuleAction + + // Type of IP Address. IPv4 or IPv6 + IPAddressType *IPAddressType + + // List of the match conditions. + MatchConditions []*NetworkTapRuleMatchCondition + + // The name of the match configuration. + MatchConfigurationName *string + + // Sequence Number of the match configuration.. + SequenceNumber *int64 +} + +// NetworkTapRulePatch - The NetworkTapRule resource definition. +type NetworkTapRulePatch struct { + // Network Tap Rule Patch properties. + Properties *NetworkTapRulePatchProperties + + // Resource tags + Tags map[string]*string +} + +// NetworkTapRulePatchProperties - Network Tap Rule Patch properties. +type NetworkTapRulePatchProperties struct { + // Switch configuration description. + Annotation *string + + // Input method to configure Network Tap Rule. + ConfigurationType *ConfigurationType + + // List of dynamic match configurations. + DynamicMatchConfigurations []*CommonDynamicMatchConfiguration - // Maximum number of storage devices available for this SKU. - MaximumStorageCount *int32 + // List of match configurations. + MatchConfigurations []*NetworkTapRuleMatchConfiguration - // Maximum number of network uplinks available for this SKU. - MaximumUplinks *int32 + // Network Tap Rules file URL. + TapRulesURL *string +} + +// NetworkTapRuleProperties - Network Tap Rule Properties defines the resource properties. +type NetworkTapRuleProperties struct { + // Switch configuration description. + Annotation *string + + // Input method to configure Network Tap Rule. + ConfigurationType *ConfigurationType + + // List of dynamic match configurations. + DynamicMatchConfigurations []*CommonDynamicMatchConfiguration + + // List of match configurations. + MatchConfigurations []*NetworkTapRuleMatchConfiguration + + // Polling interval in seconds. + PollingIntervalInSeconds *PollingIntervalInSeconds + + // Network Tap Rules file URL. + TapRulesURL *string + + // READ-ONLY; Administrative state of the resource. + AdministrativeState *AdministrativeState + + // READ-ONLY; Configuration state of the resource. + ConfigurationState *ConfigurationState + + // READ-ONLY; The last sync timestamp. + LastSyncedTime *time.Time + + // READ-ONLY; The ARM resource Id of the NetworkTap. + NetworkTapID *string + + // READ-ONLY; Provisioning state of the resource. + ProvisioningState *ProvisioningState +} + +// NetworkTapRulesClientBeginCreateOptions contains the optional parameters for the NetworkTapRulesClient.BeginCreate method. +type NetworkTapRulesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkTapRulesClientBeginDeleteOptions contains the optional parameters for the NetworkTapRulesClient.BeginDelete method. +type NetworkTapRulesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkTapRulesClientBeginResyncOptions contains the optional parameters for the NetworkTapRulesClient.BeginResync method. +type NetworkTapRulesClientBeginResyncOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkTapRulesClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkTapRulesClient.BeginUpdateAdministrativeState +// method. +type NetworkTapRulesClientBeginUpdateAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkTapRulesClientBeginUpdateOptions contains the optional parameters for the NetworkTapRulesClient.BeginUpdate method. +type NetworkTapRulesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} - // List of network device properties / role for the Network Rack. - NetworkDevices []*NetworkDeviceRoleProperties +// NetworkTapRulesClientBeginValidateConfigurationOptions contains the optional parameters for the NetworkTapRulesClient.BeginValidateConfiguration +// method. +type NetworkTapRulesClientBeginValidateConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} - // READ-ONLY; Gets the provisioning state of the resource. - ProvisioningState *ProvisioningState +// NetworkTapRulesClientGetOptions contains the optional parameters for the NetworkTapRulesClient.Get method. +type NetworkTapRulesClientGetOptions struct { + // placeholder for future optional parameters } -// NetworkRackSKUsClientGetOptions contains the optional parameters for the NetworkRackSKUsClient.Get method. -type NetworkRackSKUsClientGetOptions struct { +// NetworkTapRulesClientListByResourceGroupOptions contains the optional parameters for the NetworkTapRulesClient.NewListByResourceGroupPager +// method. +type NetworkTapRulesClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// NetworkRackSKUsClientListBySubscriptionOptions contains the optional parameters for the NetworkRackSKUsClient.NewListBySubscriptionPager +// NetworkTapRulesClientListBySubscriptionOptions contains the optional parameters for the NetworkTapRulesClient.NewListBySubscriptionPager // method. -type NetworkRackSKUsClientListBySubscriptionOptions struct { +type NetworkTapRulesClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// NetworkRackSKUsListResult - List of NetworkRackSkus. -type NetworkRackSKUsListResult struct { +// NetworkTapRulesListResult - List of NetworkTapRules. +type NetworkTapRulesListResult struct { // Url to follow for getting next page of resources. NextLink *string - // List of NetworkRackSku resources. - Value []*NetworkRackSKU + // List of NetworkTapRule resources. + Value []*NetworkTapRule } -// NetworkRacksClientBeginCreateOptions contains the optional parameters for the NetworkRacksClient.BeginCreate method. -type NetworkRacksClientBeginCreateOptions struct { +// NetworkTapsClientBeginCreateOptions contains the optional parameters for the NetworkTapsClient.BeginCreate method. +type NetworkTapsClientBeginCreateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// NetworkRacksClientBeginDeleteOptions contains the optional parameters for the NetworkRacksClient.BeginDelete method. -type NetworkRacksClientBeginDeleteOptions struct { +// NetworkTapsClientBeginDeleteOptions contains the optional parameters for the NetworkTapsClient.BeginDelete method. +type NetworkTapsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// NetworkRacksClientBeginUpdateOptions contains the optional parameters for the NetworkRacksClient.BeginUpdate method. -type NetworkRacksClientBeginUpdateOptions struct { +// NetworkTapsClientBeginResyncOptions contains the optional parameters for the NetworkTapsClient.BeginResync method. +type NetworkTapsClientBeginResyncOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// NetworkRacksClientGetOptions contains the optional parameters for the NetworkRacksClient.Get method. -type NetworkRacksClientGetOptions struct { +// NetworkTapsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkTapsClient.BeginUpdateAdministrativeState +// method. +type NetworkTapsClientBeginUpdateAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkTapsClientBeginUpdateOptions contains the optional parameters for the NetworkTapsClient.BeginUpdate method. +type NetworkTapsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkTapsClientGetOptions contains the optional parameters for the NetworkTapsClient.Get method. +type NetworkTapsClientGetOptions struct { // placeholder for future optional parameters } -// NetworkRacksClientListByResourceGroupOptions contains the optional parameters for the NetworkRacksClient.NewListByResourceGroupPager +// NetworkTapsClientListByResourceGroupOptions contains the optional parameters for the NetworkTapsClient.NewListByResourceGroupPager // method. -type NetworkRacksClientListByResourceGroupOptions struct { +type NetworkTapsClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// NetworkRacksClientListBySubscriptionOptions contains the optional parameters for the NetworkRacksClient.NewListBySubscriptionPager +// NetworkTapsClientListBySubscriptionOptions contains the optional parameters for the NetworkTapsClient.NewListBySubscriptionPager // method. -type NetworkRacksClientListBySubscriptionOptions struct { +type NetworkTapsClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// NetworkRacksListResult - List of NetworkRacks. -type NetworkRacksListResult struct { +// NetworkTapsListResult - List of NetworkTaps. +type NetworkTapsListResult struct { // Url to follow for getting next page of resources. NextLink *string - // List of NetworkRack resources. - Value []*NetworkRack + // List of NetworkTap resources. + Value []*NetworkTap } -// NetworkToNetworkInterconnect - The NetworkToNetworkInterconnect resource definition. +// NetworkToNetworkInterconnect - The Network To Network Interconnect resource definition. type NetworkToNetworkInterconnect struct { - // Resource properties. + // REQUIRED; Resource properties. Properties *NetworkToNetworkInterconnectProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -2415,30 +3346,114 @@ type NetworkToNetworkInterconnect struct { Type *string } -// NetworkToNetworkInterconnectProperties - Configuration used to setup CE-PE connectivity. -type NetworkToNetworkInterconnectProperties struct { - // REQUIRED; Configuration to use NNI for Infrastructure Management. Example: True/False. - IsManagementType *BooleanEnumProperty +// NetworkToNetworkInterconnectPatch - The Network To Network Interconnect resource patch definition. +type NetworkToNetworkInterconnectPatch struct { + // Resource properties. + Properties *NetworkToNetworkInterconnectPatchableProperties - // REQUIRED; Based on this parameter the layer2/layer3 is made as mandatory. Example: True/False - UseOptionB *BooleanEnumProperty + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// NetworkToNetworkInterconnectPatchableProperties - Network to Network Interconnect patchable properties. +type NetworkToNetworkInterconnectPatchableProperties struct { + // Egress Acl. ARM resource ID of Access Control Lists. + EgressACLID *string + + // Export Route Policy information + ExportRoutePolicy *ExportRoutePolicyInformation + + // Import Route Policy information. + ImportRoutePolicy *ImportRoutePolicyInformation + + // Ingress Acl. ARM resource ID of Access Control Lists. + IngressACLID *string // Common properties for Layer2Configuration. Layer2Configuration *Layer2Configuration + // NPB Static Route Configuration properties. + NpbStaticRouteConfiguration *NpbStaticRouteConfiguration + // Common properties for Layer3Configuration. - Layer3Configuration *Layer3Configuration + OptionBLayer3Configuration *OptionBLayer3Configuration +} + +// NetworkToNetworkInterconnectProperties - Configuration used to setup CE-PE connectivity. +type NetworkToNetworkInterconnectProperties struct { + // REQUIRED; Based on this option layer3 parameters are mandatory. Example: True/False + UseOptionB *BooleanEnumProperty + + // Egress Acl. ARM resource ID of Access Control Lists. + EgressACLID *string + + // Export Route Policy configuration. + ExportRoutePolicy *ExportRoutePolicyInformation + + // Import Route Policy configuration. + ImportRoutePolicy *ImportRoutePolicyInformation + + // Ingress Acl. ARM resource ID of Access Control Lists. + IngressACLID *string + + // Configuration to use NNI for Infrastructure Management. Example: True/False. + IsManagementType *IsManagementType + + // Common properties for Layer2 Configuration. + Layer2Configuration *Layer2Configuration // Type of NNI used. Example: CE | NPB NniType *NniType - // READ-ONLY; Gets the administrativeState of the resource. Example -Enabled/Disabled - AdministrativeState *EnabledDisabledState + // NPB Static Route Configuration properties. + NpbStaticRouteConfiguration *NpbStaticRouteConfiguration + + // Common properties for Layer3Configuration. + OptionBLayer3Configuration *NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration + + // READ-ONLY; Administrative state of the resource. + AdministrativeState *AdministrativeState + + // READ-ONLY; Configuration state of the resource. + ConfigurationState *ConfigurationState - // READ-ONLY; Gets the provisioning state of the resource. + // READ-ONLY; Provisioning state of the resource. ProvisioningState *ProvisioningState } +// NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration - Common properties for Layer3Configuration. +type NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration struct { + // ASN of PE devices for CE/PE connectivity.Example : 28 + PeerASN *int64 + + // IPv4 Address Prefix. + PrimaryIPv4Prefix *string + + // IPv6 Address Prefix. + PrimaryIPv6Prefix *string + + // Secondary IPv4 Address Prefix. + SecondaryIPv4Prefix *string + + // Secondary IPv6 Address Prefix. + SecondaryIPv6Prefix *string + + // VLAN for CE/PE Layer 3 connectivity.Example : 501 + VlanID *int32 + + // READ-ONLY; ASN of CE devices for CE/PE connectivity. + FabricASN *int64 +} + // NetworkToNetworkInterconnectsClientBeginCreateOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.BeginCreate // method. type NetworkToNetworkInterconnectsClientBeginCreateOptions struct { @@ -2453,19 +3468,40 @@ type NetworkToNetworkInterconnectsClientBeginDeleteOptions struct { ResumeToken string } +// NetworkToNetworkInterconnectsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.BeginUpdateAdministrativeState +// method. +type NetworkToNetworkInterconnectsClientBeginUpdateAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkToNetworkInterconnectsClientBeginUpdateNpbStaticRouteBfdAdministrativeStateOptions contains the optional parameters +// for the NetworkToNetworkInterconnectsClient.BeginUpdateNpbStaticRouteBfdAdministrativeState method. +type NetworkToNetworkInterconnectsClientBeginUpdateNpbStaticRouteBfdAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkToNetworkInterconnectsClientBeginUpdateOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.BeginUpdate +// method. +type NetworkToNetworkInterconnectsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // NetworkToNetworkInterconnectsClientGetOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.Get // method. type NetworkToNetworkInterconnectsClientGetOptions struct { // placeholder for future optional parameters } -// NetworkToNetworkInterconnectsClientListOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.NewListPager +// NetworkToNetworkInterconnectsClientListByNetworkFabricOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.NewListByNetworkFabricPager // method. -type NetworkToNetworkInterconnectsClientListOptions struct { +type NetworkToNetworkInterconnectsClientListByNetworkFabricOptions struct { // placeholder for future optional parameters } -// NetworkToNetworkInterconnectsList - List of NetworkToNetworkInterconnects. +// NetworkToNetworkInterconnectsList - List of Network To Network Interconnects. type NetworkToNetworkInterconnectsList struct { // Url to follow for getting next page of resources. NextLink *string @@ -2474,6 +3510,18 @@ type NetworkToNetworkInterconnectsList struct { Value []*NetworkToNetworkInterconnect } +// NpbStaticRouteConfiguration - NPB Static Route Configuration properties. +type NpbStaticRouteConfiguration struct { + // BFD Configuration properties. + BfdConfiguration *BfdConfiguration + + // List of IPv4 Routes. + IPv4Routes []*StaticRouteProperties + + // List of IPv6 Routes. + IPv6Routes []*StaticRouteProperties +} + // Operation - Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { // Localized display information for this particular operation. @@ -2528,61 +3576,77 @@ type OperationsClientListOptions struct { // placeholder for future optional parameters } -// OptionAProperties - Peering optionA properties -type OptionAProperties struct { - // BFD Configuration properties. - BfdConfiguration *FabricBfdConfiguration - - // MTU to use for option A peering. - Mtu *int32 - - // Peer ASN number.Example : 28 - PeerASN *int32 +// OptionBLayer3Configuration - OptionB Layer3 Configuration properties. +type OptionBLayer3Configuration struct { + // ASN of PE devices for CE/PE connectivity.Example : 28 + PeerASN *int64 - // IPv4 Address Prefix of CE-PE interconnect links. Example: 172.31.0.0/31. The values can be specified at the time of creation - // or can be updated afterwards. Any update to the values post-provisioning - // may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. The 2nd and 4th IPs - // are to be configured on PE1 and PE2 for Option B interfaces. + // IPv4 Address Prefix. PrimaryIPv4Prefix *string - // IPv6 Address Prefix of CE-PE interconnect links. Example: 3FFE:FFFF:0:CD30::a0/126. The values can be specified at the - // time of creation or can be updated afterwards. Any update to the values - // post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. - // The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + // IPv6 Address Prefix. PrimaryIPv6Prefix *string - // Secondary IPv4 Address Prefix of CE-PE interconnect links. Example: 172.31.0.20/31. The values can be specified at the - // time of creation or can be updated afterwards. Any update to the values - // post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. - // The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + // Secondary IPv4 Address Prefix. SecondaryIPv4Prefix *string - // Secondary IPv6 Address Prefix of CE-PE interconnect links. Example: 3FFE:FFFF:0:CD30::a4/126. The values can be specified - // at the time of creation or can be updated afterwards. Any update to the values - // post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. - // The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + // Secondary IPv6 Address Prefix. SecondaryIPv6Prefix *string - // Vlan identifier. Example : 501 + // VLAN for CE/PE Layer 3 connectivity.Example : 501 VlanID *int32 + + // READ-ONLY; ASN of CE devices for CE/PE connectivity. + FabricASN *int64 } -// OptionBProperties - Option B configuration. +// OptionBProperties - Option B configuration to be used for Management VPN. type OptionBProperties struct { - // Route Targets to be applied for outgoing routes from CE. + // Route Targets to be applied for outgoing routes from CE. This is for backward compatibility. ExportRouteTargets []*string - // Route Targets to be applied for incoming routes into CE. + // Route Targets to be applied for incoming routes into CE. This is for backward compatibility. ImportRouteTargets []*string + + // Route Targets to be applied. + RouteTargets *RouteTargetInformation } -// OptionBPropertiesAutoGenerated - Option B configuration. -type OptionBPropertiesAutoGenerated struct { - // REQUIRED; Route Targets to be applied for outgoing routes from CE. - ExportRouteTargets []*string +// PortCondition - Port condition that needs to be matched. +type PortCondition struct { + // REQUIRED; Layer4 protocol type that needs to be matched. + Layer4Protocol *Layer4Protocol - // REQUIRED; Route Targets to be applied for incoming routes into CE. - ImportRouteTargets []*string + // List of the port Group Names that to be matched. + PortGroupNames []*string + + // Port type that needs to be matched. + PortType *PortType + + // List of the Ports that need to be matched. + Ports []*string +} + +// PortGroupProperties - Port Group properties. +type PortGroupProperties struct { + // The name of the port group. + Name *string + + // List of the ports that needs to be matched. + Ports []*string +} + +// RebootProperties - Reboot properties. +type RebootProperties struct { + // Type of reboot to be performed. Example: GracefulRebootWithZTP + RebootType *RebootType +} + +// RoutePoliciesClientBeginCommitConfigurationOptions contains the optional parameters for the RoutePoliciesClient.BeginCommitConfiguration +// method. +type RoutePoliciesClientBeginCommitConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } // RoutePoliciesClientBeginCreateOptions contains the optional parameters for the RoutePoliciesClient.BeginCreate method. @@ -2597,12 +3661,26 @@ type RoutePoliciesClientBeginDeleteOptions struct { ResumeToken string } +// RoutePoliciesClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the RoutePoliciesClient.BeginUpdateAdministrativeState +// method. +type RoutePoliciesClientBeginUpdateAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // RoutePoliciesClientBeginUpdateOptions contains the optional parameters for the RoutePoliciesClient.BeginUpdate method. type RoutePoliciesClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } +// RoutePoliciesClientBeginValidateConfigurationOptions contains the optional parameters for the RoutePoliciesClient.BeginValidateConfiguration +// method. +type RoutePoliciesClientBeginValidateConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // RoutePoliciesClientGetOptions contains the optional parameters for the RoutePoliciesClient.Get method. type RoutePoliciesClientGetOptions struct { // placeholder for future optional parameters @@ -2640,7 +3718,7 @@ type RoutePolicy struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -2653,25 +3731,46 @@ type RoutePolicy struct { Type *string } -// RoutePolicyPatch - The RoutePolicy patch resource definition. +// RoutePolicyPatch - The Route Policy patch resource definition. type RoutePolicyPatch struct { + // The RoutePolicy patchable properties. + Properties *RoutePolicyPatchableProperties + // Resource tags Tags map[string]*string } -// RoutePolicyProperties - RoutePolicy Properties define the resource properties. -type RoutePolicyProperties struct { - // REQUIRED; Route Policy statements. +// RoutePolicyPatchableProperties - Route Policy patchable properties. +type RoutePolicyPatchableProperties struct { + // Route Policy statements. Statements []*RoutePolicyStatementProperties +} + +// RoutePolicyProperties defines the resource properties. +type RoutePolicyProperties struct { + // REQUIRED; Arm Resource ID of Network Fabric. + NetworkFabricID *string + + // AddressFamilyType. This parameter decides whether the given ipv4 or ipv6 route policy. + AddressFamilyType *AddressFamilyType // Switch configuration description. Annotation *string - // READ-ONLY; Gets the provisioning state of the resource. + // Route Policy statements. + Statements []*RoutePolicyStatementProperties + + // READ-ONLY; Administrative state of the resource. + AdministrativeState *AdministrativeState + + // READ-ONLY; Configuration state of the resource. + ConfigurationState *ConfigurationState + + // READ-ONLY; Provisioning state of the resource. ProvisioningState *ProvisioningState } -// RoutePolicyStatementProperties - Route Policy Statement properties.. +// RoutePolicyStatementProperties - Route Policy Statement properties. type RoutePolicyStatementProperties struct { // REQUIRED; Route policy action properties. Action *StatementActionProperties @@ -2686,10 +3785,34 @@ type RoutePolicyStatementProperties struct { Annotation *string } +// RouteTargetInformation - Route Target Configuration. +type RouteTargetInformation struct { + // Route Targets to be applied for outgoing routes into CE. + ExportIPv4RouteTargets []*string + + // Route Targets to be applied for outgoing routes from CE. + ExportIPv6RouteTargets []*string + + // Route Targets to be applied for incoming routes into CE. + ImportIPv4RouteTargets []*string + + // Route Targets to be applied for incoming routes from CE. + ImportIPv6RouteTargets []*string +} + +// RuleProperties - Rules for the InternetGateways +type RuleProperties struct { + // REQUIRED; Specify action. + Action *Action + + // REQUIRED; List of Addresses to be allowed or denied. + AddressList []*string +} + // StatementActionProperties - Route policy action properties. type StatementActionProperties struct { - // REQUIRED; action. Example: Permit | Deny. - ActionType *CommunityActionTypes + // REQUIRED; Action type. Example: Permit | Deny | Continue. + ActionType *RoutePolicyActionType // IP Community Properties. IPCommunityProperties *ActionIPCommunityProperties @@ -2697,7 +3820,7 @@ type StatementActionProperties struct { // IP Extended Community Properties. IPExtendedCommunityProperties *ActionIPExtendedCommunityProperties - // localPreference of the route policy. + // Local Preference of the route policy. LocalPreference *int64 } @@ -2711,51 +3834,46 @@ type StatementConditionProperties struct { // Arm Resource Id of IpPrefix. IPPrefixID *string + + // Type of the condition used. + Type *RoutePolicyConditionType } -// StaticRouteConfiguration - staticRouteConfiguration model. +// StaticRouteConfiguration - Static Route Configuration properties. type StaticRouteConfiguration struct { // BFD configuration properties BfdConfiguration *BfdConfiguration - // List with object IPv4Routes. + // List of IPv4 Routes. IPv4Routes []*StaticRouteProperties - // List with object IPv6Routes. + // List of IPv6 Routes. IPv6Routes []*StaticRouteProperties } -// StaticRouteProperties - Static Route properties. +// StaticRouteProperties - Route Properties. type StaticRouteProperties struct { - // REQUIRED; List of next hop IPv4 | IPv6 addresses. + // REQUIRED; List of next hop addresses. NextHop []*string - // REQUIRED; IPv4 | IPv6 Prefix. + // REQUIRED; Prefix of the route. Prefix *string } -// SupportPackageProperties - Generate support package post action properties. -type SupportPackageProperties struct { - // REQUIRED; The URL to fetch the generated support package from. - SupportPackageURL *string -} - // SupportedConnectorProperties - Supported connector properties. type SupportedConnectorProperties struct { - // Connector type. Example: Optical. + // Type of connector used. Example: Optical. ConnectorType *string // Maximum speed of the connector in Mbps. MaxSpeedInMbps *int32 } -// SupportedVersionProperties - Network device supported version properties. +// SupportedVersionProperties - Supported version details of the network device. type SupportedVersionProperties struct { - // If the current version is in use. - IsCurrent *IsCurrentVersion - - // If the current version is a test version. - IsTest *IsTestVersion + // If true newly provisioned Fabric will use this device version by default to bootstrap the network devices for the first + // time. + IsDefault *BooleanEnumProperty // Firmware version. VendorFirmwareVersion *string @@ -2788,33 +3906,27 @@ type SystemData struct { LastModifiedByType *CreatedByType } +// TagsUpdate - Base tracked resource type for PATCH updates. +type TagsUpdate struct { + // Resource tags + Tags map[string]*string +} + // TerminalServerConfiguration - Network and credentials configuration currently applied to terminal server. type TerminalServerConfiguration struct { // Password for the terminal server connection. Password *string - // IPv4 Address Prefix of CE-PE interconnect links. Example: 172.31.0.0/31. The values can be specified at the time of creation - // or can be updated afterwards. Any update to the values post-provisioning - // may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. The 2nd and 4th IPs - // are to be configured on PE1 and PE2 for Option B interfaces. + // IPv4 Address Prefix. PrimaryIPv4Prefix *string - // IPv6 Address Prefix of CE-PE interconnect links. Example: 3FFE:FFFF:0:CD30::a0/126. The values can be specified at the - // time of creation or can be updated afterwards. Any update to the values - // post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. - // The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + // IPv6 Address Prefix. PrimaryIPv6Prefix *string - // Secondary IPv4 Address Prefix of CE-PE interconnect links. Example: 172.31.0.20/31. The values can be specified at the - // time of creation or can be updated afterwards. Any update to the values - // post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. - // The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + // Secondary IPv4 Address Prefix. SecondaryIPv4Prefix *string - // Secondary IPv6 Address Prefix of CE-PE interconnect links. Example: 3FFE:FFFF:0:CD30::a4/126. The values can be specified - // at the time of creation or can be updated afterwards. Any update to the values - // post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. - // The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + // Secondary IPv6 Address Prefix. SecondaryIPv6Prefix *string // Serial Number of Terminal server. @@ -2827,66 +3939,152 @@ type TerminalServerConfiguration struct { NetworkDeviceID *string } -// TerminalServerPatchableProperties - Network and credential configuration currently applied on terminal server. -type TerminalServerPatchableProperties struct { - // Password for the terminal server connection. - Password *string - - // Serial Number of Terminal server. - SerialNumber *string +// UpdateAdministrativeState - Update administrative state on list of resources. +type UpdateAdministrativeState struct { + // Network Fabrics or Network Rack resource Id. + ResourceIDs []*string - // Username for the terminal server connection. - Username *string + // Administrative state. + State *EnableDisableState } -// UpdateAdministrativeState - Update administrative state on list of resources. -type UpdateAdministrativeState struct { +// UpdateDeviceAdministrativeState - Update the administrative state on list of resources. +type UpdateDeviceAdministrativeState struct { // Network Fabrics or Network Rack resource Id. ResourceIDs []*string // Administrative state. - State *AdministrativeState + State *DeviceAdministrativeState +} + +// UpdateVersion - Update version properties. +type UpdateVersion struct { + // Specify the version. + Version *string } -// UpdatePowerCycleProperties - Update power cycle input properties. -type UpdatePowerCycleProperties struct { - // REQUIRED; Primary or Secondary power end. - PowerEnd *PowerEnd +// VPNConfigurationPatchableProperties - Network and credential configuration currently applied on terminal server. +type VPNConfigurationPatchableProperties struct { + // ARM Resource ID of the Network To Network Interconnect. + NetworkToNetworkInterconnectID *string + + // option A properties + OptionAProperties *VPNConfigurationPatchablePropertiesOptionAProperties + + // option B properties + OptionBProperties *OptionBProperties - // REQUIRED; On or Off toggle state. - State *State + // Peering option list. + PeeringOption *PeeringOption } -// UpdateVersionProperties - Generate support package post action properties. -type UpdateVersionProperties struct { - // REQUIRED; The supported version defined in network device SKU. - SKUVersion *string +// VPNConfigurationPatchablePropertiesOptionAProperties - option A properties +type VPNConfigurationPatchablePropertiesOptionAProperties struct { + // BFD Configuration properties. + BfdConfiguration *BfdConfiguration + + // MTU to use for option A peering. + Mtu *int32 + + // Peer ASN number.Example : 28 + PeerASN *int64 + + // IPv4 Address Prefix. + PrimaryIPv4Prefix *string + + // IPv6 Address Prefix. + PrimaryIPv6Prefix *string + + // Secondary IPv4 Address Prefix. + SecondaryIPv4Prefix *string + + // Secondary IPv6 Address Prefix. + SecondaryIPv6Prefix *string + + // Vlan Id.Example : 501 + VlanID *int32 } -// VPNConfigurationProperties - Configuration for infrastructure vpn. +// VPNConfigurationProperties - Network and credential configuration currently applied on terminal server. type VPNConfigurationProperties struct { // REQUIRED; Peering option list. PeeringOption *PeeringOption + // ARM Resource ID of the Network To Network Interconnect. + NetworkToNetworkInterconnectID *string + // option A properties - OptionAProperties *OptionAProperties + OptionAProperties *VPNConfigurationPropertiesOptionAProperties // option B properties - OptionBProperties *OptionBPropertiesAutoGenerated + OptionBProperties *OptionBProperties - // READ-ONLY; Indicates configuration state. Example: Enabled | Disabled. - AdministrativeState *EnabledDisabledState + // READ-ONLY; Administrative state of the resource. + AdministrativeState *AdministrativeState +} - // READ-ONLY; Gets the networkToNetworkInterconnectId of the resource. - NetworkToNetworkInterconnectID *string +// VPNConfigurationPropertiesOptionAProperties - option A properties +type VPNConfigurationPropertiesOptionAProperties struct { + // BFD Configuration properties. + BfdConfiguration *BfdConfiguration + + // MTU to use for option A peering. + Mtu *int32 + + // Peer ASN number.Example : 28 + PeerASN *int64 + + // IPv4 Address Prefix. + PrimaryIPv4Prefix *string + + // IPv6 Address Prefix. + PrimaryIPv6Prefix *string + + // Secondary IPv4 Address Prefix. + SecondaryIPv4Prefix *string + + // Secondary IPv6 Address Prefix. + SecondaryIPv6Prefix *string + + // Vlan Id.Example : 501 + VlanID *int32 } -// WorkloadServices IP ranges. -type WorkloadServices struct { - // The IPv4 Address space is optional, if the value is defined at the time of NFC creation, then the default value 10.0.0.0/19 - // is considered. The IPV4 address subnet is an optional attribute. - IPv4AddressSpaces []*string +// ValidateConfigurationProperties - Validation configuration properties. +type ValidateConfigurationProperties struct { + // Validate action that to be performed + ValidateAction *ValidateAction +} - // The IPv6 is not supported right now. - IPv6AddressSpaces []*string +// ValidateConfigurationResponse - The response of the action validate configuration. +type ValidateConfigurationResponse struct { + // The error object. + Error *ErrorDetail + + // URL for the details of the response. + URL *string + + // READ-ONLY; Gets the configuration state. + ConfigurationState *ConfigurationState +} + +// VlanGroupProperties - Vlan group properties. +type VlanGroupProperties struct { + // Vlan group name. + Name *string + + // List of vlans. + Vlans []*string +} + +// VlanMatchCondition - The vlan match conditions that needs to be matched. +type VlanMatchCondition struct { + // List of inner vlans that needs to be matched. + InnerVlans []*string + + // List of vlan group names that to be matched. + VlanGroupNames []*string + + // List of vlans that needs to be matched. + Vlans []*string } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/models_serde.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/models_serde.go index 58d8e997d152..9a89b0314f02 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/models_serde.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/models_serde.go @@ -16,49 +16,6 @@ import ( "reflect" ) -// MarshalJSON implements the json.Marshaller interface for type ARPProperties. -func (a ARPProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "address", a.Address) - populate(objectMap, "age", a.Age) - populate(objectMap, "interface", a.Interface) - populate(objectMap, "macAddress", a.MacAddress) - populate(objectMap, "state", a.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ARPProperties. -func (a *ARPProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "address": - err = unpopulate(val, "Address", &a.Address) - delete(rawMsg, key) - case "age": - err = unpopulate(val, "Age", &a.Age) - delete(rawMsg, key) - case "interface": - err = unpopulate(val, "Interface", &a.Interface) - delete(rawMsg, key) - case "macAddress": - err = unpopulate(val, "MacAddress", &a.MacAddress) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &a.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type AccessControlList. func (a AccessControlList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -110,22 +67,16 @@ func (a *AccessControlList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AccessControlListConditionProperties. -func (a AccessControlListConditionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AccessControlListAction. +func (a AccessControlListAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "action", a.Action) - populate(objectMap, "annotation", a.Annotation) - populate(objectMap, "destinationAddress", a.DestinationAddress) - populate(objectMap, "destinationPort", a.DestinationPort) - populate(objectMap, "protocol", a.Protocol) - populate(objectMap, "sequenceNumber", a.SequenceNumber) - populate(objectMap, "sourceAddress", a.SourceAddress) - populate(objectMap, "sourcePort", a.SourcePort) + populate(objectMap, "counterName", a.CounterName) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AccessControlListConditionProperties. -func (a *AccessControlListConditionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessControlListAction. +func (a *AccessControlListAction) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -133,29 +84,113 @@ func (a *AccessControlListConditionProperties) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "action": - err = unpopulate(val, "Action", &a.Action) + case "counterName": + err = unpopulate(val, "CounterName", &a.CounterName) delete(rawMsg, key) - case "annotation": - err = unpopulate(val, "Annotation", &a.Annotation) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccessControlListMatchCondition. +func (a AccessControlListMatchCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dscpMarkings", a.DscpMarkings) + populate(objectMap, "etherTypes", a.EtherTypes) + populate(objectMap, "fragments", a.Fragments) + populate(objectMap, "ipCondition", a.IPCondition) + populate(objectMap, "ipLengths", a.IPLengths) + populate(objectMap, "portCondition", a.PortCondition) + populate(objectMap, "protocolTypes", a.ProtocolTypes) + populate(objectMap, "ttlValues", a.TTLValues) + populate(objectMap, "vlanMatchCondition", a.VlanMatchCondition) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessControlListMatchCondition. +func (a *AccessControlListMatchCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dscpMarkings": + err = unpopulate(val, "DscpMarkings", &a.DscpMarkings) delete(rawMsg, key) - case "destinationAddress": - err = unpopulate(val, "DestinationAddress", &a.DestinationAddress) + case "etherTypes": + err = unpopulate(val, "EtherTypes", &a.EtherTypes) delete(rawMsg, key) - case "destinationPort": - err = unpopulate(val, "DestinationPort", &a.DestinationPort) + case "fragments": + err = unpopulate(val, "Fragments", &a.Fragments) delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &a.Protocol) + case "ipCondition": + err = unpopulate(val, "IPCondition", &a.IPCondition) delete(rawMsg, key) - case "sequenceNumber": - err = unpopulate(val, "SequenceNumber", &a.SequenceNumber) + case "ipLengths": + err = unpopulate(val, "IPLengths", &a.IPLengths) + delete(rawMsg, key) + case "portCondition": + err = unpopulate(val, "PortCondition", &a.PortCondition) + delete(rawMsg, key) + case "protocolTypes": + err = unpopulate(val, "ProtocolTypes", &a.ProtocolTypes) + delete(rawMsg, key) + case "ttlValues": + err = unpopulate(val, "TTLValues", &a.TTLValues) + delete(rawMsg, key) + case "vlanMatchCondition": + err = unpopulate(val, "VlanMatchCondition", &a.VlanMatchCondition) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccessControlListMatchConfiguration. +func (a AccessControlListMatchConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actions", a.Actions) + populate(objectMap, "ipAddressType", a.IPAddressType) + populate(objectMap, "matchConditions", a.MatchConditions) + populate(objectMap, "matchConfigurationName", a.MatchConfigurationName) + populate(objectMap, "sequenceNumber", a.SequenceNumber) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessControlListMatchConfiguration. +func (a *AccessControlListMatchConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actions": + err = unpopulate(val, "Actions", &a.Actions) + delete(rawMsg, key) + case "ipAddressType": + err = unpopulate(val, "IPAddressType", &a.IPAddressType) delete(rawMsg, key) - case "sourceAddress": - err = unpopulate(val, "SourceAddress", &a.SourceAddress) + case "matchConditions": + err = unpopulate(val, "MatchConditions", &a.MatchConditions) delete(rawMsg, key) - case "sourcePort": - err = unpopulate(val, "SourcePort", &a.SourcePort) + case "matchConfigurationName": + err = unpopulate(val, "MatchConfigurationName", &a.MatchConfigurationName) + delete(rawMsg, key) + case "sequenceNumber": + err = unpopulate(val, "SequenceNumber", &a.SequenceNumber) delete(rawMsg, key) } if err != nil { @@ -199,9 +234,11 @@ func (a *AccessControlListPatch) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AccessControlListPatchProperties. func (a AccessControlListPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "addressFamily", a.AddressFamily) + populate(objectMap, "aclsUrl", a.ACLsURL) populate(objectMap, "annotation", a.Annotation) - populate(objectMap, "conditions", a.Conditions) + populate(objectMap, "configurationType", a.ConfigurationType) + populate(objectMap, "dynamicMatchConfigurations", a.DynamicMatchConfigurations) + populate(objectMap, "matchConfigurations", a.MatchConfigurations) return json.Marshal(objectMap) } @@ -214,14 +251,63 @@ func (a *AccessControlListPatchProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "addressFamily": - err = unpopulate(val, "AddressFamily", &a.AddressFamily) + case "aclsUrl": + err = unpopulate(val, "ACLsURL", &a.ACLsURL) delete(rawMsg, key) case "annotation": err = unpopulate(val, "Annotation", &a.Annotation) delete(rawMsg, key) - case "conditions": - err = unpopulate(val, "Conditions", &a.Conditions) + case "configurationType": + err = unpopulate(val, "ConfigurationType", &a.ConfigurationType) + delete(rawMsg, key) + case "dynamicMatchConfigurations": + err = unpopulate(val, "DynamicMatchConfigurations", &a.DynamicMatchConfigurations) + delete(rawMsg, key) + case "matchConfigurations": + err = unpopulate(val, "MatchConfigurations", &a.MatchConfigurations) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccessControlListPortCondition. +func (a AccessControlListPortCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "flags", a.Flags) + populate(objectMap, "layer4Protocol", a.Layer4Protocol) + populate(objectMap, "portGroupNames", a.PortGroupNames) + populate(objectMap, "portType", a.PortType) + populate(objectMap, "ports", a.Ports) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessControlListPortCondition. +func (a *AccessControlListPortCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "flags": + err = unpopulate(val, "Flags", &a.Flags) + delete(rawMsg, key) + case "layer4Protocol": + err = unpopulate(val, "Layer4Protocol", &a.Layer4Protocol) + delete(rawMsg, key) + case "portGroupNames": + err = unpopulate(val, "PortGroupNames", &a.PortGroupNames) + delete(rawMsg, key) + case "portType": + err = unpopulate(val, "PortType", &a.PortType) + delete(rawMsg, key) + case "ports": + err = unpopulate(val, "Ports", &a.Ports) delete(rawMsg, key) } if err != nil { @@ -234,9 +320,14 @@ func (a *AccessControlListPatchProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AccessControlListProperties. func (a AccessControlListProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "addressFamily", a.AddressFamily) + populate(objectMap, "aclsUrl", a.ACLsURL) + populate(objectMap, "administrativeState", a.AdministrativeState) populate(objectMap, "annotation", a.Annotation) - populate(objectMap, "conditions", a.Conditions) + populate(objectMap, "configurationState", a.ConfigurationState) + populate(objectMap, "configurationType", a.ConfigurationType) + populate(objectMap, "dynamicMatchConfigurations", a.DynamicMatchConfigurations) + populateTimeRFC3339(objectMap, "lastSyncedTime", a.LastSyncedTime) + populate(objectMap, "matchConfigurations", a.MatchConfigurations) populate(objectMap, "provisioningState", a.ProvisioningState) return json.Marshal(objectMap) } @@ -250,14 +341,29 @@ func (a *AccessControlListProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "addressFamily": - err = unpopulate(val, "AddressFamily", &a.AddressFamily) + case "aclsUrl": + err = unpopulate(val, "ACLsURL", &a.ACLsURL) + delete(rawMsg, key) + case "administrativeState": + err = unpopulate(val, "AdministrativeState", &a.AdministrativeState) delete(rawMsg, key) case "annotation": err = unpopulate(val, "Annotation", &a.Annotation) delete(rawMsg, key) - case "conditions": - err = unpopulate(val, "Conditions", &a.Conditions) + case "configurationState": + err = unpopulate(val, "ConfigurationState", &a.ConfigurationState) + delete(rawMsg, key) + case "configurationType": + err = unpopulate(val, "ConfigurationType", &a.ConfigurationType) + delete(rawMsg, key) + case "dynamicMatchConfigurations": + err = unpopulate(val, "DynamicMatchConfigurations", &a.DynamicMatchConfigurations) + delete(rawMsg, key) + case "lastSyncedTime": + err = unpopulateTimeRFC3339(val, "LastSyncedTime", &a.LastSyncedTime) + delete(rawMsg, key) + case "matchConfigurations": + err = unpopulate(val, "MatchConfigurations", &a.MatchConfigurations) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) @@ -433,7 +539,7 @@ func (a *AggregateRouteConfiguration) UnmarshalJSON(data []byte) error { func (b BfdConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "administrativeState", b.AdministrativeState) - populate(objectMap, "interval", b.Interval) + populate(objectMap, "intervalInMilliSeconds", b.IntervalInMilliSeconds) populate(objectMap, "multiplier", b.Multiplier) return json.Marshal(objectMap) } @@ -450,8 +556,8 @@ func (b *BfdConfiguration) UnmarshalJSON(data []byte) error { case "administrativeState": err = unpopulate(val, "AdministrativeState", &b.AdministrativeState) delete(rawMsg, key) - case "interval": - err = unpopulate(val, "Interval", &b.Interval) + case "intervalInMilliSeconds": + err = unpopulate(val, "IntervalInMilliSeconds", &b.IntervalInMilliSeconds) delete(rawMsg, key) case "multiplier": err = unpopulate(val, "Multiplier", &b.Multiplier) @@ -531,16 +637,17 @@ func (b *BgpConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectedSubnet. -func (c ConnectedSubnet) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CommonDynamicMatchConfiguration. +func (c CommonDynamicMatchConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "annotation", c.Annotation) - populate(objectMap, "prefix", c.Prefix) + populate(objectMap, "ipGroups", c.IPGroups) + populate(objectMap, "portGroups", c.PortGroups) + populate(objectMap, "vlanGroups", c.VlanGroups) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedSubnet. -func (c *ConnectedSubnet) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CommonDynamicMatchConfiguration. +func (c *CommonDynamicMatchConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -548,11 +655,14 @@ func (c *ConnectedSubnet) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "annotation": - err = unpopulate(val, "Annotation", &c.Annotation) + case "ipGroups": + err = unpopulate(val, "IPGroups", &c.IPGroups) delete(rawMsg, key) - case "prefix": - err = unpopulate(val, "Prefix", &c.Prefix) + case "portGroups": + err = unpopulate(val, "PortGroups", &c.PortGroups) + delete(rawMsg, key) + case "vlanGroups": + err = unpopulate(val, "VlanGroups", &c.VlanGroups) delete(rawMsg, key) } if err != nil { @@ -562,230 +672,214 @@ func (c *ConnectedSubnet) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DeviceInterfaceProperties. -func (d DeviceInterfaceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CommonPostActionResponseForDeviceUpdate. +func (c CommonPostActionResponseForDeviceUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identifier", d.Identifier) - populate(objectMap, "interfaceType", d.InterfaceType) - populate(objectMap, "supportedConnectorTypes", d.SupportedConnectorTypes) + populate(objectMap, "configurationState", c.ConfigurationState) + populate(objectMap, "error", c.Error) + populate(objectMap, "failedDevices", c.FailedDevices) + populate(objectMap, "successfulDevices", c.SuccessfulDevices) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceInterfaceProperties. -func (d *DeviceInterfaceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CommonPostActionResponseForDeviceUpdate. +func (c *CommonPostActionResponseForDeviceUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "identifier": - err = unpopulate(val, "Identifier", &d.Identifier) + case "configurationState": + err = unpopulate(val, "ConfigurationState", &c.ConfigurationState) delete(rawMsg, key) - case "interfaceType": - err = unpopulate(val, "InterfaceType", &d.InterfaceType) + case "error": + err = unpopulate(val, "Error", &c.Error) delete(rawMsg, key) - case "supportedConnectorTypes": - err = unpopulate(val, "SupportedConnectorTypes", &d.SupportedConnectorTypes) + case "failedDevices": + err = unpopulate(val, "FailedDevices", &c.FailedDevices) + delete(rawMsg, key) + case "successfulDevices": + err = unpopulate(val, "SuccessfulDevices", &c.SuccessfulDevices) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DeviceLimits. -func (d DeviceLimits) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CommonPostActionResponseForStateUpdate. +func (c CommonPostActionResponseForStateUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "maxBidirectionalForwardingDetectionPeers", d.MaxBidirectionalForwardingDetectionPeers) - populate(objectMap, "maxBorderGatewayProtocolPeers", d.MaxBorderGatewayProtocolPeers) - populate(objectMap, "maxSubInterfaces", d.MaxSubInterfaces) - populate(objectMap, "maxTunnelInterfaces", d.MaxTunnelInterfaces) - populate(objectMap, "maxVirtualRouterFunctions", d.MaxVirtualRouterFunctions) - populate(objectMap, "physicalInterfaceCount", d.PhysicalInterfaceCount) + populate(objectMap, "configurationState", c.ConfigurationState) + populate(objectMap, "error", c.Error) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceLimits. -func (d *DeviceLimits) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CommonPostActionResponseForStateUpdate. +func (c *CommonPostActionResponseForStateUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "maxBidirectionalForwardingDetectionPeers": - err = unpopulate(val, "MaxBidirectionalForwardingDetectionPeers", &d.MaxBidirectionalForwardingDetectionPeers) - delete(rawMsg, key) - case "maxBorderGatewayProtocolPeers": - err = unpopulate(val, "MaxBorderGatewayProtocolPeers", &d.MaxBorderGatewayProtocolPeers) - delete(rawMsg, key) - case "maxSubInterfaces": - err = unpopulate(val, "MaxSubInterfaces", &d.MaxSubInterfaces) - delete(rawMsg, key) - case "maxTunnelInterfaces": - err = unpopulate(val, "MaxTunnelInterfaces", &d.MaxTunnelInterfaces) - delete(rawMsg, key) - case "maxVirtualRouterFunctions": - err = unpopulate(val, "MaxVirtualRouterFunctions", &d.MaxVirtualRouterFunctions) + case "configurationState": + err = unpopulate(val, "ConfigurationState", &c.ConfigurationState) delete(rawMsg, key) - case "physicalInterfaceCount": - err = unpopulate(val, "PhysicalInterfaceCount", &d.PhysicalInterfaceCount) + case "error": + err = unpopulate(val, "Error", &c.Error) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EnableDisableOnResources. -func (e EnableDisableOnResources) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectedSubnet. +func (c ConnectedSubnet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "resourceIds", e.ResourceIDs) + populate(objectMap, "annotation", c.Annotation) + populate(objectMap, "prefix", c.Prefix) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EnableDisableOnResources. -func (e *EnableDisableOnResources) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedSubnet. +func (c *ConnectedSubnet) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "resourceIds": - err = unpopulate(val, "ResourceIDs", &e.ResourceIDs) + case "annotation": + err = unpopulate(val, "Annotation", &c.Annotation) + delete(rawMsg, key) + case "prefix": + err = unpopulate(val, "Prefix", &c.Prefix) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteConnectionInformation. -func (e ExpressRouteConnectionInformation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectedSubnetRoutePolicy. +func (c ConnectedSubnetRoutePolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "expressRouteAuthorizationKey", e.ExpressRouteAuthorizationKey) - populate(objectMap, "expressRouteCircuitId", e.ExpressRouteCircuitID) + populate(objectMap, "exportRoutePolicy", c.ExportRoutePolicy) + populate(objectMap, "exportRoutePolicyId", c.ExportRoutePolicyID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteConnectionInformation. -func (e *ExpressRouteConnectionInformation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedSubnetRoutePolicy. +func (c *ConnectedSubnetRoutePolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "expressRouteAuthorizationKey": - err = unpopulate(val, "ExpressRouteAuthorizationKey", &e.ExpressRouteAuthorizationKey) + case "exportRoutePolicy": + err = unpopulate(val, "ExportRoutePolicy", &c.ExportRoutePolicy) delete(rawMsg, key) - case "expressRouteCircuitId": - err = unpopulate(val, "ExpressRouteCircuitID", &e.ExpressRouteCircuitID) + case "exportRoutePolicyId": + err = unpopulate(val, "ExportRoutePolicyID", &c.ExportRoutePolicyID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExternalNetwork. -func (e ExternalNetwork) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ControllerServices. +func (c ControllerServices) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "systemData", e.SystemData) - populate(objectMap, "type", e.Type) + populate(objectMap, "ipv4AddressSpaces", c.IPv4AddressSpaces) + populate(objectMap, "ipv6AddressSpaces", c.IPv6AddressSpaces) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalNetwork. -func (e *ExternalNetwork) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ControllerServices. +func (c *ControllerServices) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &e.SystemData) + case "ipv4AddressSpaces": + err = unpopulate(val, "IPv4AddressSpaces", &c.IPv4AddressSpaces) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) + case "ipv6AddressSpaces": + err = unpopulate(val, "IPv6AddressSpaces", &c.IPv6AddressSpaces) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExternalNetworkPatch. -func (e ExternalNetworkPatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeviceInterfaceProperties. +func (d DeviceInterfaceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", e.Properties) + populate(objectMap, "identifier", d.Identifier) + populate(objectMap, "interfaceType", d.InterfaceType) + populate(objectMap, "supportedConnectorTypes", d.SupportedConnectorTypes) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalNetworkPatch. -func (e *ExternalNetworkPatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceInterfaceProperties. +func (d *DeviceInterfaceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &e.Properties) + case "identifier": + err = unpopulate(val, "Identifier", &d.Identifier) + delete(rawMsg, key) + case "interfaceType": + err = unpopulate(val, "InterfaceType", &d.InterfaceType) + delete(rawMsg, key) + case "supportedConnectorTypes": + err = unpopulate(val, "SupportedConnectorTypes", &d.SupportedConnectorTypes) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExternalNetworkPatchProperties. -func (e ExternalNetworkPatchProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "annotation", e.Annotation) - populate(objectMap, "exportRoutePolicyId", e.ExportRoutePolicyID) - populate(objectMap, "importRoutePolicyId", e.ImportRoutePolicyID) - populate(objectMap, "optionAProperties", e.OptionAProperties) - populate(objectMap, "optionBProperties", e.OptionBProperties) - populate(objectMap, "peeringOption", e.PeeringOption) + populateAny(objectMap, "info", e.Info) + populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalNetworkPatchProperties. -func (e *ExternalNetworkPatchProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -793,23 +887,11 @@ func (e *ExternalNetworkPatchProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "annotation": - err = unpopulate(val, "Annotation", &e.Annotation) + case "info": + err = unpopulate(val, "Info", &e.Info) delete(rawMsg, key) - case "exportRoutePolicyId": - err = unpopulate(val, "ExportRoutePolicyID", &e.ExportRoutePolicyID) - delete(rawMsg, key) - case "importRoutePolicyId": - err = unpopulate(val, "ImportRoutePolicyID", &e.ImportRoutePolicyID) - delete(rawMsg, key) - case "optionAProperties": - err = unpopulate(val, "OptionAProperties", &e.OptionAProperties) - delete(rawMsg, key) - case "optionBProperties": - err = unpopulate(val, "OptionBProperties", &e.OptionBProperties) - delete(rawMsg, key) - case "peeringOption": - err = unpopulate(val, "PeeringOption", &e.PeeringOption) + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { @@ -819,24 +901,19 @@ func (e *ExternalNetworkPatchProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ExternalNetworkProperties. -func (e ExternalNetworkProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "administrativeState", e.AdministrativeState) - populate(objectMap, "annotation", e.Annotation) - populate(objectMap, "disabledOnResources", e.DisabledOnResources) - populate(objectMap, "exportRoutePolicyId", e.ExportRoutePolicyID) - populate(objectMap, "importRoutePolicyId", e.ImportRoutePolicyID) - populate(objectMap, "networkToNetworkInterconnectId", e.NetworkToNetworkInterconnectID) - populate(objectMap, "optionAProperties", e.OptionAProperties) - populate(objectMap, "optionBProperties", e.OptionBProperties) - populate(objectMap, "peeringOption", e.PeeringOption) - populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalNetworkProperties. -func (e *ExternalNetworkProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -844,35 +921,20 @@ func (e *ExternalNetworkProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "administrativeState": - err = unpopulate(val, "AdministrativeState", &e.AdministrativeState) - delete(rawMsg, key) - case "annotation": - err = unpopulate(val, "Annotation", &e.Annotation) - delete(rawMsg, key) - case "disabledOnResources": - err = unpopulate(val, "DisabledOnResources", &e.DisabledOnResources) - delete(rawMsg, key) - case "exportRoutePolicyId": - err = unpopulate(val, "ExportRoutePolicyID", &e.ExportRoutePolicyID) - delete(rawMsg, key) - case "importRoutePolicyId": - err = unpopulate(val, "ImportRoutePolicyID", &e.ImportRoutePolicyID) - delete(rawMsg, key) - case "networkToNetworkInterconnectId": - err = unpopulate(val, "NetworkToNetworkInterconnectID", &e.NetworkToNetworkInterconnectID) + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) delete(rawMsg, key) - case "optionAProperties": - err = unpopulate(val, "OptionAProperties", &e.OptionAProperties) + case "code": + err = unpopulate(val, "Code", &e.Code) delete(rawMsg, key) - case "optionBProperties": - err = unpopulate(val, "OptionBProperties", &e.OptionBProperties) + case "details": + err = unpopulate(val, "Details", &e.Details) delete(rawMsg, key) - case "peeringOption": - err = unpopulate(val, "PeeringOption", &e.PeeringOption) + case "message": + err = unpopulate(val, "Message", &e.Message) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + case "target": + err = unpopulate(val, "Target", &e.Target) delete(rawMsg, key) } if err != nil { @@ -882,23 +944,16 @@ func (e *ExternalNetworkProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ExternalNetworkPropertiesOptionAProperties. -func (e ExternalNetworkPropertiesOptionAProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExportRoutePolicy. +func (e ExportRoutePolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "bfdConfiguration", e.BfdConfiguration) - populate(objectMap, "fabricASN", e.FabricASN) - populate(objectMap, "mtu", e.Mtu) - populate(objectMap, "peerASN", e.PeerASN) - populate(objectMap, "primaryIpv4Prefix", e.PrimaryIPv4Prefix) - populate(objectMap, "primaryIpv6Prefix", e.PrimaryIPv6Prefix) - populate(objectMap, "secondaryIpv4Prefix", e.SecondaryIPv4Prefix) - populate(objectMap, "secondaryIpv6Prefix", e.SecondaryIPv6Prefix) - populate(objectMap, "vlanId", e.VlanID) + populate(objectMap, "exportIpv4RoutePolicyId", e.ExportIPv4RoutePolicyID) + populate(objectMap, "exportIpv6RoutePolicyId", e.ExportIPv6RoutePolicyID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalNetworkPropertiesOptionAProperties. -func (e *ExternalNetworkPropertiesOptionAProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExportRoutePolicy. +func (e *ExportRoutePolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -906,32 +961,11 @@ func (e *ExternalNetworkPropertiesOptionAProperties) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "bfdConfiguration": - err = unpopulate(val, "BfdConfiguration", &e.BfdConfiguration) - delete(rawMsg, key) - case "fabricASN": - err = unpopulate(val, "FabricASN", &e.FabricASN) - delete(rawMsg, key) - case "mtu": - err = unpopulate(val, "Mtu", &e.Mtu) - delete(rawMsg, key) - case "peerASN": - err = unpopulate(val, "PeerASN", &e.PeerASN) - delete(rawMsg, key) - case "primaryIpv4Prefix": - err = unpopulate(val, "PrimaryIPv4Prefix", &e.PrimaryIPv4Prefix) - delete(rawMsg, key) - case "primaryIpv6Prefix": - err = unpopulate(val, "PrimaryIPv6Prefix", &e.PrimaryIPv6Prefix) - delete(rawMsg, key) - case "secondaryIpv4Prefix": - err = unpopulate(val, "SecondaryIPv4Prefix", &e.SecondaryIPv4Prefix) - delete(rawMsg, key) - case "secondaryIpv6Prefix": - err = unpopulate(val, "SecondaryIPv6Prefix", &e.SecondaryIPv6Prefix) + case "exportIpv4RoutePolicyId": + err = unpopulate(val, "ExportIPv4RoutePolicyID", &e.ExportIPv4RoutePolicyID) delete(rawMsg, key) - case "vlanId": - err = unpopulate(val, "VlanID", &e.VlanID) + case "exportIpv6RoutePolicyId": + err = unpopulate(val, "ExportIPv6RoutePolicyID", &e.ExportIPv6RoutePolicyID) delete(rawMsg, key) } if err != nil { @@ -941,16 +975,16 @@ func (e *ExternalNetworkPropertiesOptionAProperties) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type ExternalNetworksList. -func (e ExternalNetworksList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExportRoutePolicyInformation. +func (e ExportRoutePolicyInformation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) + populate(objectMap, "exportIpv4RoutePolicyId", e.ExportIPv4RoutePolicyID) + populate(objectMap, "exportIpv6RoutePolicyId", e.ExportIPv6RoutePolicyID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalNetworksList. -func (e *ExternalNetworksList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExportRoutePolicyInformation. +func (e *ExportRoutePolicyInformation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -958,11 +992,11 @@ func (e *ExternalNetworksList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) + case "exportIpv4RoutePolicyId": + err = unpopulate(val, "ExportIPv4RoutePolicyID", &e.ExportIPv4RoutePolicyID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) + case "exportIpv6RoutePolicyId": + err = unpopulate(val, "ExportIPv6RoutePolicyID", &e.ExportIPv6RoutePolicyID) delete(rawMsg, key) } if err != nil { @@ -972,223 +1006,447 @@ func (e *ExternalNetworksList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type FabricBfdConfiguration. -func (f FabricBfdConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExpressRouteConnectionInformation. +func (e ExpressRouteConnectionInformation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "interval", f.Interval) - populate(objectMap, "multiplier", f.Multiplier) + populate(objectMap, "expressRouteAuthorizationKey", e.ExpressRouteAuthorizationKey) + populate(objectMap, "expressRouteCircuitId", e.ExpressRouteCircuitID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FabricBfdConfiguration. -func (f *FabricBfdConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteConnectionInformation. +func (e *ExpressRouteConnectionInformation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "interval": - err = unpopulate(val, "Interval", &f.Interval) + case "expressRouteAuthorizationKey": + err = unpopulate(val, "ExpressRouteAuthorizationKey", &e.ExpressRouteAuthorizationKey) delete(rawMsg, key) - case "multiplier": - err = unpopulate(val, "Multiplier", &f.Multiplier) + case "expressRouteCircuitId": + err = unpopulate(val, "ExpressRouteCircuitID", &e.ExpressRouteCircuitID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetDeviceStatusProperties. -func (g GetDeviceStatusProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExternalNetwork. +func (e ExternalNetwork) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "operationalStatus", g.OperationalStatus) - populate(objectMap, "powerCycleState", g.PowerCycleState) - populate(objectMap, "serialNumber", g.SerialNumber) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetDeviceStatusProperties. -func (g *GetDeviceStatusProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalNetwork. +func (e *ExternalNetwork) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "operationalStatus": - err = unpopulate(val, "OperationalStatus", &g.OperationalStatus) + case "id": + err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) - case "powerCycleState": - err = unpopulate(val, "PowerCycleState", &g.PowerCycleState) + case "name": + err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) - case "serialNumber": - err = unpopulate(val, "SerialNumber", &g.SerialNumber) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetDynamicInterfaceMapsPropertiesItem. -func (g GetDynamicInterfaceMapsPropertiesItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExternalNetworkPatch. +func (e ExternalNetworkPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "administrativeState", g.AdministrativeState) - populate(objectMap, "connectedTo", g.ConnectedTo) - populate(objectMap, "name", g.Name) - populate(objectMap, "operationalStatus", g.OperationalStatus) - populate(objectMap, "phyStatus", g.PhyStatus) - populate(objectMap, "transceiverStatus", g.TransceiverStatus) + populate(objectMap, "properties", e.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetDynamicInterfaceMapsPropertiesItem. -func (g *GetDynamicInterfaceMapsPropertiesItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalNetworkPatch. +func (e *ExternalNetworkPatch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "administrativeState": - err = unpopulate(val, "AdministrativeState", &g.AdministrativeState) - delete(rawMsg, key) - case "connectedTo": - err = unpopulate(val, "ConnectedTo", &g.ConnectedTo) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "operationalStatus": - err = unpopulate(val, "OperationalStatus", &g.OperationalStatus) - delete(rawMsg, key) - case "phyStatus": - err = unpopulate(val, "PhyStatus", &g.PhyStatus) - delete(rawMsg, key) - case "transceiverStatus": - err = unpopulate(val, "TransceiverStatus", &g.TransceiverStatus) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GetStaticInterfaceMapsPropertiesItem. -func (g GetStaticInterfaceMapsPropertiesItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExternalNetworkPatchProperties. +func (e ExternalNetworkPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "channelGroupId", g.ChannelGroupID) - populate(objectMap, "connectedTo", g.ConnectedTo) - populate(objectMap, "connectorType", g.ConnectorType) - populate(objectMap, "description", g.Description) - populate(objectMap, "identifier", g.Identifier) - populate(objectMap, "interfaceType", g.InterfaceType) - populate(objectMap, "name", g.Name) - populate(objectMap, "speed", g.Speed) + populate(objectMap, "annotation", e.Annotation) + populate(objectMap, "exportRoutePolicy", e.ExportRoutePolicy) + populate(objectMap, "exportRoutePolicyId", e.ExportRoutePolicyID) + populate(objectMap, "importRoutePolicy", e.ImportRoutePolicy) + populate(objectMap, "importRoutePolicyId", e.ImportRoutePolicyID) + populate(objectMap, "optionAProperties", e.OptionAProperties) + populate(objectMap, "optionBProperties", e.OptionBProperties) + populate(objectMap, "peeringOption", e.PeeringOption) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetStaticInterfaceMapsPropertiesItem. -func (g *GetStaticInterfaceMapsPropertiesItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalNetworkPatchProperties. +func (e *ExternalNetworkPatchProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "channelGroupId": - err = unpopulate(val, "ChannelGroupID", &g.ChannelGroupID) + case "annotation": + err = unpopulate(val, "Annotation", &e.Annotation) delete(rawMsg, key) - case "connectedTo": - err = unpopulate(val, "ConnectedTo", &g.ConnectedTo) + case "exportRoutePolicy": + err = unpopulate(val, "ExportRoutePolicy", &e.ExportRoutePolicy) delete(rawMsg, key) - case "connectorType": - err = unpopulate(val, "ConnectorType", &g.ConnectorType) + case "exportRoutePolicyId": + err = unpopulate(val, "ExportRoutePolicyID", &e.ExportRoutePolicyID) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &g.Description) + case "importRoutePolicy": + err = unpopulate(val, "ImportRoutePolicy", &e.ImportRoutePolicy) delete(rawMsg, key) - case "identifier": - err = unpopulate(val, "Identifier", &g.Identifier) + case "importRoutePolicyId": + err = unpopulate(val, "ImportRoutePolicyID", &e.ImportRoutePolicyID) delete(rawMsg, key) - case "interfaceType": - err = unpopulate(val, "InterfaceType", &g.InterfaceType) + case "optionAProperties": + err = unpopulate(val, "OptionAProperties", &e.OptionAProperties) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) + case "optionBProperties": + err = unpopulate(val, "OptionBProperties", &e.OptionBProperties) delete(rawMsg, key) - case "speed": - err = unpopulate(val, "Speed", &g.Speed) + case "peeringOption": + err = unpopulate(val, "PeeringOption", &e.PeeringOption) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IPCommunitiesListResult. -func (i IPCommunitiesListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExternalNetworkPatchPropertiesOptionAProperties. +func (e ExternalNetworkPatchPropertiesOptionAProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) + populate(objectMap, "bfdConfiguration", e.BfdConfiguration) + populate(objectMap, "egressAclId", e.EgressACLID) + populate(objectMap, "fabricASN", e.FabricASN) + populate(objectMap, "ingressAclId", e.IngressACLID) + populate(objectMap, "mtu", e.Mtu) + populate(objectMap, "peerASN", e.PeerASN) + populate(objectMap, "primaryIpv4Prefix", e.PrimaryIPv4Prefix) + populate(objectMap, "primaryIpv6Prefix", e.PrimaryIPv6Prefix) + populate(objectMap, "secondaryIpv4Prefix", e.SecondaryIPv4Prefix) + populate(objectMap, "secondaryIpv6Prefix", e.SecondaryIPv6Prefix) + populate(objectMap, "vlanId", e.VlanID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IPCommunitiesListResult. -func (i *IPCommunitiesListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalNetworkPatchPropertiesOptionAProperties. +func (e *ExternalNetworkPatchPropertiesOptionAProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &i.NextLink) + case "bfdConfiguration": + err = unpopulate(val, "BfdConfiguration", &e.BfdConfiguration) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &i.Value) + case "egressAclId": + err = unpopulate(val, "EgressACLID", &e.EgressACLID) + delete(rawMsg, key) + case "fabricASN": + err = unpopulate(val, "FabricASN", &e.FabricASN) + delete(rawMsg, key) + case "ingressAclId": + err = unpopulate(val, "IngressACLID", &e.IngressACLID) + delete(rawMsg, key) + case "mtu": + err = unpopulate(val, "Mtu", &e.Mtu) + delete(rawMsg, key) + case "peerASN": + err = unpopulate(val, "PeerASN", &e.PeerASN) + delete(rawMsg, key) + case "primaryIpv4Prefix": + err = unpopulate(val, "PrimaryIPv4Prefix", &e.PrimaryIPv4Prefix) + delete(rawMsg, key) + case "primaryIpv6Prefix": + err = unpopulate(val, "PrimaryIPv6Prefix", &e.PrimaryIPv6Prefix) + delete(rawMsg, key) + case "secondaryIpv4Prefix": + err = unpopulate(val, "SecondaryIPv4Prefix", &e.SecondaryIPv4Prefix) + delete(rawMsg, key) + case "secondaryIpv6Prefix": + err = unpopulate(val, "SecondaryIPv6Prefix", &e.SecondaryIPv6Prefix) + delete(rawMsg, key) + case "vlanId": + err = unpopulate(val, "VlanID", &e.VlanID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IPCommunity. -func (i IPCommunity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExternalNetworkProperties. +func (e ExternalNetworkProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", i.ID) - populate(objectMap, "location", i.Location) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "systemData", i.SystemData) - populate(objectMap, "tags", i.Tags) - populate(objectMap, "type", i.Type) + populate(objectMap, "administrativeState", e.AdministrativeState) + populate(objectMap, "annotation", e.Annotation) + populate(objectMap, "configurationState", e.ConfigurationState) + populate(objectMap, "exportRoutePolicy", e.ExportRoutePolicy) + populate(objectMap, "exportRoutePolicyId", e.ExportRoutePolicyID) + populate(objectMap, "importRoutePolicy", e.ImportRoutePolicy) + populate(objectMap, "importRoutePolicyId", e.ImportRoutePolicyID) + populate(objectMap, "networkToNetworkInterconnectId", e.NetworkToNetworkInterconnectID) + populate(objectMap, "optionAProperties", e.OptionAProperties) + populate(objectMap, "optionBProperties", e.OptionBProperties) + populate(objectMap, "peeringOption", e.PeeringOption) + populate(objectMap, "provisioningState", e.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IPCommunity. -func (i *IPCommunity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalNetworkProperties. +func (e *ExternalNetworkProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "administrativeState": + err = unpopulate(val, "AdministrativeState", &e.AdministrativeState) + delete(rawMsg, key) + case "annotation": + err = unpopulate(val, "Annotation", &e.Annotation) + delete(rawMsg, key) + case "configurationState": + err = unpopulate(val, "ConfigurationState", &e.ConfigurationState) + delete(rawMsg, key) + case "exportRoutePolicy": + err = unpopulate(val, "ExportRoutePolicy", &e.ExportRoutePolicy) + delete(rawMsg, key) + case "exportRoutePolicyId": + err = unpopulate(val, "ExportRoutePolicyID", &e.ExportRoutePolicyID) + delete(rawMsg, key) + case "importRoutePolicy": + err = unpopulate(val, "ImportRoutePolicy", &e.ImportRoutePolicy) + delete(rawMsg, key) + case "importRoutePolicyId": + err = unpopulate(val, "ImportRoutePolicyID", &e.ImportRoutePolicyID) + delete(rawMsg, key) + case "networkToNetworkInterconnectId": + err = unpopulate(val, "NetworkToNetworkInterconnectID", &e.NetworkToNetworkInterconnectID) + delete(rawMsg, key) + case "optionAProperties": + err = unpopulate(val, "OptionAProperties", &e.OptionAProperties) + delete(rawMsg, key) + case "optionBProperties": + err = unpopulate(val, "OptionBProperties", &e.OptionBProperties) + delete(rawMsg, key) + case "peeringOption": + err = unpopulate(val, "PeeringOption", &e.PeeringOption) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExternalNetworkPropertiesOptionAProperties. +func (e ExternalNetworkPropertiesOptionAProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bfdConfiguration", e.BfdConfiguration) + populate(objectMap, "egressAclId", e.EgressACLID) + populate(objectMap, "fabricASN", e.FabricASN) + populate(objectMap, "ingressAclId", e.IngressACLID) + populate(objectMap, "mtu", e.Mtu) + populate(objectMap, "peerASN", e.PeerASN) + populate(objectMap, "primaryIpv4Prefix", e.PrimaryIPv4Prefix) + populate(objectMap, "primaryIpv6Prefix", e.PrimaryIPv6Prefix) + populate(objectMap, "secondaryIpv4Prefix", e.SecondaryIPv4Prefix) + populate(objectMap, "secondaryIpv6Prefix", e.SecondaryIPv6Prefix) + populate(objectMap, "vlanId", e.VlanID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalNetworkPropertiesOptionAProperties. +func (e *ExternalNetworkPropertiesOptionAProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bfdConfiguration": + err = unpopulate(val, "BfdConfiguration", &e.BfdConfiguration) + delete(rawMsg, key) + case "egressAclId": + err = unpopulate(val, "EgressACLID", &e.EgressACLID) + delete(rawMsg, key) + case "fabricASN": + err = unpopulate(val, "FabricASN", &e.FabricASN) + delete(rawMsg, key) + case "ingressAclId": + err = unpopulate(val, "IngressACLID", &e.IngressACLID) + delete(rawMsg, key) + case "mtu": + err = unpopulate(val, "Mtu", &e.Mtu) + delete(rawMsg, key) + case "peerASN": + err = unpopulate(val, "PeerASN", &e.PeerASN) + delete(rawMsg, key) + case "primaryIpv4Prefix": + err = unpopulate(val, "PrimaryIPv4Prefix", &e.PrimaryIPv4Prefix) + delete(rawMsg, key) + case "primaryIpv6Prefix": + err = unpopulate(val, "PrimaryIPv6Prefix", &e.PrimaryIPv6Prefix) + delete(rawMsg, key) + case "secondaryIpv4Prefix": + err = unpopulate(val, "SecondaryIPv4Prefix", &e.SecondaryIPv4Prefix) + delete(rawMsg, key) + case "secondaryIpv6Prefix": + err = unpopulate(val, "SecondaryIPv6Prefix", &e.SecondaryIPv6Prefix) + delete(rawMsg, key) + case "vlanId": + err = unpopulate(val, "VlanID", &e.VlanID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExternalNetworksList. +func (e ExternalNetworksList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalNetworksList. +func (e *ExternalNetworksList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPCommunitiesListResult. +func (i IPCommunitiesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPCommunitiesListResult. +func (i *IPCommunitiesListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPCommunity. +func (i IPCommunity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "systemData", i.SystemData) + populate(objectMap, "tags", i.Tags) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPCommunity. +func (i *IPCommunity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error @@ -1252,6 +1510,7 @@ func (i *IPCommunityIDList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IPCommunityPatch. func (i IPCommunityPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "properties", i.Properties) populate(objectMap, "tags", i.Tags) return json.Marshal(objectMap) } @@ -1265,6 +1524,9 @@ func (i *IPCommunityPatch) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &i.Tags) delete(rawMsg, key) @@ -1276,14 +1538,41 @@ func (i *IPCommunityPatch) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type IPCommunityPatchableProperties. +func (i IPCommunityPatchableProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipCommunityRules", i.IPCommunityRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPCommunityPatchableProperties. +func (i *IPCommunityPatchableProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ipCommunityRules": + err = unpopulate(val, "IPCommunityRules", &i.IPCommunityRules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type IPCommunityProperties. func (i IPCommunityProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "action", i.Action) + populate(objectMap, "administrativeState", i.AdministrativeState) populate(objectMap, "annotation", i.Annotation) - populate(objectMap, "communityMembers", i.CommunityMembers) + populate(objectMap, "configurationState", i.ConfigurationState) + populate(objectMap, "ipCommunityRules", i.IPCommunityRules) populate(objectMap, "provisioningState", i.ProvisioningState) - populate(objectMap, "wellKnownCommunities", i.WellKnownCommunities) return json.Marshal(objectMap) } @@ -1296,18 +1585,57 @@ func (i *IPCommunityProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "action": - err = unpopulate(val, "Action", &i.Action) + case "administrativeState": + err = unpopulate(val, "AdministrativeState", &i.AdministrativeState) delete(rawMsg, key) case "annotation": err = unpopulate(val, "Annotation", &i.Annotation) delete(rawMsg, key) - case "communityMembers": - err = unpopulate(val, "CommunityMembers", &i.CommunityMembers) + case "configurationState": + err = unpopulate(val, "ConfigurationState", &i.ConfigurationState) + delete(rawMsg, key) + case "ipCommunityRules": + err = unpopulate(val, "IPCommunityRules", &i.IPCommunityRules) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPCommunityRule. +func (i IPCommunityRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", i.Action) + populate(objectMap, "communityMembers", i.CommunityMembers) + populate(objectMap, "sequenceNumber", i.SequenceNumber) + populate(objectMap, "wellKnownCommunities", i.WellKnownCommunities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPCommunityRule. +func (i *IPCommunityRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &i.Action) + delete(rawMsg, key) + case "communityMembers": + err = unpopulate(val, "CommunityMembers", &i.CommunityMembers) + delete(rawMsg, key) + case "sequenceNumber": + err = unpopulate(val, "SequenceNumber", &i.SequenceNumber) + delete(rawMsg, key) case "wellKnownCommunities": err = unpopulate(val, "WellKnownCommunities", &i.WellKnownCommunities) delete(rawMsg, key) @@ -1431,6 +1759,7 @@ func (i *IPExtendedCommunityListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IPExtendedCommunityPatch. func (i IPExtendedCommunityPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "properties", i.Properties) populate(objectMap, "tags", i.Tags) return json.Marshal(objectMap) } @@ -1444,6 +1773,9 @@ func (i *IPExtendedCommunityPatch) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &i.Tags) delete(rawMsg, key) @@ -1455,13 +1787,45 @@ func (i *IPExtendedCommunityPatch) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type IPExtendedCommunityProperties. -func (i IPExtendedCommunityProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IPExtendedCommunityPatchProperties. +func (i IPExtendedCommunityPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "action", i.Action) populate(objectMap, "annotation", i.Annotation) + populate(objectMap, "ipExtendedCommunityRules", i.IPExtendedCommunityRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPExtendedCommunityPatchProperties. +func (i *IPExtendedCommunityPatchProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "annotation": + err = unpopulate(val, "Annotation", &i.Annotation) + delete(rawMsg, key) + case "ipExtendedCommunityRules": + err = unpopulate(val, "IPExtendedCommunityRules", &i.IPExtendedCommunityRules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPExtendedCommunityProperties. +func (i IPExtendedCommunityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "administrativeState", i.AdministrativeState) + populate(objectMap, "annotation", i.Annotation) + populate(objectMap, "configurationState", i.ConfigurationState) + populate(objectMap, "ipExtendedCommunityRules", i.IPExtendedCommunityRules) populate(objectMap, "provisioningState", i.ProvisioningState) - populate(objectMap, "routeTargets", i.RouteTargets) return json.Marshal(objectMap) } @@ -1474,18 +1838,130 @@ func (i *IPExtendedCommunityProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "action": - err = unpopulate(val, "Action", &i.Action) + case "administrativeState": + err = unpopulate(val, "AdministrativeState", &i.AdministrativeState) delete(rawMsg, key) case "annotation": err = unpopulate(val, "Annotation", &i.Annotation) delete(rawMsg, key) + case "configurationState": + err = unpopulate(val, "ConfigurationState", &i.ConfigurationState) + delete(rawMsg, key) + case "ipExtendedCommunityRules": + err = unpopulate(val, "IPExtendedCommunityRules", &i.IPExtendedCommunityRules) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPExtendedCommunityRule. +func (i IPExtendedCommunityRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", i.Action) + populate(objectMap, "routeTargets", i.RouteTargets) + populate(objectMap, "sequenceNumber", i.SequenceNumber) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPExtendedCommunityRule. +func (i *IPExtendedCommunityRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &i.Action) + delete(rawMsg, key) case "routeTargets": err = unpopulate(val, "RouteTargets", &i.RouteTargets) delete(rawMsg, key) + case "sequenceNumber": + err = unpopulate(val, "SequenceNumber", &i.SequenceNumber) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPGroupProperties. +func (i IPGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipAddressType", i.IPAddressType) + populate(objectMap, "ipPrefixes", i.IPPrefixes) + populate(objectMap, "name", i.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPGroupProperties. +func (i *IPGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ipAddressType": + err = unpopulate(val, "IPAddressType", &i.IPAddressType) + delete(rawMsg, key) + case "ipPrefixes": + err = unpopulate(val, "IPPrefixes", &i.IPPrefixes) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPMatchCondition. +func (i IPMatchCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipGroupNames", i.IPGroupNames) + populate(objectMap, "ipPrefixValues", i.IPPrefixValues) + populate(objectMap, "prefixType", i.PrefixType) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPMatchCondition. +func (i *IPMatchCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ipGroupNames": + err = unpopulate(val, "IPGroupNames", &i.IPGroupNames) + delete(rawMsg, key) + case "ipPrefixValues": + err = unpopulate(val, "IPPrefixValues", &i.IPPrefixValues) + delete(rawMsg, key) + case "prefixType": + err = unpopulate(val, "PrefixType", &i.PrefixType) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) @@ -1548,6 +2024,7 @@ func (i *IPPrefix) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IPPrefixPatch. func (i IPPrefixPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "properties", i.Properties) populate(objectMap, "tags", i.Tags) return json.Marshal(objectMap) } @@ -1561,6 +2038,9 @@ func (i *IPPrefixPatch) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &i.Tags) delete(rawMsg, key) @@ -1572,10 +2052,43 @@ func (i *IPPrefixPatch) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type IPPrefixPatchProperties. +func (i IPPrefixPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "annotation", i.Annotation) + populate(objectMap, "ipPrefixRules", i.IPPrefixRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPPrefixPatchProperties. +func (i *IPPrefixPatchProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "annotation": + err = unpopulate(val, "Annotation", &i.Annotation) + delete(rawMsg, key) + case "ipPrefixRules": + err = unpopulate(val, "IPPrefixRules", &i.IPPrefixRules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type IPPrefixProperties. func (i IPPrefixProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "administrativeState", i.AdministrativeState) populate(objectMap, "annotation", i.Annotation) + populate(objectMap, "configurationState", i.ConfigurationState) populate(objectMap, "ipPrefixRules", i.IPPrefixRules) populate(objectMap, "provisioningState", i.ProvisioningState) return json.Marshal(objectMap) @@ -1590,9 +2103,15 @@ func (i *IPPrefixProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "administrativeState": + err = unpopulate(val, "AdministrativeState", &i.AdministrativeState) + delete(rawMsg, key) case "annotation": err = unpopulate(val, "Annotation", &i.Annotation) delete(rawMsg, key) + case "configurationState": + err = unpopulate(val, "ConfigurationState", &i.ConfigurationState) + delete(rawMsg, key) case "ipPrefixRules": err = unpopulate(val, "IPPrefixRules", &i.IPPrefixRules) delete(rawMsg, key) @@ -1607,8 +2126,8 @@ func (i *IPPrefixProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type IPPrefixPropertiesIPPrefixRulesItem. -func (i IPPrefixPropertiesIPPrefixRulesItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IPPrefixRule. +func (i IPPrefixRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "action", i.Action) populate(objectMap, "condition", i.Condition) @@ -1618,8 +2137,8 @@ func (i IPPrefixPropertiesIPPrefixRulesItem) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IPPrefixPropertiesIPPrefixRulesItem. -func (i *IPPrefixPropertiesIPPrefixRulesItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IPPrefixRule. +func (i *IPPrefixRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) @@ -1681,16 +2200,16 @@ func (i *IPPrefixesListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type InfrastructureServices. -func (i InfrastructureServices) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ImportRoutePolicy. +func (i ImportRoutePolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "ipv4AddressSpaces", i.IPv4AddressSpaces) - populate(objectMap, "ipv6AddressSpaces", i.IPv6AddressSpaces) + populate(objectMap, "importIpv4RoutePolicyId", i.ImportIPv4RoutePolicyID) + populate(objectMap, "importIpv6RoutePolicyId", i.ImportIPv6RoutePolicyID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type InfrastructureServices. -func (i *InfrastructureServices) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportRoutePolicy. +func (i *ImportRoutePolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) @@ -1698,11 +2217,11 @@ func (i *InfrastructureServices) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "ipv4AddressSpaces": - err = unpopulate(val, "IPv4AddressSpaces", &i.IPv4AddressSpaces) + case "importIpv4RoutePolicyId": + err = unpopulate(val, "ImportIPv4RoutePolicyID", &i.ImportIPv4RoutePolicyID) delete(rawMsg, key) - case "ipv6AddressSpaces": - err = unpopulate(val, "IPv6AddressSpaces", &i.IPv6AddressSpaces) + case "importIpv6RoutePolicyId": + err = unpopulate(val, "ImportIPv6RoutePolicyID", &i.ImportIPv6RoutePolicyID) delete(rawMsg, key) } if err != nil { @@ -1712,19 +2231,16 @@ func (i *InfrastructureServices) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type InterfaceStatus. -func (i InterfaceStatus) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ImportRoutePolicyInformation. +func (i ImportRoutePolicyInformation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "administrativeState", i.AdministrativeState) - populate(objectMap, "connectedTo", i.ConnectedTo) - populate(objectMap, "operationalStatus", i.OperationalStatus) - populate(objectMap, "phyStatus", i.PhyStatus) - populate(objectMap, "transceiverStatus", i.TransceiverStatus) + populate(objectMap, "importIpv4RoutePolicyId", i.ImportIPv4RoutePolicyID) + populate(objectMap, "importIpv6RoutePolicyId", i.ImportIPv6RoutePolicyID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type InterfaceStatus. -func (i *InterfaceStatus) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportRoutePolicyInformation. +func (i *ImportRoutePolicyInformation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) @@ -1732,20 +2248,11 @@ func (i *InterfaceStatus) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "administrativeState": - err = unpopulate(val, "AdministrativeState", &i.AdministrativeState) - delete(rawMsg, key) - case "connectedTo": - err = unpopulate(val, "ConnectedTo", &i.ConnectedTo) - delete(rawMsg, key) - case "operationalStatus": - err = unpopulate(val, "OperationalStatus", &i.OperationalStatus) + case "importIpv4RoutePolicyId": + err = unpopulate(val, "ImportIPv4RoutePolicyID", &i.ImportIPv4RoutePolicyID) delete(rawMsg, key) - case "phyStatus": - err = unpopulate(val, "PhyStatus", &i.PhyStatus) - delete(rawMsg, key) - case "transceiverStatus": - err = unpopulate(val, "TransceiverStatus", &i.TransceiverStatus) + case "importIpv6RoutePolicyId": + err = unpopulate(val, "ImportIPv6RoutePolicyID", &i.ImportIPv6RoutePolicyID) delete(rawMsg, key) } if err != nil { @@ -1832,8 +2339,13 @@ func (i InternalNetworkPatchProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "bgpConfiguration", i.BgpConfiguration) populate(objectMap, "connectedIPv4Subnets", i.ConnectedIPv4Subnets) populate(objectMap, "connectedIPv6Subnets", i.ConnectedIPv6Subnets) + populate(objectMap, "egressAclId", i.EgressACLID) + populate(objectMap, "exportRoutePolicy", i.ExportRoutePolicy) populate(objectMap, "exportRoutePolicyId", i.ExportRoutePolicyID) + populate(objectMap, "importRoutePolicy", i.ImportRoutePolicy) populate(objectMap, "importRoutePolicyId", i.ImportRoutePolicyID) + populate(objectMap, "ingressAclId", i.IngressACLID) + populate(objectMap, "isMonitoringEnabled", i.IsMonitoringEnabled) populate(objectMap, "mtu", i.Mtu) populate(objectMap, "staticRouteConfiguration", i.StaticRouteConfiguration) return json.Marshal(objectMap) @@ -1860,12 +2372,27 @@ func (i *InternalNetworkPatchProperties) UnmarshalJSON(data []byte) error { case "connectedIPv6Subnets": err = unpopulate(val, "ConnectedIPv6Subnets", &i.ConnectedIPv6Subnets) delete(rawMsg, key) + case "egressAclId": + err = unpopulate(val, "EgressACLID", &i.EgressACLID) + delete(rawMsg, key) + case "exportRoutePolicy": + err = unpopulate(val, "ExportRoutePolicy", &i.ExportRoutePolicy) + delete(rawMsg, key) case "exportRoutePolicyId": err = unpopulate(val, "ExportRoutePolicyID", &i.ExportRoutePolicyID) delete(rawMsg, key) + case "importRoutePolicy": + err = unpopulate(val, "ImportRoutePolicy", &i.ImportRoutePolicy) + delete(rawMsg, key) case "importRoutePolicyId": err = unpopulate(val, "ImportRoutePolicyID", &i.ImportRoutePolicyID) delete(rawMsg, key) + case "ingressAclId": + err = unpopulate(val, "IngressACLID", &i.IngressACLID) + delete(rawMsg, key) + case "isMonitoringEnabled": + err = unpopulate(val, "IsMonitoringEnabled", &i.IsMonitoringEnabled) + delete(rawMsg, key) case "mtu": err = unpopulate(val, "Mtu", &i.Mtu) delete(rawMsg, key) @@ -1885,15 +2412,18 @@ func (i InternalNetworkProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "administrativeState", i.AdministrativeState) populate(objectMap, "annotation", i.Annotation) - populate(objectMap, "bfdDisabledOnResources", i.BfdDisabledOnResources) - populate(objectMap, "bfdForStaticRoutesDisabledOnResources", i.BfdForStaticRoutesDisabledOnResources) populate(objectMap, "bgpConfiguration", i.BgpConfiguration) - populate(objectMap, "bgpDisabledOnResources", i.BgpDisabledOnResources) + populate(objectMap, "configurationState", i.ConfigurationState) populate(objectMap, "connectedIPv4Subnets", i.ConnectedIPv4Subnets) populate(objectMap, "connectedIPv6Subnets", i.ConnectedIPv6Subnets) - populate(objectMap, "disabledOnResources", i.DisabledOnResources) + populate(objectMap, "egressAclId", i.EgressACLID) + populate(objectMap, "exportRoutePolicy", i.ExportRoutePolicy) populate(objectMap, "exportRoutePolicyId", i.ExportRoutePolicyID) + populate(objectMap, "extension", i.Extension) + populate(objectMap, "importRoutePolicy", i.ImportRoutePolicy) populate(objectMap, "importRoutePolicyId", i.ImportRoutePolicyID) + populate(objectMap, "ingressAclId", i.IngressACLID) + populate(objectMap, "isMonitoringEnabled", i.IsMonitoringEnabled) populate(objectMap, "mtu", i.Mtu) populate(objectMap, "provisioningState", i.ProvisioningState) populate(objectMap, "staticRouteConfiguration", i.StaticRouteConfiguration) @@ -1916,17 +2446,11 @@ func (i *InternalNetworkProperties) UnmarshalJSON(data []byte) error { case "annotation": err = unpopulate(val, "Annotation", &i.Annotation) delete(rawMsg, key) - case "bfdDisabledOnResources": - err = unpopulate(val, "BfdDisabledOnResources", &i.BfdDisabledOnResources) - delete(rawMsg, key) - case "bfdForStaticRoutesDisabledOnResources": - err = unpopulate(val, "BfdForStaticRoutesDisabledOnResources", &i.BfdForStaticRoutesDisabledOnResources) - delete(rawMsg, key) case "bgpConfiguration": err = unpopulate(val, "BgpConfiguration", &i.BgpConfiguration) delete(rawMsg, key) - case "bgpDisabledOnResources": - err = unpopulate(val, "BgpDisabledOnResources", &i.BgpDisabledOnResources) + case "configurationState": + err = unpopulate(val, "ConfigurationState", &i.ConfigurationState) delete(rawMsg, key) case "connectedIPv4Subnets": err = unpopulate(val, "ConnectedIPv4Subnets", &i.ConnectedIPv4Subnets) @@ -1934,15 +2458,30 @@ func (i *InternalNetworkProperties) UnmarshalJSON(data []byte) error { case "connectedIPv6Subnets": err = unpopulate(val, "ConnectedIPv6Subnets", &i.ConnectedIPv6Subnets) delete(rawMsg, key) - case "disabledOnResources": - err = unpopulate(val, "DisabledOnResources", &i.DisabledOnResources) + case "egressAclId": + err = unpopulate(val, "EgressACLID", &i.EgressACLID) + delete(rawMsg, key) + case "exportRoutePolicy": + err = unpopulate(val, "ExportRoutePolicy", &i.ExportRoutePolicy) delete(rawMsg, key) case "exportRoutePolicyId": err = unpopulate(val, "ExportRoutePolicyID", &i.ExportRoutePolicyID) delete(rawMsg, key) + case "extension": + err = unpopulate(val, "Extension", &i.Extension) + delete(rawMsg, key) + case "importRoutePolicy": + err = unpopulate(val, "ImportRoutePolicy", &i.ImportRoutePolicy) + delete(rawMsg, key) case "importRoutePolicyId": err = unpopulate(val, "ImportRoutePolicyID", &i.ImportRoutePolicyID) delete(rawMsg, key) + case "ingressAclId": + err = unpopulate(val, "IngressACLID", &i.IngressACLID) + delete(rawMsg, key) + case "isMonitoringEnabled": + err = unpopulate(val, "IsMonitoringEnabled", &i.IsMonitoringEnabled) + delete(rawMsg, key) case "mtu": err = unpopulate(val, "Mtu", &i.Mtu) delete(rawMsg, key) @@ -1963,16 +2502,25 @@ func (i *InternalNetworkProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type InternalNetworksList. -func (i InternalNetworksList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InternalNetworkPropertiesBgpConfiguration. +func (i InternalNetworkPropertiesBgpConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) + populate(objectMap, "allowAS", i.AllowAS) + populate(objectMap, "allowASOverride", i.AllowASOverride) + populate(objectMap, "annotation", i.Annotation) + populate(objectMap, "bfdConfiguration", i.BfdConfiguration) + populate(objectMap, "defaultRouteOriginate", i.DefaultRouteOriginate) + populate(objectMap, "fabricASN", i.FabricASN) + populate(objectMap, "ipv4ListenRangePrefixes", i.IPv4ListenRangePrefixes) + populate(objectMap, "ipv4NeighborAddress", i.IPv4NeighborAddress) + populate(objectMap, "ipv6ListenRangePrefixes", i.IPv6ListenRangePrefixes) + populate(objectMap, "ipv6NeighborAddress", i.IPv6NeighborAddress) + populate(objectMap, "peerASN", i.PeerASN) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type InternalNetworksList. -func (i *InternalNetworksList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type InternalNetworkPropertiesBgpConfiguration. +func (i *InternalNetworkPropertiesBgpConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) @@ -1980,11 +2528,38 @@ func (i *InternalNetworksList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &i.NextLink) + case "allowAS": + err = unpopulate(val, "AllowAS", &i.AllowAS) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &i.Value) + case "allowASOverride": + err = unpopulate(val, "AllowASOverride", &i.AllowASOverride) + delete(rawMsg, key) + case "annotation": + err = unpopulate(val, "Annotation", &i.Annotation) + delete(rawMsg, key) + case "bfdConfiguration": + err = unpopulate(val, "BfdConfiguration", &i.BfdConfiguration) + delete(rawMsg, key) + case "defaultRouteOriginate": + err = unpopulate(val, "DefaultRouteOriginate", &i.DefaultRouteOriginate) + delete(rawMsg, key) + case "fabricASN": + err = unpopulate(val, "FabricASN", &i.FabricASN) + delete(rawMsg, key) + case "ipv4ListenRangePrefixes": + err = unpopulate(val, "IPv4ListenRangePrefixes", &i.IPv4ListenRangePrefixes) + delete(rawMsg, key) + case "ipv4NeighborAddress": + err = unpopulate(val, "IPv4NeighborAddress", &i.IPv4NeighborAddress) + delete(rawMsg, key) + case "ipv6ListenRangePrefixes": + err = unpopulate(val, "IPv6ListenRangePrefixes", &i.IPv6ListenRangePrefixes) + delete(rawMsg, key) + case "ipv6NeighborAddress": + err = unpopulate(val, "IPv6NeighborAddress", &i.IPv6NeighborAddress) + delete(rawMsg, key) + case "peerASN": + err = unpopulate(val, "PeerASN", &i.PeerASN) delete(rawMsg, key) } if err != nil { @@ -1994,415 +2569,601 @@ func (i *InternalNetworksList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type L2IsolationDomain. -func (l L2IsolationDomain) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InternalNetworkPropertiesStaticRouteConfiguration. +func (i InternalNetworkPropertiesStaticRouteConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", l.ID) - populate(objectMap, "location", l.Location) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "systemData", l.SystemData) - populate(objectMap, "tags", l.Tags) - populate(objectMap, "type", l.Type) + populate(objectMap, "bfdConfiguration", i.BfdConfiguration) + populate(objectMap, "extension", i.Extension) + populate(objectMap, "ipv4Routes", i.IPv4Routes) + populate(objectMap, "ipv6Routes", i.IPv6Routes) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type L2IsolationDomain. -func (l *L2IsolationDomain) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type InternalNetworkPropertiesStaticRouteConfiguration. +func (i *InternalNetworkPropertiesStaticRouteConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &l.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &l.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &l.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) + case "bfdConfiguration": + err = unpopulate(val, "BfdConfiguration", &i.BfdConfiguration) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &l.SystemData) + case "extension": + err = unpopulate(val, "Extension", &i.Extension) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &l.Tags) + case "ipv4Routes": + err = unpopulate(val, "IPv4Routes", &i.IPv4Routes) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &l.Type) + case "ipv6Routes": + err = unpopulate(val, "IPv6Routes", &i.IPv6Routes) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type L2IsolationDomainPatch. -func (l L2IsolationDomainPatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InternalNetworksList. +func (i InternalNetworksList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "tags", l.Tags) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type L2IsolationDomainPatch. -func (l *L2IsolationDomainPatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type InternalNetworksList. +func (i *InternalNetworksList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &l.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &l.Tags) + case "value": + err = unpopulate(val, "Value", &i.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type L2IsolationDomainPatchProperties. -func (l L2IsolationDomainPatchProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InternetGateway. +func (i InternetGateway) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "annotation", l.Annotation) - populate(objectMap, "mtu", l.Mtu) + populate(objectMap, "id", i.ID) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "systemData", i.SystemData) + populate(objectMap, "tags", i.Tags) + populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type L2IsolationDomainPatchProperties. -func (l *L2IsolationDomainPatchProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type InternetGateway. +func (i *InternetGateway) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "annotation": - err = unpopulate(val, "Annotation", &l.Annotation) + case "id": + err = unpopulate(val, "ID", &i.ID) delete(rawMsg, key) - case "mtu": - err = unpopulate(val, "Mtu", &l.Mtu) + case "location": + err = unpopulate(val, "Location", &i.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &i.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &i.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type L2IsolationDomainProperties. -func (l L2IsolationDomainProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InternetGatewayPatch. +func (i InternetGatewayPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "administrativeState", l.AdministrativeState) - populate(objectMap, "annotation", l.Annotation) - populate(objectMap, "disabledOnResources", l.DisabledOnResources) - populate(objectMap, "mtu", l.Mtu) - populate(objectMap, "networkFabricId", l.NetworkFabricID) - populate(objectMap, "provisioningState", l.ProvisioningState) - populate(objectMap, "vlanId", l.VlanID) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "tags", i.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type L2IsolationDomainProperties. -func (l *L2IsolationDomainProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type InternetGatewayPatch. +func (i *InternetGatewayPatch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "administrativeState": - err = unpopulate(val, "AdministrativeState", &l.AdministrativeState) - delete(rawMsg, key) - case "annotation": - err = unpopulate(val, "Annotation", &l.Annotation) - delete(rawMsg, key) - case "disabledOnResources": - err = unpopulate(val, "DisabledOnResources", &l.DisabledOnResources) - delete(rawMsg, key) - case "mtu": - err = unpopulate(val, "Mtu", &l.Mtu) - delete(rawMsg, key) - case "networkFabricId": - err = unpopulate(val, "NetworkFabricID", &l.NetworkFabricID) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + case "tags": + err = unpopulate(val, "Tags", &i.Tags) delete(rawMsg, key) - case "vlanId": - err = unpopulate(val, "VlanID", &l.VlanID) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InternetGatewayPatchableProperties. +func (i InternetGatewayPatchableProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "internetGatewayRuleId", i.InternetGatewayRuleID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InternetGatewayPatchableProperties. +func (i *InternetGatewayPatchableProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "internetGatewayRuleId": + err = unpopulate(val, "InternetGatewayRuleID", &i.InternetGatewayRuleID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type L2IsolationDomainsListResult. -func (l L2IsolationDomainsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InternetGatewayProperties. +func (i InternetGatewayProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) + populate(objectMap, "annotation", i.Annotation) + populate(objectMap, "ipv4Address", i.IPv4Address) + populate(objectMap, "internetGatewayRuleId", i.InternetGatewayRuleID) + populate(objectMap, "networkFabricControllerId", i.NetworkFabricControllerID) + populate(objectMap, "port", i.Port) + populate(objectMap, "provisioningState", i.ProvisioningState) + populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type L2IsolationDomainsListResult. -func (l *L2IsolationDomainsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type InternetGatewayProperties. +func (i *InternetGatewayProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) + case "annotation": + err = unpopulate(val, "Annotation", &i.Annotation) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) + case "ipv4Address": + err = unpopulate(val, "IPv4Address", &i.IPv4Address) + delete(rawMsg, key) + case "internetGatewayRuleId": + err = unpopulate(val, "InternetGatewayRuleID", &i.InternetGatewayRuleID) + delete(rawMsg, key) + case "networkFabricControllerId": + err = unpopulate(val, "NetworkFabricControllerID", &i.NetworkFabricControllerID) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &i.Port) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type L3IsolationDomain. -func (l L3IsolationDomain) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InternetGatewayRule. +func (i InternetGatewayRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", l.ID) - populate(objectMap, "location", l.Location) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "systemData", l.SystemData) - populate(objectMap, "tags", l.Tags) - populate(objectMap, "type", l.Type) + populate(objectMap, "id", i.ID) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "systemData", i.SystemData) + populate(objectMap, "tags", i.Tags) + populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type L3IsolationDomain. -func (l *L3IsolationDomain) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type InternetGatewayRule. +func (i *InternetGatewayRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &l.ID) + err = unpopulate(val, "ID", &i.ID) delete(rawMsg, key) case "location": - err = unpopulate(val, "Location", &l.Location) + err = unpopulate(val, "Location", &i.Location) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &l.Name) + err = unpopulate(val, "Name", &i.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &l.Properties) + err = unpopulate(val, "Properties", &i.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &l.SystemData) + err = unpopulate(val, "SystemData", &i.SystemData) delete(rawMsg, key) case "tags": - err = unpopulate(val, "Tags", &l.Tags) + err = unpopulate(val, "Tags", &i.Tags) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &l.Type) + err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type L3IsolationDomainPatch. -func (l L3IsolationDomainPatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InternetGatewayRulePatch. +func (i InternetGatewayRulePatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "tags", l.Tags) + populate(objectMap, "tags", i.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type L3IsolationDomainPatch. -func (l *L3IsolationDomainPatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type InternetGatewayRulePatch. +func (i *InternetGatewayRulePatch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &l.Properties) - delete(rawMsg, key) case "tags": - err = unpopulate(val, "Tags", &l.Tags) + err = unpopulate(val, "Tags", &i.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type L3IsolationDomainPatchProperties. -func (l L3IsolationDomainPatchProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InternetGatewayRuleProperties. +func (i InternetGatewayRuleProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "aggregateRouteConfiguration", l.AggregateRouteConfiguration) - populate(objectMap, "connectedSubnetRoutePolicy", l.ConnectedSubnetRoutePolicy) - populate(objectMap, "description", l.Description) - populate(objectMap, "redistributeConnectedSubnets", l.RedistributeConnectedSubnets) - populate(objectMap, "redistributeStaticRoutes", l.RedistributeStaticRoutes) + populate(objectMap, "annotation", i.Annotation) + populate(objectMap, "internetGatewayIds", i.InternetGatewayIDs) + populate(objectMap, "provisioningState", i.ProvisioningState) + populate(objectMap, "ruleProperties", i.RuleProperties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type L3IsolationDomainPatchProperties. -func (l *L3IsolationDomainPatchProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type InternetGatewayRuleProperties. +func (i *InternetGatewayRuleProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "aggregateRouteConfiguration": - err = unpopulate(val, "AggregateRouteConfiguration", &l.AggregateRouteConfiguration) - delete(rawMsg, key) - case "connectedSubnetRoutePolicy": - err = unpopulate(val, "ConnectedSubnetRoutePolicy", &l.ConnectedSubnetRoutePolicy) + case "annotation": + err = unpopulate(val, "Annotation", &i.Annotation) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &l.Description) + case "internetGatewayIds": + err = unpopulate(val, "InternetGatewayIDs", &i.InternetGatewayIDs) delete(rawMsg, key) - case "redistributeConnectedSubnets": - err = unpopulate(val, "RedistributeConnectedSubnets", &l.RedistributeConnectedSubnets) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) delete(rawMsg, key) - case "redistributeStaticRoutes": - err = unpopulate(val, "RedistributeStaticRoutes", &l.RedistributeStaticRoutes) + case "ruleProperties": + err = unpopulate(val, "RuleProperties", &i.RuleProperties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy. -func (l L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InternetGatewayRulesListResult. +func (i InternetGatewayRulesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "administrativeState", l.AdministrativeState) - populate(objectMap, "exportRoutePolicyId", l.ExportRoutePolicyID) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy. -func (l *L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type InternetGatewayRulesListResult. +func (i *InternetGatewayRulesListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "administrativeState": - err = unpopulate(val, "AdministrativeState", &l.AdministrativeState) + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) delete(rawMsg, key) - case "exportRoutePolicyId": - err = unpopulate(val, "ExportRoutePolicyID", &l.ExportRoutePolicyID) + case "value": + err = unpopulate(val, "Value", &i.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type L3IsolationDomainProperties. -func (l L3IsolationDomainProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InternetGatewaysListResult. +func (i InternetGatewaysListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "administrativeState", l.AdministrativeState) - populate(objectMap, "aggregateRouteConfiguration", l.AggregateRouteConfiguration) - populate(objectMap, "annotation", l.Annotation) - populate(objectMap, "connectedSubnetRoutePolicy", l.ConnectedSubnetRoutePolicy) - populate(objectMap, "description", l.Description) - populate(objectMap, "disabledOnResources", l.DisabledOnResources) - populate(objectMap, "networkFabricId", l.NetworkFabricID) - populate(objectMap, "optionBDisabledOnResources", l.OptionBDisabledOnResources) - populate(objectMap, "provisioningState", l.ProvisioningState) - populate(objectMap, "redistributeConnectedSubnets", l.RedistributeConnectedSubnets) - populate(objectMap, "redistributeStaticRoutes", l.RedistributeStaticRoutes) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type L3IsolationDomainProperties. -func (l *L3IsolationDomainProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type InternetGatewaysListResult. +func (i *InternetGatewaysListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "administrativeState": - err = unpopulate(val, "AdministrativeState", &l.AdministrativeState) - delete(rawMsg, key) - case "aggregateRouteConfiguration": - err = unpopulate(val, "AggregateRouteConfiguration", &l.AggregateRouteConfiguration) - delete(rawMsg, key) - case "annotation": - err = unpopulate(val, "Annotation", &l.Annotation) + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) delete(rawMsg, key) - case "connectedSubnetRoutePolicy": - err = unpopulate(val, "ConnectedSubnetRoutePolicy", &l.ConnectedSubnetRoutePolicy) + case "value": + err = unpopulate(val, "Value", &i.Value) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &l.Description) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IsolationDomainProperties. +func (i IsolationDomainProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "encapsulation", i.Encapsulation) + populate(objectMap, "neighborGroupIds", i.NeighborGroupIDs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IsolationDomainProperties. +func (i *IsolationDomainProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "encapsulation": + err = unpopulate(val, "Encapsulation", &i.Encapsulation) + delete(rawMsg, key) + case "neighborGroupIds": + err = unpopulate(val, "NeighborGroupIDs", &i.NeighborGroupIDs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type L2IsolationDomain. +func (l L2IsolationDomain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", l.ID) + populate(objectMap, "location", l.Location) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "tags", l.Tags) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type L2IsolationDomain. +func (l *L2IsolationDomain) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &l.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type L2IsolationDomainPatch. +func (l L2IsolationDomainPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "tags", l.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type L2IsolationDomainPatch. +func (l *L2IsolationDomainPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type L2IsolationDomainPatchProperties. +func (l L2IsolationDomainPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "annotation", l.Annotation) + populate(objectMap, "mtu", l.Mtu) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type L2IsolationDomainPatchProperties. +func (l *L2IsolationDomainPatchProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "annotation": + err = unpopulate(val, "Annotation", &l.Annotation) + delete(rawMsg, key) + case "mtu": + err = unpopulate(val, "Mtu", &l.Mtu) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type L2IsolationDomainProperties. +func (l L2IsolationDomainProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "administrativeState", l.AdministrativeState) + populate(objectMap, "annotation", l.Annotation) + populate(objectMap, "configurationState", l.ConfigurationState) + populate(objectMap, "mtu", l.Mtu) + populate(objectMap, "networkFabricId", l.NetworkFabricID) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "vlanId", l.VlanID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type L2IsolationDomainProperties. +func (l *L2IsolationDomainProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "administrativeState": + err = unpopulate(val, "AdministrativeState", &l.AdministrativeState) + delete(rawMsg, key) + case "annotation": + err = unpopulate(val, "Annotation", &l.Annotation) delete(rawMsg, key) - case "disabledOnResources": - err = unpopulate(val, "DisabledOnResources", &l.DisabledOnResources) + case "configurationState": + err = unpopulate(val, "ConfigurationState", &l.ConfigurationState) + delete(rawMsg, key) + case "mtu": + err = unpopulate(val, "Mtu", &l.Mtu) delete(rawMsg, key) case "networkFabricId": err = unpopulate(val, "NetworkFabricID", &l.NetworkFabricID) delete(rawMsg, key) - case "optionBDisabledOnResources": - err = unpopulate(val, "OptionBDisabledOnResources", &l.OptionBDisabledOnResources) - delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) delete(rawMsg, key) - case "redistributeConnectedSubnets": - err = unpopulate(val, "RedistributeConnectedSubnets", &l.RedistributeConnectedSubnets) - delete(rawMsg, key) - case "redistributeStaticRoutes": - err = unpopulate(val, "RedistributeStaticRoutes", &l.RedistributeStaticRoutes) + case "vlanId": + err = unpopulate(val, "VlanID", &l.VlanID) delete(rawMsg, key) } if err != nil { @@ -2412,16 +3173,16 @@ func (l *L3IsolationDomainProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type L3IsolationDomainsListResult. -func (l L3IsolationDomainsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type L2IsolationDomainsListResult. +func (l L2IsolationDomainsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", l.NextLink) populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type L3IsolationDomainsListResult. -func (l *L3IsolationDomainsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type L2IsolationDomainsListResult. +func (l *L2IsolationDomainsListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) @@ -2443,17 +3204,16 @@ func (l *L3IsolationDomainsListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Layer2Configuration. -func (l Layer2Configuration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type L3ExportRoutePolicy. +func (l L3ExportRoutePolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "interfaces", l.Interfaces) - populate(objectMap, "mtu", l.Mtu) - populate(objectMap, "portCount", l.PortCount) + populate(objectMap, "exportIpv4RoutePolicyId", l.ExportIPv4RoutePolicyID) + populate(objectMap, "exportIpv6RoutePolicyId", l.ExportIPv6RoutePolicyID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Layer2Configuration. -func (l *Layer2Configuration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type L3ExportRoutePolicy. +func (l *L3ExportRoutePolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) @@ -2461,14 +3221,62 @@ func (l *Layer2Configuration) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "interfaces": - err = unpopulate(val, "Interfaces", &l.Interfaces) + case "exportIpv4RoutePolicyId": + err = unpopulate(val, "ExportIPv4RoutePolicyID", &l.ExportIPv4RoutePolicyID) delete(rawMsg, key) - case "mtu": - err = unpopulate(val, "Mtu", &l.Mtu) + case "exportIpv6RoutePolicyId": + err = unpopulate(val, "ExportIPv6RoutePolicyID", &l.ExportIPv6RoutePolicyID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type L3IsolationDomain. +func (l L3IsolationDomain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", l.ID) + populate(objectMap, "location", l.Location) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "tags", l.Tags) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type L3IsolationDomain. +func (l *L3IsolationDomain) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &l.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) delete(rawMsg, key) - case "portCount": - err = unpopulate(val, "PortCount", &l.PortCount) + case "type": + err = unpopulate(val, "Type", &l.Type) delete(rawMsg, key) } if err != nil { @@ -2478,196 +3286,1104 @@ func (l *Layer2Configuration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Layer3Configuration. -func (l Layer3Configuration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type L3IsolationDomainPatch. +func (l L3IsolationDomainPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "exportRoutePolicyId", l.ExportRoutePolicyID) - populate(objectMap, "fabricASN", l.FabricASN) - populate(objectMap, "importRoutePolicyId", l.ImportRoutePolicyID) - populate(objectMap, "peerASN", l.PeerASN) - populate(objectMap, "primaryIpv4Prefix", l.PrimaryIPv4Prefix) - populate(objectMap, "primaryIpv6Prefix", l.PrimaryIPv6Prefix) - populate(objectMap, "secondaryIpv4Prefix", l.SecondaryIPv4Prefix) - populate(objectMap, "secondaryIpv6Prefix", l.SecondaryIPv6Prefix) - populate(objectMap, "vlanId", l.VlanID) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "tags", l.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type L3IsolationDomainPatch. +func (l *L3IsolationDomainPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type L3IsolationDomainPatchProperties. +func (l L3IsolationDomainPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "aggregateRouteConfiguration", l.AggregateRouteConfiguration) + populate(objectMap, "annotation", l.Annotation) + populate(objectMap, "connectedSubnetRoutePolicy", l.ConnectedSubnetRoutePolicy) + populate(objectMap, "redistributeConnectedSubnets", l.RedistributeConnectedSubnets) + populate(objectMap, "redistributeStaticRoutes", l.RedistributeStaticRoutes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type L3IsolationDomainPatchProperties. +func (l *L3IsolationDomainPatchProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "aggregateRouteConfiguration": + err = unpopulate(val, "AggregateRouteConfiguration", &l.AggregateRouteConfiguration) + delete(rawMsg, key) + case "annotation": + err = unpopulate(val, "Annotation", &l.Annotation) + delete(rawMsg, key) + case "connectedSubnetRoutePolicy": + err = unpopulate(val, "ConnectedSubnetRoutePolicy", &l.ConnectedSubnetRoutePolicy) + delete(rawMsg, key) + case "redistributeConnectedSubnets": + err = unpopulate(val, "RedistributeConnectedSubnets", &l.RedistributeConnectedSubnets) + delete(rawMsg, key) + case "redistributeStaticRoutes": + err = unpopulate(val, "RedistributeStaticRoutes", &l.RedistributeStaticRoutes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type L3IsolationDomainProperties. +func (l L3IsolationDomainProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "administrativeState", l.AdministrativeState) + populate(objectMap, "aggregateRouteConfiguration", l.AggregateRouteConfiguration) + populate(objectMap, "annotation", l.Annotation) + populate(objectMap, "configurationState", l.ConfigurationState) + populate(objectMap, "connectedSubnetRoutePolicy", l.ConnectedSubnetRoutePolicy) + populate(objectMap, "networkFabricId", l.NetworkFabricID) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "redistributeConnectedSubnets", l.RedistributeConnectedSubnets) + populate(objectMap, "redistributeStaticRoutes", l.RedistributeStaticRoutes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type L3IsolationDomainProperties. +func (l *L3IsolationDomainProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "administrativeState": + err = unpopulate(val, "AdministrativeState", &l.AdministrativeState) + delete(rawMsg, key) + case "aggregateRouteConfiguration": + err = unpopulate(val, "AggregateRouteConfiguration", &l.AggregateRouteConfiguration) + delete(rawMsg, key) + case "annotation": + err = unpopulate(val, "Annotation", &l.Annotation) + delete(rawMsg, key) + case "configurationState": + err = unpopulate(val, "ConfigurationState", &l.ConfigurationState) + delete(rawMsg, key) + case "connectedSubnetRoutePolicy": + err = unpopulate(val, "ConnectedSubnetRoutePolicy", &l.ConnectedSubnetRoutePolicy) + delete(rawMsg, key) + case "networkFabricId": + err = unpopulate(val, "NetworkFabricID", &l.NetworkFabricID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + delete(rawMsg, key) + case "redistributeConnectedSubnets": + err = unpopulate(val, "RedistributeConnectedSubnets", &l.RedistributeConnectedSubnets) + delete(rawMsg, key) + case "redistributeStaticRoutes": + err = unpopulate(val, "RedistributeStaticRoutes", &l.RedistributeStaticRoutes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type L3IsolationDomainsListResult. +func (l L3IsolationDomainsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type L3IsolationDomainsListResult. +func (l *L3IsolationDomainsListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type L3OptionBProperties. +func (l L3OptionBProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "exportRouteTargets", l.ExportRouteTargets) + populate(objectMap, "importRouteTargets", l.ImportRouteTargets) + populate(objectMap, "routeTargets", l.RouteTargets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type L3OptionBProperties. +func (l *L3OptionBProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "exportRouteTargets": + err = unpopulate(val, "ExportRouteTargets", &l.ExportRouteTargets) + delete(rawMsg, key) + case "importRouteTargets": + err = unpopulate(val, "ImportRouteTargets", &l.ImportRouteTargets) + delete(rawMsg, key) + case "routeTargets": + err = unpopulate(val, "RouteTargets", &l.RouteTargets) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Layer2Configuration. +func (l Layer2Configuration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "interfaces", l.Interfaces) + populate(objectMap, "mtu", l.Mtu) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Layer2Configuration. +func (l *Layer2Configuration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "interfaces": + err = unpopulate(val, "Interfaces", &l.Interfaces) + delete(rawMsg, key) + case "mtu": + err = unpopulate(val, "Mtu", &l.Mtu) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedResourceGroupConfiguration. +func (m ManagedResourceGroupConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedResourceGroupConfiguration. +func (m *ManagedResourceGroupConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "location": + err = unpopulate(val, "Location", &m.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagementNetworkConfigurationPatchableProperties. +func (m ManagementNetworkConfigurationPatchableProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "infrastructureVpnConfiguration", m.InfrastructureVPNConfiguration) + populate(objectMap, "workloadVpnConfiguration", m.WorkloadVPNConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementNetworkConfigurationPatchableProperties. +func (m *ManagementNetworkConfigurationPatchableProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "infrastructureVpnConfiguration": + err = unpopulate(val, "InfrastructureVPNConfiguration", &m.InfrastructureVPNConfiguration) + delete(rawMsg, key) + case "workloadVpnConfiguration": + err = unpopulate(val, "WorkloadVPNConfiguration", &m.WorkloadVPNConfiguration) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagementNetworkConfigurationProperties. +func (m ManagementNetworkConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "infrastructureVpnConfiguration", m.InfrastructureVPNConfiguration) + populate(objectMap, "workloadVpnConfiguration", m.WorkloadVPNConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementNetworkConfigurationProperties. +func (m *ManagementNetworkConfigurationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "infrastructureVpnConfiguration": + err = unpopulate(val, "InfrastructureVPNConfiguration", &m.InfrastructureVPNConfiguration) + delete(rawMsg, key) + case "workloadVpnConfiguration": + err = unpopulate(val, "WorkloadVPNConfiguration", &m.WorkloadVPNConfiguration) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NeighborAddress. +func (n NeighborAddress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address", n.Address) + populate(objectMap, "configurationState", n.ConfigurationState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NeighborAddress. +func (n *NeighborAddress) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "address": + err = unpopulate(val, "Address", &n.Address) + delete(rawMsg, key) + case "configurationState": + err = unpopulate(val, "ConfigurationState", &n.ConfigurationState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NeighborGroup. +func (n NeighborGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NeighborGroup. +func (n *NeighborGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NeighborGroupDestination. +func (n NeighborGroupDestination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipv4Addresses", n.IPv4Addresses) + populate(objectMap, "ipv6Addresses", n.IPv6Addresses) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NeighborGroupDestination. +func (n *NeighborGroupDestination) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ipv4Addresses": + err = unpopulate(val, "IPv4Addresses", &n.IPv4Addresses) + delete(rawMsg, key) + case "ipv6Addresses": + err = unpopulate(val, "IPv6Addresses", &n.IPv6Addresses) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NeighborGroupPatch. +func (n NeighborGroupPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "tags", n.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NeighborGroupPatch. +func (n *NeighborGroupPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NeighborGroupPatchProperties. +func (n NeighborGroupPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "annotation", n.Annotation) + populate(objectMap, "destination", n.Destination) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NeighborGroupPatchProperties. +func (n *NeighborGroupPatchProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "annotation": + err = unpopulate(val, "Annotation", &n.Annotation) + delete(rawMsg, key) + case "destination": + err = unpopulate(val, "Destination", &n.Destination) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NeighborGroupProperties. +func (n NeighborGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "annotation", n.Annotation) + populate(objectMap, "destination", n.Destination) + populate(objectMap, "networkTapIds", n.NetworkTapIDs) + populate(objectMap, "networkTapRuleIds", n.NetworkTapRuleIDs) + populate(objectMap, "provisioningState", n.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NeighborGroupProperties. +func (n *NeighborGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "annotation": + err = unpopulate(val, "Annotation", &n.Annotation) + delete(rawMsg, key) + case "destination": + err = unpopulate(val, "Destination", &n.Destination) + delete(rawMsg, key) + case "networkTapIds": + err = unpopulate(val, "NetworkTapIDs", &n.NetworkTapIDs) + delete(rawMsg, key) + case "networkTapRuleIds": + err = unpopulate(val, "NetworkTapRuleIDs", &n.NetworkTapRuleIDs) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NeighborGroupsListResult. +func (n NeighborGroupsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NeighborGroupsListResult. +func (n *NeighborGroupsListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkDevice. +func (n NetworkDevice) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDevice. +func (n *NetworkDevice) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkDevicePatchParameters. +func (n NetworkDevicePatchParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "tags", n.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDevicePatchParameters. +func (n *NetworkDevicePatchParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkDevicePatchParametersProperties. +func (n NetworkDevicePatchParametersProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "annotation", n.Annotation) + populate(objectMap, "hostName", n.HostName) + populate(objectMap, "serialNumber", n.SerialNumber) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDevicePatchParametersProperties. +func (n *NetworkDevicePatchParametersProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "annotation": + err = unpopulate(val, "Annotation", &n.Annotation) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &n.HostName) + delete(rawMsg, key) + case "serialNumber": + err = unpopulate(val, "SerialNumber", &n.SerialNumber) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkDeviceProperties. +func (n NetworkDeviceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "administrativeState", n.AdministrativeState) + populate(objectMap, "annotation", n.Annotation) + populate(objectMap, "configurationState", n.ConfigurationState) + populate(objectMap, "hostName", n.HostName) + populate(objectMap, "managementIpv4Address", n.ManagementIPv4Address) + populate(objectMap, "managementIpv6Address", n.ManagementIPv6Address) + populate(objectMap, "networkDeviceRole", n.NetworkDeviceRole) + populate(objectMap, "networkDeviceSku", n.NetworkDeviceSKU) + populate(objectMap, "networkRackId", n.NetworkRackID) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "serialNumber", n.SerialNumber) + populate(objectMap, "version", n.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDeviceProperties. +func (n *NetworkDeviceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "administrativeState": + err = unpopulate(val, "AdministrativeState", &n.AdministrativeState) + delete(rawMsg, key) + case "annotation": + err = unpopulate(val, "Annotation", &n.Annotation) + delete(rawMsg, key) + case "configurationState": + err = unpopulate(val, "ConfigurationState", &n.ConfigurationState) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &n.HostName) + delete(rawMsg, key) + case "managementIpv4Address": + err = unpopulate(val, "ManagementIPv4Address", &n.ManagementIPv4Address) + delete(rawMsg, key) + case "managementIpv6Address": + err = unpopulate(val, "ManagementIPv6Address", &n.ManagementIPv6Address) + delete(rawMsg, key) + case "networkDeviceRole": + err = unpopulate(val, "NetworkDeviceRole", &n.NetworkDeviceRole) + delete(rawMsg, key) + case "networkDeviceSku": + err = unpopulate(val, "NetworkDeviceSKU", &n.NetworkDeviceSKU) + delete(rawMsg, key) + case "networkRackId": + err = unpopulate(val, "NetworkRackID", &n.NetworkRackID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "serialNumber": + err = unpopulate(val, "SerialNumber", &n.SerialNumber) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &n.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkDeviceSKU. +func (n NetworkDeviceSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDeviceSKU. +func (n *NetworkDeviceSKU) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkDeviceSKUProperties. +func (n NetworkDeviceSKUProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "interfaces", n.Interfaces) + populate(objectMap, "manufacturer", n.Manufacturer) + populate(objectMap, "model", n.Model) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "supportedRoleTypes", n.SupportedRoleTypes) + populate(objectMap, "supportedVersions", n.SupportedVersions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDeviceSKUProperties. +func (n *NetworkDeviceSKUProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "interfaces": + err = unpopulate(val, "Interfaces", &n.Interfaces) + delete(rawMsg, key) + case "manufacturer": + err = unpopulate(val, "Manufacturer", &n.Manufacturer) + delete(rawMsg, key) + case "model": + err = unpopulate(val, "Model", &n.Model) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "supportedRoleTypes": + err = unpopulate(val, "SupportedRoleTypes", &n.SupportedRoleTypes) + delete(rawMsg, key) + case "supportedVersions": + err = unpopulate(val, "SupportedVersions", &n.SupportedVersions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkDeviceSKUsListResult. +func (n NetworkDeviceSKUsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDeviceSKUsListResult. +func (n *NetworkDeviceSKUsListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkDevicesListResult. +func (n NetworkDevicesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDevicesListResult. +func (n *NetworkDevicesListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFabric. +func (n NetworkFabric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Layer3Configuration. -func (l *Layer3Configuration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabric. +func (n *NetworkFabric) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "exportRoutePolicyId": - err = unpopulate(val, "ExportRoutePolicyID", &l.ExportRoutePolicyID) - delete(rawMsg, key) - case "fabricASN": - err = unpopulate(val, "FabricASN", &l.FabricASN) - delete(rawMsg, key) - case "importRoutePolicyId": - err = unpopulate(val, "ImportRoutePolicyID", &l.ImportRoutePolicyID) + case "id": + err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) - case "peerASN": - err = unpopulate(val, "PeerASN", &l.PeerASN) + case "location": + err = unpopulate(val, "Location", &n.Location) delete(rawMsg, key) - case "primaryIpv4Prefix": - err = unpopulate(val, "PrimaryIPv4Prefix", &l.PrimaryIPv4Prefix) + case "name": + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) - case "primaryIpv6Prefix": - err = unpopulate(val, "PrimaryIPv6Prefix", &l.PrimaryIPv6Prefix) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) - case "secondaryIpv4Prefix": - err = unpopulate(val, "SecondaryIPv4Prefix", &l.SecondaryIPv4Prefix) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) delete(rawMsg, key) - case "secondaryIpv6Prefix": - err = unpopulate(val, "SecondaryIPv6Prefix", &l.SecondaryIPv6Prefix) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) delete(rawMsg, key) - case "vlanId": - err = unpopulate(val, "VlanID", &l.VlanID) + case "type": + err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Layer3OptionAProperties. -func (l Layer3OptionAProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkFabricController. +func (n NetworkFabricController) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "bfdConfiguration", l.BfdConfiguration) - populate(objectMap, "fabricASN", l.FabricASN) - populate(objectMap, "mtu", l.Mtu) - populate(objectMap, "peerASN", l.PeerASN) - populate(objectMap, "primaryIpv4Prefix", l.PrimaryIPv4Prefix) - populate(objectMap, "primaryIpv6Prefix", l.PrimaryIPv6Prefix) - populate(objectMap, "secondaryIpv4Prefix", l.SecondaryIPv4Prefix) - populate(objectMap, "secondaryIpv6Prefix", l.SecondaryIPv6Prefix) - populate(objectMap, "vlanId", l.VlanID) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Layer3OptionAProperties. -func (l *Layer3OptionAProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricController. +func (n *NetworkFabricController) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "bfdConfiguration": - err = unpopulate(val, "BfdConfiguration", &l.BfdConfiguration) - delete(rawMsg, key) - case "fabricASN": - err = unpopulate(val, "FabricASN", &l.FabricASN) - delete(rawMsg, key) - case "mtu": - err = unpopulate(val, "Mtu", &l.Mtu) + case "id": + err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) - case "peerASN": - err = unpopulate(val, "PeerASN", &l.PeerASN) + case "location": + err = unpopulate(val, "Location", &n.Location) delete(rawMsg, key) - case "primaryIpv4Prefix": - err = unpopulate(val, "PrimaryIPv4Prefix", &l.PrimaryIPv4Prefix) + case "name": + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) - case "primaryIpv6Prefix": - err = unpopulate(val, "PrimaryIPv6Prefix", &l.PrimaryIPv6Prefix) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) - case "secondaryIpv4Prefix": - err = unpopulate(val, "SecondaryIPv4Prefix", &l.SecondaryIPv4Prefix) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) delete(rawMsg, key) - case "secondaryIpv6Prefix": - err = unpopulate(val, "SecondaryIPv6Prefix", &l.SecondaryIPv6Prefix) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) delete(rawMsg, key) - case "vlanId": - err = unpopulate(val, "VlanID", &l.VlanID) + case "type": + err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedResourceGroupConfiguration. -func (m ManagedResourceGroupConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkFabricControllerPatch. +func (n NetworkFabricControllerPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "tags", n.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedResourceGroupConfiguration. -func (m *ManagedResourceGroupConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricControllerPatch. +func (n *NetworkFabricControllerPatch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "location": - err = unpopulate(val, "Location", &m.Location) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagementNetworkConfiguration. -func (m ManagementNetworkConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkFabricControllerPatchableProperties. +func (n NetworkFabricControllerPatchableProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "infrastructureVpnConfiguration", m.InfrastructureVPNConfiguration) - populate(objectMap, "workloadVpnConfiguration", m.WorkloadVPNConfiguration) + populate(objectMap, "infrastructureExpressRouteConnections", n.InfrastructureExpressRouteConnections) + populate(objectMap, "workloadExpressRouteConnections", n.WorkloadExpressRouteConnections) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementNetworkConfiguration. -func (m *ManagementNetworkConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricControllerPatchableProperties. +func (n *NetworkFabricControllerPatchableProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "infrastructureVpnConfiguration": - err = unpopulate(val, "InfrastructureVPNConfiguration", &m.InfrastructureVPNConfiguration) + case "infrastructureExpressRouteConnections": + err = unpopulate(val, "InfrastructureExpressRouteConnections", &n.InfrastructureExpressRouteConnections) delete(rawMsg, key) - case "workloadVpnConfiguration": - err = unpopulate(val, "WorkloadVPNConfiguration", &m.WorkloadVPNConfiguration) + case "workloadExpressRouteConnections": + err = unpopulate(val, "WorkloadExpressRouteConnections", &n.WorkloadExpressRouteConnections) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NeighborAddress. -func (n NeighborAddress) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkFabricControllerProperties. +func (n NetworkFabricControllerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "address", n.Address) - populate(objectMap, "operationalState", n.OperationalState) + populate(objectMap, "annotation", n.Annotation) + populate(objectMap, "ipv4AddressSpace", n.IPv4AddressSpace) + populate(objectMap, "ipv6AddressSpace", n.IPv6AddressSpace) + populate(objectMap, "infrastructureExpressRouteConnections", n.InfrastructureExpressRouteConnections) + populate(objectMap, "infrastructureServices", n.InfrastructureServices) + populate(objectMap, "isWorkloadManagementNetworkEnabled", n.IsWorkloadManagementNetworkEnabled) + populate(objectMap, "managedResourceGroupConfiguration", n.ManagedResourceGroupConfiguration) + populate(objectMap, "networkFabricIds", n.NetworkFabricIDs) + populate(objectMap, "nfcSku", n.NfcSKU) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "tenantInternetGatewayIds", n.TenantInternetGatewayIDs) + populate(objectMap, "workloadExpressRouteConnections", n.WorkloadExpressRouteConnections) + populate(objectMap, "workloadManagementNetwork", n.WorkloadManagementNetwork) + populate(objectMap, "workloadServices", n.WorkloadServices) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NeighborAddress. -func (n *NeighborAddress) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricControllerProperties. +func (n *NetworkFabricControllerProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -2675,11 +4391,47 @@ func (n *NeighborAddress) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "address": - err = unpopulate(val, "Address", &n.Address) + case "annotation": + err = unpopulate(val, "Annotation", &n.Annotation) + delete(rawMsg, key) + case "ipv4AddressSpace": + err = unpopulate(val, "IPv4AddressSpace", &n.IPv4AddressSpace) + delete(rawMsg, key) + case "ipv6AddressSpace": + err = unpopulate(val, "IPv6AddressSpace", &n.IPv6AddressSpace) + delete(rawMsg, key) + case "infrastructureExpressRouteConnections": + err = unpopulate(val, "InfrastructureExpressRouteConnections", &n.InfrastructureExpressRouteConnections) + delete(rawMsg, key) + case "infrastructureServices": + err = unpopulate(val, "InfrastructureServices", &n.InfrastructureServices) + delete(rawMsg, key) + case "isWorkloadManagementNetworkEnabled": + err = unpopulate(val, "IsWorkloadManagementNetworkEnabled", &n.IsWorkloadManagementNetworkEnabled) + delete(rawMsg, key) + case "managedResourceGroupConfiguration": + err = unpopulate(val, "ManagedResourceGroupConfiguration", &n.ManagedResourceGroupConfiguration) + delete(rawMsg, key) + case "networkFabricIds": + err = unpopulate(val, "NetworkFabricIDs", &n.NetworkFabricIDs) + delete(rawMsg, key) + case "nfcSku": + err = unpopulate(val, "NfcSKU", &n.NfcSKU) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "tenantInternetGatewayIds": + err = unpopulate(val, "TenantInternetGatewayIDs", &n.TenantInternetGatewayIDs) + delete(rawMsg, key) + case "workloadExpressRouteConnections": + err = unpopulate(val, "WorkloadExpressRouteConnections", &n.WorkloadExpressRouteConnections) delete(rawMsg, key) - case "operationalState": - err = unpopulate(val, "OperationalState", &n.OperationalState) + case "workloadManagementNetwork": + err = unpopulate(val, "WorkloadManagementNetwork", &n.WorkloadManagementNetwork) + delete(rawMsg, key) + case "workloadServices": + err = unpopulate(val, "WorkloadServices", &n.WorkloadServices) delete(rawMsg, key) } if err != nil { @@ -2689,21 +4441,16 @@ func (n *NeighborAddress) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkDevice. -func (n NetworkDevice) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkFabricControllersListResult. +func (n NetworkFabricControllersListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", n.ID) - populate(objectMap, "location", n.Location) - populate(objectMap, "name", n.Name) - populate(objectMap, "properties", n.Properties) - populate(objectMap, "systemData", n.SystemData) - populate(objectMap, "tags", n.Tags) - populate(objectMap, "type", n.Type) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDevice. -func (n *NetworkDevice) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricControllersListResult. +func (n *NetworkFabricControllersListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -2711,26 +4458,11 @@ func (n *NetworkDevice) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &n.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &n.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &n.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &n.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &n.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &n.Tags) + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &n.Type) + case "value": + err = unpopulate(val, "Value", &n.Value) delete(rawMsg, key) } if err != nil { @@ -2740,16 +4472,16 @@ func (n *NetworkDevice) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkDevicePatchParameters. -func (n NetworkDevicePatchParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkFabricPatch. +func (n NetworkFabricPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "properties", n.Properties) populate(objectMap, "tags", n.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDevicePatchParameters. -func (n *NetworkDevicePatchParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricPatch. +func (n *NetworkFabricPatch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -2771,17 +4503,22 @@ func (n *NetworkDevicePatchParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkDevicePatchParametersProperties. -func (n NetworkDevicePatchParametersProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkFabricPatchProperties. +func (n NetworkFabricPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "annotation", n.Annotation) - populate(objectMap, "hostName", n.HostName) - populate(objectMap, "serialNumber", n.SerialNumber) + populate(objectMap, "fabricASN", n.FabricASN) + populate(objectMap, "ipv4Prefix", n.IPv4Prefix) + populate(objectMap, "ipv6Prefix", n.IPv6Prefix) + populate(objectMap, "managementNetworkConfiguration", n.ManagementNetworkConfiguration) + populate(objectMap, "rackCount", n.RackCount) + populate(objectMap, "serverCountPerRack", n.ServerCountPerRack) + populate(objectMap, "terminalServerConfiguration", n.TerminalServerConfiguration) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDevicePatchParametersProperties. -func (n *NetworkDevicePatchParametersProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricPatchProperties. +func (n *NetworkFabricPatchProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -2792,11 +4529,26 @@ func (n *NetworkDevicePatchParametersProperties) UnmarshalJSON(data []byte) erro case "annotation": err = unpopulate(val, "Annotation", &n.Annotation) delete(rawMsg, key) - case "hostName": - err = unpopulate(val, "HostName", &n.HostName) + case "fabricASN": + err = unpopulate(val, "FabricASN", &n.FabricASN) + delete(rawMsg, key) + case "ipv4Prefix": + err = unpopulate(val, "IPv4Prefix", &n.IPv4Prefix) + delete(rawMsg, key) + case "ipv6Prefix": + err = unpopulate(val, "IPv6Prefix", &n.IPv6Prefix) + delete(rawMsg, key) + case "managementNetworkConfiguration": + err = unpopulate(val, "ManagementNetworkConfiguration", &n.ManagementNetworkConfiguration) + delete(rawMsg, key) + case "rackCount": + err = unpopulate(val, "RackCount", &n.RackCount) + delete(rawMsg, key) + case "serverCountPerRack": + err = unpopulate(val, "ServerCountPerRack", &n.ServerCountPerRack) delete(rawMsg, key) - case "serialNumber": - err = unpopulate(val, "SerialNumber", &n.SerialNumber) + case "terminalServerConfiguration": + err = unpopulate(val, "TerminalServerConfiguration", &n.TerminalServerConfiguration) delete(rawMsg, key) } if err != nil { @@ -2806,22 +4558,21 @@ func (n *NetworkDevicePatchParametersProperties) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkDeviceProperties. -func (n NetworkDeviceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkFabricPatchablePropertiesTerminalServerConfiguration. +func (n NetworkFabricPatchablePropertiesTerminalServerConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "annotation", n.Annotation) - populate(objectMap, "hostName", n.HostName) - populate(objectMap, "networkDeviceRole", n.NetworkDeviceRole) - populate(objectMap, "networkDeviceSku", n.NetworkDeviceSKU) - populate(objectMap, "networkRackId", n.NetworkRackID) - populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "password", n.Password) + populate(objectMap, "primaryIpv4Prefix", n.PrimaryIPv4Prefix) + populate(objectMap, "primaryIpv6Prefix", n.PrimaryIPv6Prefix) + populate(objectMap, "secondaryIpv4Prefix", n.SecondaryIPv4Prefix) + populate(objectMap, "secondaryIpv6Prefix", n.SecondaryIPv6Prefix) populate(objectMap, "serialNumber", n.SerialNumber) - populate(objectMap, "version", n.Version) + populate(objectMap, "username", n.Username) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDeviceProperties. -func (n *NetworkDeviceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricPatchablePropertiesTerminalServerConfiguration. +func (n *NetworkFabricPatchablePropertiesTerminalServerConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -2829,29 +4580,26 @@ func (n *NetworkDeviceProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "annotation": - err = unpopulate(val, "Annotation", &n.Annotation) - delete(rawMsg, key) - case "hostName": - err = unpopulate(val, "HostName", &n.HostName) + case "password": + err = unpopulate(val, "Password", &n.Password) delete(rawMsg, key) - case "networkDeviceRole": - err = unpopulate(val, "NetworkDeviceRole", &n.NetworkDeviceRole) + case "primaryIpv4Prefix": + err = unpopulate(val, "PrimaryIPv4Prefix", &n.PrimaryIPv4Prefix) delete(rawMsg, key) - case "networkDeviceSku": - err = unpopulate(val, "NetworkDeviceSKU", &n.NetworkDeviceSKU) + case "primaryIpv6Prefix": + err = unpopulate(val, "PrimaryIPv6Prefix", &n.PrimaryIPv6Prefix) delete(rawMsg, key) - case "networkRackId": - err = unpopulate(val, "NetworkRackID", &n.NetworkRackID) + case "secondaryIpv4Prefix": + err = unpopulate(val, "SecondaryIPv4Prefix", &n.SecondaryIPv4Prefix) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + case "secondaryIpv6Prefix": + err = unpopulate(val, "SecondaryIPv6Prefix", &n.SecondaryIPv6Prefix) delete(rawMsg, key) case "serialNumber": err = unpopulate(val, "SerialNumber", &n.SerialNumber) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &n.Version) + case "username": + err = unpopulate(val, "Username", &n.Username) delete(rawMsg, key) } if err != nil { @@ -2861,17 +4609,32 @@ func (n *NetworkDeviceProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkDeviceRoleProperties. -func (n NetworkDeviceRoleProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkFabricProperties. +func (n NetworkFabricProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "networkDeviceSkuName", n.NetworkDeviceSKUName) - populate(objectMap, "rackSlot", n.RackSlot) - populate(objectMap, "roleType", n.RoleType) + populate(objectMap, "administrativeState", n.AdministrativeState) + populate(objectMap, "annotation", n.Annotation) + populate(objectMap, "configurationState", n.ConfigurationState) + populate(objectMap, "fabricASN", n.FabricASN) + populate(objectMap, "fabricVersion", n.FabricVersion) + populate(objectMap, "ipv4Prefix", n.IPv4Prefix) + populate(objectMap, "ipv6Prefix", n.IPv6Prefix) + populate(objectMap, "l2IsolationDomains", n.L2IsolationDomains) + populate(objectMap, "l3IsolationDomains", n.L3IsolationDomains) + populate(objectMap, "managementNetworkConfiguration", n.ManagementNetworkConfiguration) + populate(objectMap, "networkFabricControllerId", n.NetworkFabricControllerID) + populate(objectMap, "networkFabricSku", n.NetworkFabricSKU) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "rackCount", n.RackCount) + populate(objectMap, "racks", n.Racks) + populate(objectMap, "routerIds", n.RouterIDs) + populate(objectMap, "serverCountPerRack", n.ServerCountPerRack) + populate(objectMap, "terminalServerConfiguration", n.TerminalServerConfiguration) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDeviceRoleProperties. -func (n *NetworkDeviceRoleProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricProperties. +func (n *NetworkFabricProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -2879,14 +4642,59 @@ func (n *NetworkDeviceRoleProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "networkDeviceSkuName": - err = unpopulate(val, "NetworkDeviceSKUName", &n.NetworkDeviceSKUName) + case "administrativeState": + err = unpopulate(val, "AdministrativeState", &n.AdministrativeState) + delete(rawMsg, key) + case "annotation": + err = unpopulate(val, "Annotation", &n.Annotation) + delete(rawMsg, key) + case "configurationState": + err = unpopulate(val, "ConfigurationState", &n.ConfigurationState) + delete(rawMsg, key) + case "fabricASN": + err = unpopulate(val, "FabricASN", &n.FabricASN) + delete(rawMsg, key) + case "fabricVersion": + err = unpopulate(val, "FabricVersion", &n.FabricVersion) + delete(rawMsg, key) + case "ipv4Prefix": + err = unpopulate(val, "IPv4Prefix", &n.IPv4Prefix) + delete(rawMsg, key) + case "ipv6Prefix": + err = unpopulate(val, "IPv6Prefix", &n.IPv6Prefix) + delete(rawMsg, key) + case "l2IsolationDomains": + err = unpopulate(val, "L2IsolationDomains", &n.L2IsolationDomains) + delete(rawMsg, key) + case "l3IsolationDomains": + err = unpopulate(val, "L3IsolationDomains", &n.L3IsolationDomains) + delete(rawMsg, key) + case "managementNetworkConfiguration": + err = unpopulate(val, "ManagementNetworkConfiguration", &n.ManagementNetworkConfiguration) + delete(rawMsg, key) + case "networkFabricControllerId": + err = unpopulate(val, "NetworkFabricControllerID", &n.NetworkFabricControllerID) + delete(rawMsg, key) + case "networkFabricSku": + err = unpopulate(val, "NetworkFabricSKU", &n.NetworkFabricSKU) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "rackCount": + err = unpopulate(val, "RackCount", &n.RackCount) + delete(rawMsg, key) + case "racks": + err = unpopulate(val, "Racks", &n.Racks) delete(rawMsg, key) - case "rackSlot": - err = unpopulate(val, "RackSlot", &n.RackSlot) + case "routerIds": + err = unpopulate(val, "RouterIDs", &n.RouterIDs) delete(rawMsg, key) - case "roleType": - err = unpopulate(val, "RoleType", &n.RoleType) + case "serverCountPerRack": + err = unpopulate(val, "ServerCountPerRack", &n.ServerCountPerRack) + delete(rawMsg, key) + case "terminalServerConfiguration": + err = unpopulate(val, "TerminalServerConfiguration", &n.TerminalServerConfiguration) delete(rawMsg, key) } if err != nil { @@ -2896,8 +4704,8 @@ func (n *NetworkDeviceRoleProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkDeviceSKU. -func (n NetworkDeviceSKU) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkFabricSKU. +func (n NetworkFabricSKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", n.ID) populate(objectMap, "name", n.Name) @@ -2907,8 +4715,8 @@ func (n NetworkDeviceSKU) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDeviceSKU. -func (n *NetworkDeviceSKU) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricSKU. +func (n *NetworkFabricSKU) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -2939,21 +4747,20 @@ func (n *NetworkDeviceSKU) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkDeviceSKUProperties. -func (n NetworkDeviceSKUProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkFabricSKUProperties. +func (n NetworkFabricSKUProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "interfaces", n.Interfaces) - populate(objectMap, "limits", n.Limits) - populate(objectMap, "manufacturer", n.Manufacturer) - populate(objectMap, "model", n.Model) + populate(objectMap, "details", n.Details) + populate(objectMap, "maxComputeRacks", n.MaxComputeRacks) + populate(objectMap, "maximumServerCount", n.MaximumServerCount) populate(objectMap, "provisioningState", n.ProvisioningState) - populate(objectMap, "supportedRoleTypes", n.SupportedRoleTypes) populate(objectMap, "supportedVersions", n.SupportedVersions) + populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDeviceSKUProperties. -func (n *NetworkDeviceSKUProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricSKUProperties. +func (n *NetworkFabricSKUProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -2961,27 +4768,24 @@ func (n *NetworkDeviceSKUProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "interfaces": - err = unpopulate(val, "Interfaces", &n.Interfaces) + case "details": + err = unpopulate(val, "Details", &n.Details) delete(rawMsg, key) - case "limits": - err = unpopulate(val, "Limits", &n.Limits) - delete(rawMsg, key) - case "manufacturer": - err = unpopulate(val, "Manufacturer", &n.Manufacturer) + case "maxComputeRacks": + err = unpopulate(val, "MaxComputeRacks", &n.MaxComputeRacks) delete(rawMsg, key) - case "model": - err = unpopulate(val, "Model", &n.Model) + case "maximumServerCount": + err = unpopulate(val, "MaximumServerCount", &n.MaximumServerCount) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) delete(rawMsg, key) - case "supportedRoleTypes": - err = unpopulate(val, "SupportedRoleTypes", &n.SupportedRoleTypes) - delete(rawMsg, key) case "supportedVersions": err = unpopulate(val, "SupportedVersions", &n.SupportedVersions) delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -2990,16 +4794,16 @@ func (n *NetworkDeviceSKUProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkDeviceSKUsListResult. -func (n NetworkDeviceSKUsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkFabricSKUsListResult. +func (n NetworkFabricSKUsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", n.NextLink) populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDeviceSKUsListResult. -func (n *NetworkDeviceSKUsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricSKUsListResult. +func (n *NetworkFabricSKUsListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3021,16 +4825,16 @@ func (n *NetworkDeviceSKUsListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkDevicesListResult. -func (n NetworkDevicesListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkFabricsListResult. +func (n NetworkFabricsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", n.NextLink) populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDevicesListResult. -func (n *NetworkDevicesListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricsListResult. +func (n *NetworkFabricsListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3052,72 +4856,19 @@ func (n *NetworkDevicesListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFabric. -func (n NetworkFabric) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", n.ID) - populate(objectMap, "location", n.Location) - populate(objectMap, "name", n.Name) - populate(objectMap, "properties", n.Properties) - populate(objectMap, "systemData", n.SystemData) - populate(objectMap, "tags", n.Tags) - populate(objectMap, "type", n.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabric. -func (n *NetworkFabric) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &n.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &n.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &n.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &n.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &n.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &n.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &n.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NetworkFabricController. -func (n NetworkFabricController) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkInterface. +func (n NetworkInterface) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", n.ID) - populate(objectMap, "location", n.Location) populate(objectMap, "name", n.Name) populate(objectMap, "properties", n.Properties) populate(objectMap, "systemData", n.SystemData) - populate(objectMap, "tags", n.Tags) populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricController. -func (n *NetworkFabricController) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterface. +func (n *NetworkInterface) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3128,9 +4879,6 @@ func (n *NetworkFabricController) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &n.Location) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) @@ -3140,9 +4888,6 @@ func (n *NetworkFabricController) UnmarshalJSON(data []byte) error { case "systemData": err = unpopulate(val, "SystemData", &n.SystemData) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &n.Tags) - delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) @@ -3154,16 +4899,15 @@ func (n *NetworkFabricController) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFabricControllerPatch. -func (n NetworkFabricControllerPatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkInterfacePatch. +func (n NetworkInterfacePatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "properties", n.Properties) - populate(objectMap, "tags", n.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricControllerPatch. -func (n *NetworkFabricControllerPatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfacePatch. +func (n *NetworkInterfacePatch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3174,9 +4918,6 @@ func (n *NetworkFabricControllerPatch) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &n.Tags) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3185,16 +4926,15 @@ func (n *NetworkFabricControllerPatch) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFabricControllerPatchableProperties. -func (n NetworkFabricControllerPatchableProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkInterfacePatchProperties. +func (n NetworkInterfacePatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "infrastructureExpressRouteConnections", n.InfrastructureExpressRouteConnections) - populate(objectMap, "workloadExpressRouteConnections", n.WorkloadExpressRouteConnections) + populate(objectMap, "annotation", n.Annotation) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricControllerPatchableProperties. -func (n *NetworkFabricControllerPatchableProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfacePatchProperties. +func (n *NetworkInterfacePatchProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3202,11 +4942,8 @@ func (n *NetworkFabricControllerPatchableProperties) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "infrastructureExpressRouteConnections": - err = unpopulate(val, "InfrastructureExpressRouteConnections", &n.InfrastructureExpressRouteConnections) - delete(rawMsg, key) - case "workloadExpressRouteConnections": - err = unpopulate(val, "WorkloadExpressRouteConnections", &n.WorkloadExpressRouteConnections) + case "annotation": + err = unpopulate(val, "Annotation", &n.Annotation) delete(rawMsg, key) } if err != nil { @@ -3216,26 +4953,22 @@ func (n *NetworkFabricControllerPatchableProperties) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFabricControllerProperties. -func (n NetworkFabricControllerProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkInterfaceProperties. +func (n NetworkInterfaceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "administrativeState", n.AdministrativeState) populate(objectMap, "annotation", n.Annotation) - populate(objectMap, "ipv4AddressSpace", n.IPv4AddressSpace) - populate(objectMap, "ipv6AddressSpace", n.IPv6AddressSpace) - populate(objectMap, "infrastructureExpressRouteConnections", n.InfrastructureExpressRouteConnections) - populate(objectMap, "infrastructureServices", n.InfrastructureServices) - populate(objectMap, "managedResourceGroupConfiguration", n.ManagedResourceGroupConfiguration) - populate(objectMap, "networkFabricIds", n.NetworkFabricIDs) - populate(objectMap, "operationalState", n.OperationalState) + populate(objectMap, "connectedTo", n.ConnectedTo) + populate(objectMap, "ipv4Address", n.IPv4Address) + populate(objectMap, "ipv6Address", n.IPv6Address) + populate(objectMap, "interfaceType", n.InterfaceType) + populate(objectMap, "physicalIdentifier", n.PhysicalIdentifier) populate(objectMap, "provisioningState", n.ProvisioningState) - populate(objectMap, "workloadExpressRouteConnections", n.WorkloadExpressRouteConnections) - populate(objectMap, "workloadManagementNetwork", n.WorkloadManagementNetwork) - populate(objectMap, "workloadServices", n.WorkloadServices) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricControllerProperties. -func (n *NetworkFabricControllerProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfaceProperties. +func (n *NetworkInterfaceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3243,42 +4976,30 @@ func (n *NetworkFabricControllerProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "administrativeState": + err = unpopulate(val, "AdministrativeState", &n.AdministrativeState) + delete(rawMsg, key) case "annotation": err = unpopulate(val, "Annotation", &n.Annotation) delete(rawMsg, key) - case "ipv4AddressSpace": - err = unpopulate(val, "IPv4AddressSpace", &n.IPv4AddressSpace) - delete(rawMsg, key) - case "ipv6AddressSpace": - err = unpopulate(val, "IPv6AddressSpace", &n.IPv6AddressSpace) - delete(rawMsg, key) - case "infrastructureExpressRouteConnections": - err = unpopulate(val, "InfrastructureExpressRouteConnections", &n.InfrastructureExpressRouteConnections) + case "connectedTo": + err = unpopulate(val, "ConnectedTo", &n.ConnectedTo) delete(rawMsg, key) - case "infrastructureServices": - err = unpopulate(val, "InfrastructureServices", &n.InfrastructureServices) + case "ipv4Address": + err = unpopulate(val, "IPv4Address", &n.IPv4Address) delete(rawMsg, key) - case "managedResourceGroupConfiguration": - err = unpopulate(val, "ManagedResourceGroupConfiguration", &n.ManagedResourceGroupConfiguration) + case "ipv6Address": + err = unpopulate(val, "IPv6Address", &n.IPv6Address) delete(rawMsg, key) - case "networkFabricIds": - err = unpopulate(val, "NetworkFabricIDs", &n.NetworkFabricIDs) + case "interfaceType": + err = unpopulate(val, "InterfaceType", &n.InterfaceType) delete(rawMsg, key) - case "operationalState": - err = unpopulate(val, "OperationalState", &n.OperationalState) + case "physicalIdentifier": + err = unpopulate(val, "PhysicalIdentifier", &n.PhysicalIdentifier) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) delete(rawMsg, key) - case "workloadExpressRouteConnections": - err = unpopulate(val, "WorkloadExpressRouteConnections", &n.WorkloadExpressRouteConnections) - delete(rawMsg, key) - case "workloadManagementNetwork": - err = unpopulate(val, "WorkloadManagementNetwork", &n.WorkloadManagementNetwork) - delete(rawMsg, key) - case "workloadServices": - err = unpopulate(val, "WorkloadServices", &n.WorkloadServices) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3287,16 +5008,16 @@ func (n *NetworkFabricControllerProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFabricControllersListResult. -func (n NetworkFabricControllersListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkInterfacesList. +func (n NetworkInterfacesList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", n.NextLink) populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricControllersListResult. -func (n *NetworkFabricControllersListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfacesList. +func (n *NetworkInterfacesList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3318,16 +5039,21 @@ func (n *NetworkFabricControllersListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFabricPatchParameters. -func (n NetworkFabricPatchParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkPacketBroker. +func (n NetworkPacketBroker) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricPatchParameters. -func (n *NetworkFabricPatchParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkPacketBroker. +func (n *NetworkPacketBroker) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3335,12 +5061,27 @@ func (n *NetworkFabricPatchParameters) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &n.Tags) delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3349,19 +5090,15 @@ func (n *NetworkFabricPatchParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFabricPatchParametersProperties. -func (n NetworkFabricPatchParametersProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkPacketBrokerPatch. +func (n NetworkPacketBrokerPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "annotation", n.Annotation) - populate(objectMap, "l2IsolationDomains", n.L2IsolationDomains) - populate(objectMap, "l3IsolationDomains", n.L3IsolationDomains) - populate(objectMap, "racks", n.Racks) - populate(objectMap, "terminalServerConfiguration", n.TerminalServerConfiguration) + populate(objectMap, "tags", n.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricPatchParametersProperties. -func (n *NetworkFabricPatchParametersProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkPacketBrokerPatch. +func (n *NetworkPacketBrokerPatch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3369,20 +5106,8 @@ func (n *NetworkFabricPatchParametersProperties) UnmarshalJSON(data []byte) erro for key, val := range rawMsg { var err error switch key { - case "annotation": - err = unpopulate(val, "Annotation", &n.Annotation) - delete(rawMsg, key) - case "l2IsolationDomains": - err = unpopulate(val, "L2IsolationDomains", &n.L2IsolationDomains) - delete(rawMsg, key) - case "l3IsolationDomains": - err = unpopulate(val, "L3IsolationDomains", &n.L3IsolationDomains) - delete(rawMsg, key) - case "racks": - err = unpopulate(val, "Racks", &n.Racks) - delete(rawMsg, key) - case "terminalServerConfiguration": - err = unpopulate(val, "TerminalServerConfiguration", &n.TerminalServerConfiguration) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) delete(rawMsg, key) } if err != nil { @@ -3392,30 +5117,20 @@ func (n *NetworkFabricPatchParametersProperties) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFabricProperties. -func (n NetworkFabricProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkPacketBrokerProperties. +func (n NetworkPacketBrokerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "annotation", n.Annotation) - populate(objectMap, "fabricASN", n.FabricASN) - populate(objectMap, "ipv4Prefix", n.IPv4Prefix) - populate(objectMap, "ipv6Prefix", n.IPv6Prefix) - populate(objectMap, "l2IsolationDomains", n.L2IsolationDomains) - populate(objectMap, "l3IsolationDomains", n.L3IsolationDomains) - populate(objectMap, "managementNetworkConfiguration", n.ManagementNetworkConfiguration) - populate(objectMap, "networkFabricControllerId", n.NetworkFabricControllerID) - populate(objectMap, "networkFabricSku", n.NetworkFabricSKU) - populate(objectMap, "operationalState", n.OperationalState) + populate(objectMap, "neighborGroupIds", n.NeighborGroupIDs) + populate(objectMap, "networkDeviceIds", n.NetworkDeviceIDs) + populate(objectMap, "networkFabricId", n.NetworkFabricID) + populate(objectMap, "networkTapIds", n.NetworkTapIDs) populate(objectMap, "provisioningState", n.ProvisioningState) - populate(objectMap, "rackCount", n.RackCount) - populate(objectMap, "racks", n.Racks) - populate(objectMap, "routerId", n.RouterID) - populate(objectMap, "serverCountPerRack", n.ServerCountPerRack) - populate(objectMap, "terminalServerConfiguration", n.TerminalServerConfiguration) + populate(objectMap, "sourceInterfaceIds", n.SourceInterfaceIDs) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricProperties. -func (n *NetworkFabricProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkPacketBrokerProperties. +func (n *NetworkPacketBrokerProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3423,53 +5138,23 @@ func (n *NetworkFabricProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "annotation": - err = unpopulate(val, "Annotation", &n.Annotation) - delete(rawMsg, key) - case "fabricASN": - err = unpopulate(val, "FabricASN", &n.FabricASN) - delete(rawMsg, key) - case "ipv4Prefix": - err = unpopulate(val, "IPv4Prefix", &n.IPv4Prefix) - delete(rawMsg, key) - case "ipv6Prefix": - err = unpopulate(val, "IPv6Prefix", &n.IPv6Prefix) - delete(rawMsg, key) - case "l2IsolationDomains": - err = unpopulate(val, "L2IsolationDomains", &n.L2IsolationDomains) - delete(rawMsg, key) - case "l3IsolationDomains": - err = unpopulate(val, "L3IsolationDomains", &n.L3IsolationDomains) - delete(rawMsg, key) - case "managementNetworkConfiguration": - err = unpopulate(val, "ManagementNetworkConfiguration", &n.ManagementNetworkConfiguration) + case "neighborGroupIds": + err = unpopulate(val, "NeighborGroupIDs", &n.NeighborGroupIDs) delete(rawMsg, key) - case "networkFabricControllerId": - err = unpopulate(val, "NetworkFabricControllerID", &n.NetworkFabricControllerID) + case "networkDeviceIds": + err = unpopulate(val, "NetworkDeviceIDs", &n.NetworkDeviceIDs) delete(rawMsg, key) - case "networkFabricSku": - err = unpopulate(val, "NetworkFabricSKU", &n.NetworkFabricSKU) + case "networkFabricId": + err = unpopulate(val, "NetworkFabricID", &n.NetworkFabricID) delete(rawMsg, key) - case "operationalState": - err = unpopulate(val, "OperationalState", &n.OperationalState) + case "networkTapIds": + err = unpopulate(val, "NetworkTapIDs", &n.NetworkTapIDs) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) delete(rawMsg, key) - case "rackCount": - err = unpopulate(val, "RackCount", &n.RackCount) - delete(rawMsg, key) - case "racks": - err = unpopulate(val, "Racks", &n.Racks) - delete(rawMsg, key) - case "routerId": - err = unpopulate(val, "RouterID", &n.RouterID) - delete(rawMsg, key) - case "serverCountPerRack": - err = unpopulate(val, "ServerCountPerRack", &n.ServerCountPerRack) - delete(rawMsg, key) - case "terminalServerConfiguration": - err = unpopulate(val, "TerminalServerConfiguration", &n.TerminalServerConfiguration) + case "sourceInterfaceIds": + err = unpopulate(val, "SourceInterfaceIDs", &n.SourceInterfaceIDs) delete(rawMsg, key) } if err != nil { @@ -3479,19 +5164,16 @@ func (n *NetworkFabricProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFabricSKU. -func (n NetworkFabricSKU) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkPacketBrokersListResult. +func (n NetworkPacketBrokersListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", n.ID) - populate(objectMap, "name", n.Name) - populate(objectMap, "properties", n.Properties) - populate(objectMap, "systemData", n.SystemData) - populate(objectMap, "type", n.Type) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricSKU. -func (n *NetworkFabricSKU) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkPacketBrokersListResult. +func (n *NetworkPacketBrokersListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3499,20 +5181,11 @@ func (n *NetworkFabricSKU) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &n.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &n.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &n.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &n.SystemData) + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &n.Type) + case "value": + err = unpopulate(val, "Value", &n.Value) delete(rawMsg, key) } if err != nil { @@ -3522,20 +5195,21 @@ func (n *NetworkFabricSKU) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFabricSKUProperties. -func (n NetworkFabricSKUProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkRack. +func (n NetworkRack) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "detailsUri", n.DetailsURI) - populate(objectMap, "maxComputeRacks", n.MaxComputeRacks) - populate(objectMap, "maxSupportedVer", n.MaxSupportedVer) - populate(objectMap, "minSupportedVer", n.MinSupportedVer) - populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "tags", n.Tags) populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricSKUProperties. -func (n *NetworkFabricSKUProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRack. +func (n *NetworkRack) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3543,20 +5217,23 @@ func (n *NetworkFabricSKUProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "detailsUri": - err = unpopulate(val, "DetailsURI", &n.DetailsURI) + case "id": + err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) - case "maxComputeRacks": - err = unpopulate(val, "MaxComputeRacks", &n.MaxComputeRacks) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) - case "maxSupportedVer": - err = unpopulate(val, "MaxSupportedVer", &n.MaxSupportedVer) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) - case "minSupportedVer": - err = unpopulate(val, "MinSupportedVer", &n.MinSupportedVer) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &n.Type) @@ -3569,16 +5246,19 @@ func (n *NetworkFabricSKUProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkFabricSKUsListResult. -func (n NetworkFabricSKUsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkRackProperties. +func (n NetworkRackProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", n.NextLink) - populate(objectMap, "value", n.Value) + populate(objectMap, "annotation", n.Annotation) + populate(objectMap, "networkDevices", n.NetworkDevices) + populate(objectMap, "networkFabricId", n.NetworkFabricID) + populate(objectMap, "networkRackType", n.NetworkRackType) + populate(objectMap, "provisioningState", n.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricSKUsListResult. -func (n *NetworkFabricSKUsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRackProperties. +func (n *NetworkRackProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3586,11 +5266,20 @@ func (n *NetworkFabricSKUsListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &n.NextLink) + case "annotation": + err = unpopulate(val, "Annotation", &n.Annotation) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) + case "networkDevices": + err = unpopulate(val, "NetworkDevices", &n.NetworkDevices) + delete(rawMsg, key) + case "networkFabricId": + err = unpopulate(val, "NetworkFabricID", &n.NetworkFabricID) + delete(rawMsg, key) + case "networkRackType": + err = unpopulate(val, "NetworkRackType", &n.NetworkRackType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) delete(rawMsg, key) } if err != nil { @@ -3599,17 +5288,17 @@ func (n *NetworkFabricSKUsListResult) UnmarshalJSON(data []byte) error { } return nil } - -// MarshalJSON implements the json.Marshaller interface for type NetworkFabricsListResult. -func (n NetworkFabricsListResult) MarshalJSON() ([]byte, error) { + +// MarshalJSON implements the json.Marshaller interface for type NetworkRacksListResult. +func (n NetworkRacksListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", n.NextLink) populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkFabricsListResult. -func (n *NetworkFabricsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRacksListResult. +func (n *NetworkRacksListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3631,19 +5320,21 @@ func (n *NetworkFabricsListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkInterface. -func (n NetworkInterface) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkTap. +func (n NetworkTap) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) populate(objectMap, "name", n.Name) populate(objectMap, "properties", n.Properties) populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "tags", n.Tags) populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterface. -func (n *NetworkInterface) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkTap. +func (n *NetworkTap) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3654,6 +5345,9 @@ func (n *NetworkInterface) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) @@ -3663,6 +5357,9 @@ func (n *NetworkInterface) UnmarshalJSON(data []byte) error { case "systemData": err = unpopulate(val, "SystemData", &n.SystemData) delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) @@ -3674,15 +5371,16 @@ func (n *NetworkInterface) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkInterfacePatch. -func (n NetworkInterfacePatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkTapPatch. +func (n NetworkTapPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "properties", n.Properties) + populate(objectMap, "tags", n.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfacePatch. -func (n *NetworkInterfacePatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkTapPatch. +func (n *NetworkTapPatch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3693,6 +5391,9 @@ func (n *NetworkInterfacePatch) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3701,15 +5402,17 @@ func (n *NetworkInterfacePatch) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkInterfacePatchProperties. -func (n NetworkInterfacePatchProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkTapPatchableParameters. +func (n NetworkTapPatchableParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "annotation", n.Annotation) + populate(objectMap, "destinations", n.Destinations) + populate(objectMap, "pollingType", n.PollingType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfacePatchProperties. -func (n *NetworkInterfacePatchProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkTapPatchableParameters. +func (n *NetworkTapPatchableParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3720,6 +5423,12 @@ func (n *NetworkInterfacePatchProperties) UnmarshalJSON(data []byte) error { case "annotation": err = unpopulate(val, "Annotation", &n.Annotation) delete(rawMsg, key) + case "destinations": + err = unpopulate(val, "Destinations", &n.Destinations) + delete(rawMsg, key) + case "pollingType": + err = unpopulate(val, "PollingType", &n.PollingType) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3728,22 +5437,65 @@ func (n *NetworkInterfacePatchProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkInterfaceProperties. -func (n NetworkInterfaceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkTapPatchableParametersDestinationsItem. +func (n NetworkTapPatchableParametersDestinationsItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destinationId", n.DestinationID) + populate(objectMap, "destinationTapRuleId", n.DestinationTapRuleID) + populate(objectMap, "destinationType", n.DestinationType) + populate(objectMap, "isolationDomainProperties", n.IsolationDomainProperties) + populate(objectMap, "name", n.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkTapPatchableParametersDestinationsItem. +func (n *NetworkTapPatchableParametersDestinationsItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "destinationId": + err = unpopulate(val, "DestinationID", &n.DestinationID) + delete(rawMsg, key) + case "destinationTapRuleId": + err = unpopulate(val, "DestinationTapRuleID", &n.DestinationTapRuleID) + delete(rawMsg, key) + case "destinationType": + err = unpopulate(val, "DestinationType", &n.DestinationType) + delete(rawMsg, key) + case "isolationDomainProperties": + err = unpopulate(val, "IsolationDomainProperties", &n.IsolationDomainProperties) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkTapProperties. +func (n NetworkTapProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "administrativeState", n.AdministrativeState) populate(objectMap, "annotation", n.Annotation) - populate(objectMap, "connectedTo", n.ConnectedTo) - populate(objectMap, "ipv4Address", n.IPv4Address) - populate(objectMap, "ipv6Address", n.IPv6Address) - populate(objectMap, "interfaceType", n.InterfaceType) - populate(objectMap, "physicalIdentifier", n.PhysicalIdentifier) + populate(objectMap, "configurationState", n.ConfigurationState) + populate(objectMap, "destinations", n.Destinations) + populate(objectMap, "networkPacketBrokerId", n.NetworkPacketBrokerID) + populate(objectMap, "pollingType", n.PollingType) populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "sourceTapRuleId", n.SourceTapRuleID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfaceProperties. -func (n *NetworkInterfaceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkTapProperties. +func (n *NetworkTapProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3757,24 +5509,24 @@ func (n *NetworkInterfaceProperties) UnmarshalJSON(data []byte) error { case "annotation": err = unpopulate(val, "Annotation", &n.Annotation) delete(rawMsg, key) - case "connectedTo": - err = unpopulate(val, "ConnectedTo", &n.ConnectedTo) - delete(rawMsg, key) - case "ipv4Address": - err = unpopulate(val, "IPv4Address", &n.IPv4Address) + case "configurationState": + err = unpopulate(val, "ConfigurationState", &n.ConfigurationState) delete(rawMsg, key) - case "ipv6Address": - err = unpopulate(val, "IPv6Address", &n.IPv6Address) + case "destinations": + err = unpopulate(val, "Destinations", &n.Destinations) delete(rawMsg, key) - case "interfaceType": - err = unpopulate(val, "InterfaceType", &n.InterfaceType) + case "networkPacketBrokerId": + err = unpopulate(val, "NetworkPacketBrokerID", &n.NetworkPacketBrokerID) delete(rawMsg, key) - case "physicalIdentifier": - err = unpopulate(val, "PhysicalIdentifier", &n.PhysicalIdentifier) + case "pollingType": + err = unpopulate(val, "PollingType", &n.PollingType) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) delete(rawMsg, key) + case "sourceTapRuleId": + err = unpopulate(val, "SourceTapRuleID", &n.SourceTapRuleID) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3783,16 +5535,19 @@ func (n *NetworkInterfaceProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkInterfacesList. -func (n NetworkInterfacesList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkTapPropertiesDestinationsItem. +func (n NetworkTapPropertiesDestinationsItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", n.NextLink) - populate(objectMap, "value", n.Value) + populate(objectMap, "destinationId", n.DestinationID) + populate(objectMap, "destinationTapRuleId", n.DestinationTapRuleID) + populate(objectMap, "destinationType", n.DestinationType) + populate(objectMap, "isolationDomainProperties", n.IsolationDomainProperties) + populate(objectMap, "name", n.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfacesList. -func (n *NetworkInterfacesList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkTapPropertiesDestinationsItem. +func (n *NetworkTapPropertiesDestinationsItem) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3800,11 +5555,20 @@ func (n *NetworkInterfacesList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &n.NextLink) + case "destinationId": + err = unpopulate(val, "DestinationID", &n.DestinationID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) + case "destinationTapRuleId": + err = unpopulate(val, "DestinationTapRuleID", &n.DestinationTapRuleID) + delete(rawMsg, key) + case "destinationType": + err = unpopulate(val, "DestinationType", &n.DestinationType) + delete(rawMsg, key) + case "isolationDomainProperties": + err = unpopulate(val, "IsolationDomainProperties", &n.IsolationDomainProperties) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) } if err != nil { @@ -3814,8 +5578,8 @@ func (n *NetworkInterfacesList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkRack. -func (n NetworkRack) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkTapRule. +func (n NetworkTapRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", n.ID) populate(objectMap, "location", n.Location) @@ -3827,8 +5591,8 @@ func (n NetworkRack) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRack. -func (n *NetworkRack) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkTapRule. +func (n *NetworkTapRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3865,16 +5629,19 @@ func (n *NetworkRack) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkRackPatch. -func (n NetworkRackPatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkTapRuleAction. +func (n NetworkTapRuleAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateAny(objectMap, "properties", n.Properties) - populate(objectMap, "tags", n.Tags) + populate(objectMap, "destinationId", n.DestinationID) + populate(objectMap, "isTimestampEnabled", n.IsTimestampEnabled) + populate(objectMap, "matchConfigurationName", n.MatchConfigurationName) + populate(objectMap, "truncate", n.Truncate) + populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRackPatch. -func (n *NetworkRackPatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkTapRuleAction. +func (n *NetworkTapRuleAction) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3882,11 +5649,20 @@ func (n *NetworkRackPatch) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &n.Properties) + case "destinationId": + err = unpopulate(val, "DestinationID", &n.DestinationID) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &n.Tags) + case "isTimestampEnabled": + err = unpopulate(val, "IsTimestampEnabled", &n.IsTimestampEnabled) + delete(rawMsg, key) + case "matchConfigurationName": + err = unpopulate(val, "MatchConfigurationName", &n.MatchConfigurationName) + delete(rawMsg, key) + case "truncate": + err = unpopulate(val, "Truncate", &n.Truncate) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) } if err != nil { @@ -3896,19 +5672,19 @@ func (n *NetworkRackPatch) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkRackProperties. -func (n NetworkRackProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkTapRuleMatchCondition. +func (n NetworkTapRuleMatchCondition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "annotation", n.Annotation) - populate(objectMap, "networkDevices", n.NetworkDevices) - populate(objectMap, "networkFabricId", n.NetworkFabricID) - populate(objectMap, "networkRackSku", n.NetworkRackSKU) - populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "encapsulationType", n.EncapsulationType) + populate(objectMap, "ipCondition", n.IPCondition) + populate(objectMap, "portCondition", n.PortCondition) + populate(objectMap, "protocolTypes", n.ProtocolTypes) + populate(objectMap, "vlanMatchCondition", n.VlanMatchCondition) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRackProperties. -func (n *NetworkRackProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkTapRuleMatchCondition. +func (n *NetworkTapRuleMatchCondition) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3916,20 +5692,20 @@ func (n *NetworkRackProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "annotation": - err = unpopulate(val, "Annotation", &n.Annotation) + case "encapsulationType": + err = unpopulate(val, "EncapsulationType", &n.EncapsulationType) delete(rawMsg, key) - case "networkDevices": - err = unpopulate(val, "NetworkDevices", &n.NetworkDevices) + case "ipCondition": + err = unpopulate(val, "IPCondition", &n.IPCondition) delete(rawMsg, key) - case "networkFabricId": - err = unpopulate(val, "NetworkFabricID", &n.NetworkFabricID) + case "portCondition": + err = unpopulate(val, "PortCondition", &n.PortCondition) delete(rawMsg, key) - case "networkRackSku": - err = unpopulate(val, "NetworkRackSKU", &n.NetworkRackSKU) + case "protocolTypes": + err = unpopulate(val, "ProtocolTypes", &n.ProtocolTypes) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + case "vlanMatchCondition": + err = unpopulate(val, "VlanMatchCondition", &n.VlanMatchCondition) delete(rawMsg, key) } if err != nil { @@ -3939,19 +5715,19 @@ func (n *NetworkRackProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkRackSKU. -func (n NetworkRackSKU) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkTapRuleMatchConfiguration. +func (n NetworkTapRuleMatchConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", n.ID) - populate(objectMap, "name", n.Name) - populate(objectMap, "properties", n.Properties) - populate(objectMap, "systemData", n.SystemData) - populate(objectMap, "type", n.Type) + populate(objectMap, "actions", n.Actions) + populate(objectMap, "ipAddressType", n.IPAddressType) + populate(objectMap, "matchConditions", n.MatchConditions) + populate(objectMap, "matchConfigurationName", n.MatchConfigurationName) + populate(objectMap, "sequenceNumber", n.SequenceNumber) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRackSKU. -func (n *NetworkRackSKU) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkTapRuleMatchConfiguration. +func (n *NetworkTapRuleMatchConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3959,20 +5735,94 @@ func (n *NetworkRackSKU) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &n.ID) + case "actions": + err = unpopulate(val, "Actions", &n.Actions) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &n.Name) + case "ipAddressType": + err = unpopulate(val, "IPAddressType", &n.IPAddressType) + delete(rawMsg, key) + case "matchConditions": + err = unpopulate(val, "MatchConditions", &n.MatchConditions) + delete(rawMsg, key) + case "matchConfigurationName": + err = unpopulate(val, "MatchConfigurationName", &n.MatchConfigurationName) + delete(rawMsg, key) + case "sequenceNumber": + err = unpopulate(val, "SequenceNumber", &n.SequenceNumber) delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkTapRulePatch. +func (n NetworkTapRulePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "tags", n.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkTapRulePatch. +func (n *NetworkTapRulePatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { case "properties": err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &n.SystemData) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &n.Type) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkTapRulePatchProperties. +func (n NetworkTapRulePatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "annotation", n.Annotation) + populate(objectMap, "configurationType", n.ConfigurationType) + populate(objectMap, "dynamicMatchConfigurations", n.DynamicMatchConfigurations) + populate(objectMap, "matchConfigurations", n.MatchConfigurations) + populate(objectMap, "tapRulesUrl", n.TapRulesURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkTapRulePatchProperties. +func (n *NetworkTapRulePatchProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "annotation": + err = unpopulate(val, "Annotation", &n.Annotation) + delete(rawMsg, key) + case "configurationType": + err = unpopulate(val, "ConfigurationType", &n.ConfigurationType) + delete(rawMsg, key) + case "dynamicMatchConfigurations": + err = unpopulate(val, "DynamicMatchConfigurations", &n.DynamicMatchConfigurations) + delete(rawMsg, key) + case "matchConfigurations": + err = unpopulate(val, "MatchConfigurations", &n.MatchConfigurations) + delete(rawMsg, key) + case "tapRulesUrl": + err = unpopulate(val, "TapRulesURL", &n.TapRulesURL) delete(rawMsg, key) } if err != nil { @@ -3982,20 +5832,25 @@ func (n *NetworkRackSKU) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkRackSKUProperties. -func (n NetworkRackSKUProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkTapRuleProperties. +func (n NetworkTapRuleProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "maximumServerCount", n.MaximumServerCount) - populate(objectMap, "maximumStorageCount", n.MaximumStorageCount) - populate(objectMap, "maximumUplinks", n.MaximumUplinks) - populate(objectMap, "networkDevices", n.NetworkDevices) + populate(objectMap, "administrativeState", n.AdministrativeState) + populate(objectMap, "annotation", n.Annotation) + populate(objectMap, "configurationState", n.ConfigurationState) + populate(objectMap, "configurationType", n.ConfigurationType) + populate(objectMap, "dynamicMatchConfigurations", n.DynamicMatchConfigurations) + populateTimeRFC3339(objectMap, "lastSyncedTime", n.LastSyncedTime) + populate(objectMap, "matchConfigurations", n.MatchConfigurations) + populate(objectMap, "networkTapId", n.NetworkTapID) + populate(objectMap, "pollingIntervalInSeconds", n.PollingIntervalInSeconds) populate(objectMap, "provisioningState", n.ProvisioningState) - populate(objectMap, "roleName", n.RoleName) + populate(objectMap, "tapRulesUrl", n.TapRulesURL) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRackSKUProperties. -func (n *NetworkRackSKUProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkTapRuleProperties. +func (n *NetworkTapRuleProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -4003,23 +5858,38 @@ func (n *NetworkRackSKUProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "maximumServerCount": - err = unpopulate(val, "MaximumServerCount", &n.MaximumServerCount) + case "administrativeState": + err = unpopulate(val, "AdministrativeState", &n.AdministrativeState) + delete(rawMsg, key) + case "annotation": + err = unpopulate(val, "Annotation", &n.Annotation) delete(rawMsg, key) - case "maximumStorageCount": - err = unpopulate(val, "MaximumStorageCount", &n.MaximumStorageCount) + case "configurationState": + err = unpopulate(val, "ConfigurationState", &n.ConfigurationState) delete(rawMsg, key) - case "maximumUplinks": - err = unpopulate(val, "MaximumUplinks", &n.MaximumUplinks) + case "configurationType": + err = unpopulate(val, "ConfigurationType", &n.ConfigurationType) delete(rawMsg, key) - case "networkDevices": - err = unpopulate(val, "NetworkDevices", &n.NetworkDevices) + case "dynamicMatchConfigurations": + err = unpopulate(val, "DynamicMatchConfigurations", &n.DynamicMatchConfigurations) + delete(rawMsg, key) + case "lastSyncedTime": + err = unpopulateTimeRFC3339(val, "LastSyncedTime", &n.LastSyncedTime) + delete(rawMsg, key) + case "matchConfigurations": + err = unpopulate(val, "MatchConfigurations", &n.MatchConfigurations) + delete(rawMsg, key) + case "networkTapId": + err = unpopulate(val, "NetworkTapID", &n.NetworkTapID) + delete(rawMsg, key) + case "pollingIntervalInSeconds": + err = unpopulate(val, "PollingIntervalInSeconds", &n.PollingIntervalInSeconds) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) delete(rawMsg, key) - case "roleName": - err = unpopulate(val, "RoleName", &n.RoleName) + case "tapRulesUrl": + err = unpopulate(val, "TapRulesURL", &n.TapRulesURL) delete(rawMsg, key) } if err != nil { @@ -4029,16 +5899,16 @@ func (n *NetworkRackSKUProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkRackSKUsListResult. -func (n NetworkRackSKUsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkTapRulesListResult. +func (n NetworkTapRulesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", n.NextLink) populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRackSKUsListResult. -func (n *NetworkRackSKUsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkTapRulesListResult. +func (n *NetworkTapRulesListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -4060,16 +5930,16 @@ func (n *NetworkRackSKUsListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkRacksListResult. -func (n NetworkRacksListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkTapsListResult. +func (n NetworkTapsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", n.NextLink) populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRacksListResult. -func (n *NetworkRacksListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkTapsListResult. +func (n *NetworkTapsListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -4091,8 +5961,51 @@ func (n *NetworkRacksListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkToNetworkInterconnect. -func (n NetworkToNetworkInterconnect) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkToNetworkInterconnect. +func (n NetworkToNetworkInterconnect) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkToNetworkInterconnect. +func (n *NetworkToNetworkInterconnect) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkToNetworkInterconnectPatch. +func (n NetworkToNetworkInterconnectPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", n.ID) populate(objectMap, "name", n.Name) @@ -4102,8 +6015,8 @@ func (n NetworkToNetworkInterconnect) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkToNetworkInterconnect. -func (n *NetworkToNetworkInterconnect) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkToNetworkInterconnectPatch. +func (n *NetworkToNetworkInterconnectPatch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -4134,14 +6047,71 @@ func (n *NetworkToNetworkInterconnect) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type NetworkToNetworkInterconnectPatchableProperties. +func (n NetworkToNetworkInterconnectPatchableProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "egressAclId", n.EgressACLID) + populate(objectMap, "exportRoutePolicy", n.ExportRoutePolicy) + populate(objectMap, "importRoutePolicy", n.ImportRoutePolicy) + populate(objectMap, "ingressAclId", n.IngressACLID) + populate(objectMap, "layer2Configuration", n.Layer2Configuration) + populate(objectMap, "npbStaticRouteConfiguration", n.NpbStaticRouteConfiguration) + populate(objectMap, "optionBLayer3Configuration", n.OptionBLayer3Configuration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkToNetworkInterconnectPatchableProperties. +func (n *NetworkToNetworkInterconnectPatchableProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "egressAclId": + err = unpopulate(val, "EgressACLID", &n.EgressACLID) + delete(rawMsg, key) + case "exportRoutePolicy": + err = unpopulate(val, "ExportRoutePolicy", &n.ExportRoutePolicy) + delete(rawMsg, key) + case "importRoutePolicy": + err = unpopulate(val, "ImportRoutePolicy", &n.ImportRoutePolicy) + delete(rawMsg, key) + case "ingressAclId": + err = unpopulate(val, "IngressACLID", &n.IngressACLID) + delete(rawMsg, key) + case "layer2Configuration": + err = unpopulate(val, "Layer2Configuration", &n.Layer2Configuration) + delete(rawMsg, key) + case "npbStaticRouteConfiguration": + err = unpopulate(val, "NpbStaticRouteConfiguration", &n.NpbStaticRouteConfiguration) + delete(rawMsg, key) + case "optionBLayer3Configuration": + err = unpopulate(val, "OptionBLayer3Configuration", &n.OptionBLayer3Configuration) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type NetworkToNetworkInterconnectProperties. func (n NetworkToNetworkInterconnectProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "administrativeState", n.AdministrativeState) + populate(objectMap, "configurationState", n.ConfigurationState) + populate(objectMap, "egressAclId", n.EgressACLID) + populate(objectMap, "exportRoutePolicy", n.ExportRoutePolicy) + populate(objectMap, "importRoutePolicy", n.ImportRoutePolicy) + populate(objectMap, "ingressAclId", n.IngressACLID) populate(objectMap, "isManagementType", n.IsManagementType) populate(objectMap, "layer2Configuration", n.Layer2Configuration) - populate(objectMap, "layer3Configuration", n.Layer3Configuration) populate(objectMap, "nniType", n.NniType) + populate(objectMap, "npbStaticRouteConfiguration", n.NpbStaticRouteConfiguration) + populate(objectMap, "optionBLayer3Configuration", n.OptionBLayer3Configuration) populate(objectMap, "provisioningState", n.ProvisioningState) populate(objectMap, "useOptionB", n.UseOptionB) return json.Marshal(objectMap) @@ -4159,18 +6129,36 @@ func (n *NetworkToNetworkInterconnectProperties) UnmarshalJSON(data []byte) erro case "administrativeState": err = unpopulate(val, "AdministrativeState", &n.AdministrativeState) delete(rawMsg, key) + case "configurationState": + err = unpopulate(val, "ConfigurationState", &n.ConfigurationState) + delete(rawMsg, key) + case "egressAclId": + err = unpopulate(val, "EgressACLID", &n.EgressACLID) + delete(rawMsg, key) + case "exportRoutePolicy": + err = unpopulate(val, "ExportRoutePolicy", &n.ExportRoutePolicy) + delete(rawMsg, key) + case "importRoutePolicy": + err = unpopulate(val, "ImportRoutePolicy", &n.ImportRoutePolicy) + delete(rawMsg, key) + case "ingressAclId": + err = unpopulate(val, "IngressACLID", &n.IngressACLID) + delete(rawMsg, key) case "isManagementType": err = unpopulate(val, "IsManagementType", &n.IsManagementType) delete(rawMsg, key) case "layer2Configuration": err = unpopulate(val, "Layer2Configuration", &n.Layer2Configuration) delete(rawMsg, key) - case "layer3Configuration": - err = unpopulate(val, "Layer3Configuration", &n.Layer3Configuration) - delete(rawMsg, key) case "nniType": err = unpopulate(val, "NniType", &n.NniType) delete(rawMsg, key) + case "npbStaticRouteConfiguration": + err = unpopulate(val, "NpbStaticRouteConfiguration", &n.NpbStaticRouteConfiguration) + delete(rawMsg, key) + case "optionBLayer3Configuration": + err = unpopulate(val, "OptionBLayer3Configuration", &n.OptionBLayer3Configuration) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) delete(rawMsg, key) @@ -4185,6 +6173,57 @@ func (n *NetworkToNetworkInterconnectProperties) UnmarshalJSON(data []byte) erro return nil } +// MarshalJSON implements the json.Marshaller interface for type NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration. +func (n NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fabricASN", n.FabricASN) + populate(objectMap, "peerASN", n.PeerASN) + populate(objectMap, "primaryIpv4Prefix", n.PrimaryIPv4Prefix) + populate(objectMap, "primaryIpv6Prefix", n.PrimaryIPv6Prefix) + populate(objectMap, "secondaryIpv4Prefix", n.SecondaryIPv4Prefix) + populate(objectMap, "secondaryIpv6Prefix", n.SecondaryIPv6Prefix) + populate(objectMap, "vlanId", n.VlanID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration. +func (n *NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "fabricASN": + err = unpopulate(val, "FabricASN", &n.FabricASN) + delete(rawMsg, key) + case "peerASN": + err = unpopulate(val, "PeerASN", &n.PeerASN) + delete(rawMsg, key) + case "primaryIpv4Prefix": + err = unpopulate(val, "PrimaryIPv4Prefix", &n.PrimaryIPv4Prefix) + delete(rawMsg, key) + case "primaryIpv6Prefix": + err = unpopulate(val, "PrimaryIPv6Prefix", &n.PrimaryIPv6Prefix) + delete(rawMsg, key) + case "secondaryIpv4Prefix": + err = unpopulate(val, "SecondaryIPv4Prefix", &n.SecondaryIPv4Prefix) + delete(rawMsg, key) + case "secondaryIpv6Prefix": + err = unpopulate(val, "SecondaryIPv6Prefix", &n.SecondaryIPv6Prefix) + delete(rawMsg, key) + case "vlanId": + err = unpopulate(val, "VlanID", &n.VlanID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type NetworkToNetworkInterconnectsList. func (n NetworkToNetworkInterconnectsList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4216,6 +6255,41 @@ func (n *NetworkToNetworkInterconnectsList) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type NpbStaticRouteConfiguration. +func (n NpbStaticRouteConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bfdConfiguration", n.BfdConfiguration) + populate(objectMap, "ipv4Routes", n.IPv4Routes) + populate(objectMap, "ipv6Routes", n.IPv6Routes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NpbStaticRouteConfiguration. +func (n *NpbStaticRouteConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bfdConfiguration": + err = unpopulate(val, "BfdConfiguration", &n.BfdConfiguration) + delete(rawMsg, key) + case "ipv4Routes": + err = unpopulate(val, "IPv4Routes", &n.IPv4Routes) + delete(rawMsg, key) + case "ipv6Routes": + err = unpopulate(val, "IPv6Routes", &n.IPv6Routes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4329,11 +6403,10 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type OptionAProperties. -func (o OptionAProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OptionBLayer3Configuration. +func (o OptionBLayer3Configuration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "bfdConfiguration", o.BfdConfiguration) - populate(objectMap, "mtu", o.Mtu) + populate(objectMap, "fabricASN", o.FabricASN) populate(objectMap, "peerASN", o.PeerASN) populate(objectMap, "primaryIpv4Prefix", o.PrimaryIPv4Prefix) populate(objectMap, "primaryIpv6Prefix", o.PrimaryIPv6Prefix) @@ -4343,8 +6416,8 @@ func (o OptionAProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OptionAProperties. -func (o *OptionAProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OptionBLayer3Configuration. +func (o *OptionBLayer3Configuration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -4352,11 +6425,8 @@ func (o *OptionAProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "bfdConfiguration": - err = unpopulate(val, "BfdConfiguration", &o.BfdConfiguration) - delete(rawMsg, key) - case "mtu": - err = unpopulate(val, "Mtu", &o.Mtu) + case "fabricASN": + err = unpopulate(val, "FabricASN", &o.FabricASN) delete(rawMsg, key) case "peerASN": err = unpopulate(val, "PeerASN", &o.PeerASN) @@ -4389,6 +6459,7 @@ func (o OptionBProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "exportRouteTargets", o.ExportRouteTargets) populate(objectMap, "importRouteTargets", o.ImportRouteTargets) + populate(objectMap, "routeTargets", o.RouteTargets) return json.Marshal(objectMap) } @@ -4407,6 +6478,9 @@ func (o *OptionBProperties) UnmarshalJSON(data []byte) error { case "importRouteTargets": err = unpopulate(val, "ImportRouteTargets", &o.ImportRouteTargets) delete(rawMsg, key) + case "routeTargets": + err = unpopulate(val, "RouteTargets", &o.RouteTargets) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -4415,32 +6489,98 @@ func (o *OptionBProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type OptionBPropertiesAutoGenerated. -func (o OptionBPropertiesAutoGenerated) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortCondition. +func (p PortCondition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "exportRouteTargets", o.ExportRouteTargets) - populate(objectMap, "importRouteTargets", o.ImportRouteTargets) + populate(objectMap, "layer4Protocol", p.Layer4Protocol) + populate(objectMap, "portGroupNames", p.PortGroupNames) + populate(objectMap, "portType", p.PortType) + populate(objectMap, "ports", p.Ports) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OptionBPropertiesAutoGenerated. -func (o *OptionBPropertiesAutoGenerated) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortCondition. +func (p *PortCondition) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "exportRouteTargets": - err = unpopulate(val, "ExportRouteTargets", &o.ExportRouteTargets) + case "layer4Protocol": + err = unpopulate(val, "Layer4Protocol", &p.Layer4Protocol) delete(rawMsg, key) - case "importRouteTargets": - err = unpopulate(val, "ImportRouteTargets", &o.ImportRouteTargets) + case "portGroupNames": + err = unpopulate(val, "PortGroupNames", &p.PortGroupNames) + delete(rawMsg, key) + case "portType": + err = unpopulate(val, "PortType", &p.PortType) + delete(rawMsg, key) + case "ports": + err = unpopulate(val, "Ports", &p.Ports) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PortGroupProperties. +func (p PortGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", p.Name) + populate(objectMap, "ports", p.Ports) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortGroupProperties. +func (p *PortGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "ports": + err = unpopulate(val, "Ports", &p.Ports) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RebootProperties. +func (r RebootProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "rebootType", r.RebootType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RebootProperties. +func (r *RebootProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "rebootType": + err = unpopulate(val, "RebootType", &r.RebootType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil @@ -4531,6 +6671,7 @@ func (r *RoutePolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RoutePolicyPatch. func (r RoutePolicyPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "properties", r.Properties) populate(objectMap, "tags", r.Tags) return json.Marshal(objectMap) } @@ -4544,6 +6685,9 @@ func (r *RoutePolicyPatch) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &r.Tags) delete(rawMsg, key) @@ -4555,10 +6699,41 @@ func (r *RoutePolicyPatch) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type RoutePolicyPatchableProperties. +func (r RoutePolicyPatchableProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "statements", r.Statements) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RoutePolicyPatchableProperties. +func (r *RoutePolicyPatchableProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "statements": + err = unpopulate(val, "Statements", &r.Statements) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type RoutePolicyProperties. func (r RoutePolicyProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "addressFamilyType", r.AddressFamilyType) + populate(objectMap, "administrativeState", r.AdministrativeState) populate(objectMap, "annotation", r.Annotation) + populate(objectMap, "configurationState", r.ConfigurationState) + populate(objectMap, "networkFabricId", r.NetworkFabricID) populate(objectMap, "provisioningState", r.ProvisioningState) populate(objectMap, "statements", r.Statements) return json.Marshal(objectMap) @@ -4573,14 +6748,104 @@ func (r *RoutePolicyProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "addressFamilyType": + err = unpopulate(val, "AddressFamilyType", &r.AddressFamilyType) + delete(rawMsg, key) + case "administrativeState": + err = unpopulate(val, "AdministrativeState", &r.AdministrativeState) + delete(rawMsg, key) + case "annotation": + err = unpopulate(val, "Annotation", &r.Annotation) + delete(rawMsg, key) + case "configurationState": + err = unpopulate(val, "ConfigurationState", &r.ConfigurationState) + delete(rawMsg, key) + case "networkFabricId": + err = unpopulate(val, "NetworkFabricID", &r.NetworkFabricID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "statements": + err = unpopulate(val, "Statements", &r.Statements) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RoutePolicyStatementProperties. +func (r RoutePolicyStatementProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", r.Action) + populate(objectMap, "annotation", r.Annotation) + populate(objectMap, "condition", r.Condition) + populate(objectMap, "sequenceNumber", r.SequenceNumber) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RoutePolicyStatementProperties. +func (r *RoutePolicyStatementProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &r.Action) + delete(rawMsg, key) case "annotation": err = unpopulate(val, "Annotation", &r.Annotation) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + case "condition": + err = unpopulate(val, "Condition", &r.Condition) + delete(rawMsg, key) + case "sequenceNumber": + err = unpopulate(val, "SequenceNumber", &r.SequenceNumber) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RouteTargetInformation. +func (r RouteTargetInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "exportIpv4RouteTargets", r.ExportIPv4RouteTargets) + populate(objectMap, "exportIpv6RouteTargets", r.ExportIPv6RouteTargets) + populate(objectMap, "importIpv4RouteTargets", r.ImportIPv4RouteTargets) + populate(objectMap, "importIpv6RouteTargets", r.ImportIPv6RouteTargets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteTargetInformation. +func (r *RouteTargetInformation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "exportIpv4RouteTargets": + err = unpopulate(val, "ExportIPv4RouteTargets", &r.ExportIPv4RouteTargets) + delete(rawMsg, key) + case "exportIpv6RouteTargets": + err = unpopulate(val, "ExportIPv6RouteTargets", &r.ExportIPv6RouteTargets) delete(rawMsg, key) - case "statements": - err = unpopulate(val, "Statements", &r.Statements) + case "importIpv4RouteTargets": + err = unpopulate(val, "ImportIPv4RouteTargets", &r.ImportIPv4RouteTargets) + delete(rawMsg, key) + case "importIpv6RouteTargets": + err = unpopulate(val, "ImportIPv6RouteTargets", &r.ImportIPv6RouteTargets) delete(rawMsg, key) } if err != nil { @@ -4590,18 +6855,16 @@ func (r *RoutePolicyProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RoutePolicyStatementProperties. -func (r RoutePolicyStatementProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RuleProperties. +func (r RuleProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "action", r.Action) - populate(objectMap, "annotation", r.Annotation) - populate(objectMap, "condition", r.Condition) - populate(objectMap, "sequenceNumber", r.SequenceNumber) + populate(objectMap, "addressList", r.AddressList) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RoutePolicyStatementProperties. -func (r *RoutePolicyStatementProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RuleProperties. +func (r *RuleProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -4612,14 +6875,8 @@ func (r *RoutePolicyStatementProperties) UnmarshalJSON(data []byte) error { case "action": err = unpopulate(val, "Action", &r.Action) delete(rawMsg, key) - case "annotation": - err = unpopulate(val, "Annotation", &r.Annotation) - delete(rawMsg, key) - case "condition": - err = unpopulate(val, "Condition", &r.Condition) - delete(rawMsg, key) - case "sequenceNumber": - err = unpopulate(val, "SequenceNumber", &r.SequenceNumber) + case "addressList": + err = unpopulate(val, "AddressList", &r.AddressList) delete(rawMsg, key) } if err != nil { @@ -4674,6 +6931,7 @@ func (s StatementConditionProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "ipCommunityIds", s.IPCommunityIDs) populate(objectMap, "ipExtendedCommunityIds", s.IPExtendedCommunityIDs) populate(objectMap, "ipPrefixId", s.IPPrefixID) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } @@ -4695,6 +6953,9 @@ func (s *StatementConditionProperties) UnmarshalJSON(data []byte) error { case "ipPrefixId": err = unpopulate(val, "IPPrefixID", &s.IPPrefixID) delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -4769,33 +7030,6 @@ func (s *StaticRouteProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SupportPackageProperties. -func (s SupportPackageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "supportPackageURL", s.SupportPackageURL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SupportPackageProperties. -func (s *SupportPackageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "supportPackageURL": - err = unpopulate(val, "SupportPackageURL", &s.SupportPackageURL) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type SupportedConnectorProperties. func (s SupportedConnectorProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4830,8 +7064,7 @@ func (s *SupportedConnectorProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SupportedVersionProperties. func (s SupportedVersionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "isCurrent", s.IsCurrent) - populate(objectMap, "isTest", s.IsTest) + populate(objectMap, "isDefault", s.IsDefault) populate(objectMap, "vendorFirmwareVersion", s.VendorFirmwareVersion) populate(objectMap, "vendorOsVersion", s.VendorOsVersion) populate(objectMap, "version", s.Version) @@ -4847,11 +7080,8 @@ func (s *SupportedVersionProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "isCurrent": - err = unpopulate(val, "IsCurrent", &s.IsCurrent) - delete(rawMsg, key) - case "isTest": - err = unpopulate(val, "IsTest", &s.IsTest) + case "isDefault": + err = unpopulate(val, "IsDefault", &s.IsDefault) delete(rawMsg, key) case "vendorFirmwareVersion": err = unpopulate(val, "VendorFirmwareVersion", &s.VendorFirmwareVersion) @@ -4917,6 +7147,33 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TagsUpdate. +func (t TagsUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", t.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagsUpdate. +func (t *TagsUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type TerminalServerConfiguration. func (t TerminalServerConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4972,51 +7229,47 @@ func (t *TerminalServerConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TerminalServerPatchableProperties. -func (t TerminalServerPatchableProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type UpdateAdministrativeState. +func (u UpdateAdministrativeState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "password", t.Password) - populate(objectMap, "serialNumber", t.SerialNumber) - populate(objectMap, "username", t.Username) + populate(objectMap, "resourceIds", u.ResourceIDs) + populate(objectMap, "state", u.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TerminalServerPatchableProperties. -func (t *TerminalServerPatchableProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateAdministrativeState. +func (u *UpdateAdministrativeState) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } for key, val := range rawMsg { var err error switch key { - case "password": - err = unpopulate(val, "Password", &t.Password) - delete(rawMsg, key) - case "serialNumber": - err = unpopulate(val, "SerialNumber", &t.SerialNumber) + case "resourceIds": + err = unpopulate(val, "ResourceIDs", &u.ResourceIDs) delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &t.Username) + case "state": + err = unpopulate(val, "State", &u.State) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type UpdateAdministrativeState. -func (u UpdateAdministrativeState) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type UpdateDeviceAdministrativeState. +func (u UpdateDeviceAdministrativeState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "resourceIds", u.ResourceIDs) populate(objectMap, "state", u.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateAdministrativeState. -func (u *UpdateAdministrativeState) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateDeviceAdministrativeState. +func (u *UpdateDeviceAdministrativeState) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) @@ -5038,16 +7291,15 @@ func (u *UpdateAdministrativeState) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type UpdatePowerCycleProperties. -func (u UpdatePowerCycleProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type UpdateVersion. +func (u UpdateVersion) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "powerEnd", u.PowerEnd) - populate(objectMap, "state", u.State) + populate(objectMap, "version", u.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type UpdatePowerCycleProperties. -func (u *UpdatePowerCycleProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateVersion. +func (u *UpdateVersion) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) @@ -5055,11 +7307,8 @@ func (u *UpdatePowerCycleProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "powerEnd": - err = unpopulate(val, "PowerEnd", &u.PowerEnd) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &u.State) + case "version": + err = unpopulate(val, "Version", &u.Version) delete(rawMsg, key) } if err != nil { @@ -5069,28 +7318,95 @@ func (u *UpdatePowerCycleProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type UpdateVersionProperties. -func (u UpdateVersionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VPNConfigurationPatchableProperties. +func (v VPNConfigurationPatchableProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "skuVersion", u.SKUVersion) + populate(objectMap, "networkToNetworkInterconnectId", v.NetworkToNetworkInterconnectID) + populate(objectMap, "optionAProperties", v.OptionAProperties) + populate(objectMap, "optionBProperties", v.OptionBProperties) + populate(objectMap, "peeringOption", v.PeeringOption) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateVersionProperties. -func (u *UpdateVersionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConfigurationPatchableProperties. +func (v *VPNConfigurationPatchableProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "skuVersion": - err = unpopulate(val, "SKUVersion", &u.SKUVersion) + case "networkToNetworkInterconnectId": + err = unpopulate(val, "NetworkToNetworkInterconnectID", &v.NetworkToNetworkInterconnectID) + delete(rawMsg, key) + case "optionAProperties": + err = unpopulate(val, "OptionAProperties", &v.OptionAProperties) + delete(rawMsg, key) + case "optionBProperties": + err = unpopulate(val, "OptionBProperties", &v.OptionBProperties) + delete(rawMsg, key) + case "peeringOption": + err = unpopulate(val, "PeeringOption", &v.PeeringOption) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VPNConfigurationPatchablePropertiesOptionAProperties. +func (v VPNConfigurationPatchablePropertiesOptionAProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bfdConfiguration", v.BfdConfiguration) + populate(objectMap, "mtu", v.Mtu) + populate(objectMap, "peerASN", v.PeerASN) + populate(objectMap, "primaryIpv4Prefix", v.PrimaryIPv4Prefix) + populate(objectMap, "primaryIpv6Prefix", v.PrimaryIPv6Prefix) + populate(objectMap, "secondaryIpv4Prefix", v.SecondaryIPv4Prefix) + populate(objectMap, "secondaryIpv6Prefix", v.SecondaryIPv6Prefix) + populate(objectMap, "vlanId", v.VlanID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConfigurationPatchablePropertiesOptionAProperties. +func (v *VPNConfigurationPatchablePropertiesOptionAProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bfdConfiguration": + err = unpopulate(val, "BfdConfiguration", &v.BfdConfiguration) + delete(rawMsg, key) + case "mtu": + err = unpopulate(val, "Mtu", &v.Mtu) + delete(rawMsg, key) + case "peerASN": + err = unpopulate(val, "PeerASN", &v.PeerASN) + delete(rawMsg, key) + case "primaryIpv4Prefix": + err = unpopulate(val, "PrimaryIPv4Prefix", &v.PrimaryIPv4Prefix) + delete(rawMsg, key) + case "primaryIpv6Prefix": + err = unpopulate(val, "PrimaryIPv6Prefix", &v.PrimaryIPv6Prefix) + delete(rawMsg, key) + case "secondaryIpv4Prefix": + err = unpopulate(val, "SecondaryIPv4Prefix", &v.SecondaryIPv4Prefix) + delete(rawMsg, key) + case "secondaryIpv6Prefix": + err = unpopulate(val, "SecondaryIPv6Prefix", &v.SecondaryIPv6Prefix) + delete(rawMsg, key) + case "vlanId": + err = unpopulate(val, "VlanID", &v.VlanID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil @@ -5139,32 +7455,184 @@ func (v *VPNConfigurationProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type WorkloadServices. -func (w WorkloadServices) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VPNConfigurationPropertiesOptionAProperties. +func (v VPNConfigurationPropertiesOptionAProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "ipv4AddressSpaces", w.IPv4AddressSpaces) - populate(objectMap, "ipv6AddressSpaces", w.IPv6AddressSpaces) + populate(objectMap, "bfdConfiguration", v.BfdConfiguration) + populate(objectMap, "mtu", v.Mtu) + populate(objectMap, "peerASN", v.PeerASN) + populate(objectMap, "primaryIpv4Prefix", v.PrimaryIPv4Prefix) + populate(objectMap, "primaryIpv6Prefix", v.PrimaryIPv6Prefix) + populate(objectMap, "secondaryIpv4Prefix", v.SecondaryIPv4Prefix) + populate(objectMap, "secondaryIpv6Prefix", v.SecondaryIPv6Prefix) + populate(objectMap, "vlanId", v.VlanID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadServices. -func (w *WorkloadServices) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConfigurationPropertiesOptionAProperties. +func (v *VPNConfigurationPropertiesOptionAProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "ipv4AddressSpaces": - err = unpopulate(val, "IPv4AddressSpaces", &w.IPv4AddressSpaces) + case "bfdConfiguration": + err = unpopulate(val, "BfdConfiguration", &v.BfdConfiguration) delete(rawMsg, key) - case "ipv6AddressSpaces": - err = unpopulate(val, "IPv6AddressSpaces", &w.IPv6AddressSpaces) + case "mtu": + err = unpopulate(val, "Mtu", &v.Mtu) + delete(rawMsg, key) + case "peerASN": + err = unpopulate(val, "PeerASN", &v.PeerASN) + delete(rawMsg, key) + case "primaryIpv4Prefix": + err = unpopulate(val, "PrimaryIPv4Prefix", &v.PrimaryIPv4Prefix) + delete(rawMsg, key) + case "primaryIpv6Prefix": + err = unpopulate(val, "PrimaryIPv6Prefix", &v.PrimaryIPv6Prefix) + delete(rawMsg, key) + case "secondaryIpv4Prefix": + err = unpopulate(val, "SecondaryIPv4Prefix", &v.SecondaryIPv4Prefix) + delete(rawMsg, key) + case "secondaryIpv6Prefix": + err = unpopulate(val, "SecondaryIPv6Prefix", &v.SecondaryIPv6Prefix) + delete(rawMsg, key) + case "vlanId": + err = unpopulate(val, "VlanID", &v.VlanID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateConfigurationProperties. +func (v ValidateConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "validateAction", v.ValidateAction) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateConfigurationProperties. +func (v *ValidateConfigurationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "validateAction": + err = unpopulate(val, "ValidateAction", &v.ValidateAction) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateConfigurationResponse. +func (v ValidateConfigurationResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configurationState", v.ConfigurationState) + populate(objectMap, "error", v.Error) + populate(objectMap, "url", v.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateConfigurationResponse. +func (v *ValidateConfigurationResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "configurationState": + err = unpopulate(val, "ConfigurationState", &v.ConfigurationState) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &v.Error) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &v.URL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VlanGroupProperties. +func (v VlanGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", v.Name) + populate(objectMap, "vlans", v.Vlans) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VlanGroupProperties. +func (v *VlanGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "vlans": + err = unpopulate(val, "Vlans", &v.Vlans) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VlanMatchCondition. +func (v VlanMatchCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "innerVlans", v.InnerVlans) + populate(objectMap, "vlanGroupNames", v.VlanGroupNames) + populate(objectMap, "vlans", v.Vlans) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VlanMatchCondition. +func (v *VlanMatchCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "innerVlans": + err = unpopulate(val, "InnerVlans", &v.InnerVlans) + delete(rawMsg, key) + case "vlanGroupNames": + err = unpopulate(val, "VlanGroupNames", &v.VlanGroupNames) + delete(rawMsg, key) + case "vlans": + err = unpopulate(val, "Vlans", &v.Vlans) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/neighborgroups_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/neighborgroups_client.go new file mode 100644 index 000000000000..07d03764ccdd --- /dev/null +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/neighborgroups_client.go @@ -0,0 +1,412 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armmanagednetworkfabric + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// NeighborGroupsClient contains the methods for the NeighborGroups group. +// Don't use this type directly, use NewNeighborGroupsClient() instead. +type NeighborGroupsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNeighborGroupsClient creates a new instance of NeighborGroupsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewNeighborGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NeighborGroupsClient, error) { + cl, err := arm.NewClient(moduleName+".NeighborGroupsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NeighborGroupsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Implements the Neighbor Group PUT method. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - neighborGroupName - Name of the Neighbor Group. +// - body - Request payload. +// - options - NeighborGroupsClientBeginCreateOptions contains the optional parameters for the NeighborGroupsClient.BeginCreate +// method. +func (client *NeighborGroupsClient) BeginCreate(ctx context.Context, resourceGroupName string, neighborGroupName string, body NeighborGroup, options *NeighborGroupsClientBeginCreateOptions) (*runtime.Poller[NeighborGroupsClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, neighborGroupName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NeighborGroupsClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[NeighborGroupsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Create - Implements the Neighbor Group PUT method. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NeighborGroupsClient) create(ctx context.Context, resourceGroupName string, neighborGroupName string, body NeighborGroup, options *NeighborGroupsClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, neighborGroupName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createCreateRequest creates the Create request. +func (client *NeighborGroupsClient) createCreateRequest(ctx context.Context, resourceGroupName string, neighborGroupName string, body NeighborGroup, options *NeighborGroupsClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if neighborGroupName == "" { + return nil, errors.New("parameter neighborGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{neighborGroupName}", url.PathEscape(neighborGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginDelete - Implements Neighbor Group DELETE method. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - neighborGroupName - Name of the Neighbor Group. +// - options - NeighborGroupsClientBeginDeleteOptions contains the optional parameters for the NeighborGroupsClient.BeginDelete +// method. +func (client *NeighborGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, neighborGroupName string, options *NeighborGroupsClientBeginDeleteOptions) (*runtime.Poller[NeighborGroupsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, neighborGroupName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NeighborGroupsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NeighborGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Implements Neighbor Group DELETE method. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NeighborGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, neighborGroupName string, options *NeighborGroupsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, neighborGroupName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *NeighborGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, neighborGroupName string, options *NeighborGroupsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if neighborGroupName == "" { + return nil, errors.New("parameter neighborGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{neighborGroupName}", url.PathEscape(neighborGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the Neighbor Group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - neighborGroupName - Name of the Neighbor Group. +// - options - NeighborGroupsClientGetOptions contains the optional parameters for the NeighborGroupsClient.Get method. +func (client *NeighborGroupsClient) Get(ctx context.Context, resourceGroupName string, neighborGroupName string, options *NeighborGroupsClientGetOptions) (NeighborGroupsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, neighborGroupName, options) + if err != nil { + return NeighborGroupsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NeighborGroupsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NeighborGroupsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *NeighborGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, neighborGroupName string, options *NeighborGroupsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if neighborGroupName == "" { + return nil, errors.New("parameter neighborGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{neighborGroupName}", url.PathEscape(neighborGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *NeighborGroupsClient) getHandleResponse(resp *http.Response) (NeighborGroupsClientGetResponse, error) { + result := NeighborGroupsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NeighborGroup); err != nil { + return NeighborGroupsClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Displays NeighborGroups list by resource group GET method. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - NeighborGroupsClientListByResourceGroupOptions contains the optional parameters for the NeighborGroupsClient.NewListByResourceGroupPager +// method. +func (client *NeighborGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *NeighborGroupsClientListByResourceGroupOptions) *runtime.Pager[NeighborGroupsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[NeighborGroupsClientListByResourceGroupResponse]{ + More: func(page NeighborGroupsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NeighborGroupsClientListByResourceGroupResponse) (NeighborGroupsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NeighborGroupsClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NeighborGroupsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NeighborGroupsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *NeighborGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *NeighborGroupsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *NeighborGroupsClient) listByResourceGroupHandleResponse(resp *http.Response) (NeighborGroupsClientListByResourceGroupResponse, error) { + result := NeighborGroupsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NeighborGroupsListResult); err != nil { + return NeighborGroupsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Displays NeighborGroups list by subscription GET method. +// +// Generated from API version 2023-06-15 +// - options - NeighborGroupsClientListBySubscriptionOptions contains the optional parameters for the NeighborGroupsClient.NewListBySubscriptionPager +// method. +func (client *NeighborGroupsClient) NewListBySubscriptionPager(options *NeighborGroupsClientListBySubscriptionOptions) *runtime.Pager[NeighborGroupsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[NeighborGroupsClientListBySubscriptionResponse]{ + More: func(page NeighborGroupsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NeighborGroupsClientListBySubscriptionResponse) (NeighborGroupsClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NeighborGroupsClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NeighborGroupsClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NeighborGroupsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *NeighborGroupsClient) listBySubscriptionCreateRequest(ctx context.Context, options *NeighborGroupsClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/neighborGroups" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *NeighborGroupsClient) listBySubscriptionHandleResponse(resp *http.Response) (NeighborGroupsClientListBySubscriptionResponse, error) { + result := NeighborGroupsClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NeighborGroupsListResult); err != nil { + return NeighborGroupsClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// BeginUpdate - Updates the Neighbor Group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - neighborGroupName - Name of the Neighbor Group. +// - body - Neighbor Group properties to update. Only annotations are supported. +// - options - NeighborGroupsClientBeginUpdateOptions contains the optional parameters for the NeighborGroupsClient.BeginUpdate +// method. +func (client *NeighborGroupsClient) BeginUpdate(ctx context.Context, resourceGroupName string, neighborGroupName string, body NeighborGroupPatch, options *NeighborGroupsClientBeginUpdateOptions) (*runtime.Poller[NeighborGroupsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, neighborGroupName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NeighborGroupsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NeighborGroupsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Updates the Neighbor Group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NeighborGroupsClient) update(ctx context.Context, resourceGroupName string, neighborGroupName string, body NeighborGroupPatch, options *NeighborGroupsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, neighborGroupName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *NeighborGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, neighborGroupName string, body NeighborGroupPatch, options *NeighborGroupsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if neighborGroupName == "" { + return nil, errors.New("parameter neighborGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{neighborGroupName}", url.PathEscape(neighborGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/neighborgroups_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/neighborgroups_client_example_test.go new file mode 100644 index 000000000000..eec78a71005a --- /dev/null +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/neighborgroups_client_example_test.go @@ -0,0 +1,402 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armmanagednetworkfabric_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Create_MaximumSet_Gen.json +func ExampleNeighborGroupsClient_BeginCreate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNeighborGroupsClient().BeginCreate(ctx, "example-rg", "example-neighborGroup", armmanagednetworkfabric.NeighborGroup{ + Location: to.Ptr("eastus"), + Tags: map[string]*string{ + "key8107": to.Ptr("1234"), + }, + Properties: &armmanagednetworkfabric.NeighborGroupProperties{ + Annotation: to.Ptr("annotation"), + Destination: &armmanagednetworkfabric.NeighborGroupDestination{ + IPv4Addresses: []*string{ + to.Ptr("10.10.10.10"), + to.Ptr("20.10.10.10"), + to.Ptr("30.10.10.10"), + to.Ptr("40.10.10.10"), + to.Ptr("50.10.10.10"), + to.Ptr("60.10.10.10"), + to.Ptr("70.10.10.10"), + to.Ptr("80.10.10.10"), + to.Ptr("90.10.10.10")}, + IPv6Addresses: []*string{ + to.Ptr("2F::/100")}, + }, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.NeighborGroup = armmanagednetworkfabric.NeighborGroup{ + // Name: to.Ptr("example-neighborGroup"), + // Type: to.Ptr("microsoft.managednetworkfabric/neighborGroups"), + // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.193Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.194Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("KeyValue"), + // }, + // Properties: &armmanagednetworkfabric.NeighborGroupProperties{ + // Annotation: to.Ptr("annotation"), + // Destination: &armmanagednetworkfabric.NeighborGroupDestination{ + // IPv4Addresses: []*string{ + // to.Ptr("10.10.10.10"), + // to.Ptr("20.10.10.10"), + // to.Ptr("30.10.10.10"), + // to.Ptr("40.10.10.10"), + // to.Ptr("50.10.10.10"), + // to.Ptr("60.10.10.10"), + // to.Ptr("70.10.10.10"), + // to.Ptr("80.10.10.10"), + // to.Ptr("90.10.10.10")}, + // IPv6Addresses: []*string{ + // to.Ptr("2F::/100")}, + // }, + // NetworkTapIDs: []*string{ + // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, + // NetworkTapRuleIDs: []*string{ + // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-networkTapRule")}, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Get_MaximumSet_Gen.json +func ExampleNeighborGroupsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewNeighborGroupsClient().Get(ctx, "example-rg", "example-neighborGroup", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.NeighborGroup = armmanagednetworkfabric.NeighborGroup{ + // Name: to.Ptr("example-neighborGroup"), + // Type: to.Ptr("microsoft.managednetworkfabric/neighborGroups"), + // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.193Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.194Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("KeyValue"), + // }, + // Properties: &armmanagednetworkfabric.NeighborGroupProperties{ + // Annotation: to.Ptr("annotation"), + // Destination: &armmanagednetworkfabric.NeighborGroupDestination{ + // IPv4Addresses: []*string{ + // to.Ptr("10.10.10.10"), + // to.Ptr("20.10.10.10"), + // to.Ptr("30.10.10.10"), + // to.Ptr("40.10.10.10"), + // to.Ptr("50.10.10.10"), + // to.Ptr("60.10.10.10"), + // to.Ptr("70.10.10.10"), + // to.Ptr("80.10.10.10"), + // to.Ptr("90.10.10.10")}, + // IPv6Addresses: []*string{ + // to.Ptr("2F::/100")}, + // }, + // NetworkTapIDs: []*string{ + // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, + // NetworkTapRuleIDs: []*string{ + // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-networkTapRule")}, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Update_MaximumSet_Gen.json +func ExampleNeighborGroupsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNeighborGroupsClient().BeginUpdate(ctx, "example-rg", "example-neighborGroup", armmanagednetworkfabric.NeighborGroupPatch{ + Tags: map[string]*string{ + "key8107": to.Ptr("2345"), + }, + Properties: &armmanagednetworkfabric.NeighborGroupPatchProperties{ + Annotation: to.Ptr("Updating"), + Destination: &armmanagednetworkfabric.NeighborGroupDestination{ + IPv4Addresses: []*string{ + to.Ptr("10.10.10.10"), + to.Ptr("20.10.10.10"), + to.Ptr("30.10.10.10"), + to.Ptr("40.10.10.10"), + to.Ptr("50.10.10.10"), + to.Ptr("60.10.10.10"), + to.Ptr("70.10.10.10"), + to.Ptr("80.10.10.10"), + to.Ptr("90.10.10.10")}, + IPv6Addresses: []*string{ + to.Ptr("2F::/100")}, + }, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.NeighborGroup = armmanagednetworkfabric.NeighborGroup{ + // Name: to.Ptr("example-neighborGroup"), + // Type: to.Ptr("microsoft.managednetworkfabric/neighborGroups"), + // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.193Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.194Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "key8107": to.Ptr("2345"), + // }, + // Properties: &armmanagednetworkfabric.NeighborGroupProperties{ + // Annotation: to.Ptr("ivjs"), + // Destination: &armmanagednetworkfabric.NeighborGroupDestination{ + // IPv4Addresses: []*string{ + // to.Ptr("10.10.10.10"), + // to.Ptr("20.10.10.10"), + // to.Ptr("30.10.10.10"), + // to.Ptr("40.10.10.10"), + // to.Ptr("50.10.10.10"), + // to.Ptr("60.10.10.10"), + // to.Ptr("70.10.10.10"), + // to.Ptr("80.10.10.10"), + // to.Ptr("90.10.10.10")}, + // IPv6Addresses: []*string{ + // to.Ptr("2F::/100")}, + // }, + // NetworkTapIDs: []*string{ + // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, + // NetworkTapRuleIDs: []*string{ + // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-networkTapRule")}, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Delete_MaximumSet_Gen.json +func ExampleNeighborGroupsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNeighborGroupsClient().BeginDelete(ctx, "example-rg", "example-neighborGroup", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_ListByResourceGroup_MaximumSet_Gen.json +func ExampleNeighborGroupsClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewNeighborGroupsClient().NewListByResourceGroupPager("example-rg", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.NeighborGroupsListResult = armmanagednetworkfabric.NeighborGroupsListResult{ + // Value: []*armmanagednetworkfabric.NeighborGroup{ + // { + // Name: to.Ptr("example-neighborGroup"), + // Type: to.Ptr("microsoft.managednetworkfabric/neighborGroups"), + // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.193Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.194Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("KeyValue"), + // }, + // Properties: &armmanagednetworkfabric.NeighborGroupProperties{ + // Annotation: to.Ptr("annotation"), + // Destination: &armmanagednetworkfabric.NeighborGroupDestination{ + // IPv4Addresses: []*string{ + // to.Ptr("10.10.10.10"), + // to.Ptr("20.10.10.10"), + // to.Ptr("30.10.10.10"), + // to.Ptr("40.10.10.10"), + // to.Ptr("50.10.10.10"), + // to.Ptr("60.10.10.10"), + // to.Ptr("70.10.10.10"), + // to.Ptr("80.10.10.10"), + // to.Ptr("90.10.10.10")}, + // IPv6Addresses: []*string{ + // to.Ptr("2F::/100")}, + // }, + // NetworkTapIDs: []*string{ + // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, + // NetworkTapRuleIDs: []*string{ + // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-networkTapRule")}, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_ListBySubscription_MaximumSet_Gen.json +func ExampleNeighborGroupsClient_NewListBySubscriptionPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewNeighborGroupsClient().NewListBySubscriptionPager(nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.NeighborGroupsListResult = armmanagednetworkfabric.NeighborGroupsListResult{ + // Value: []*armmanagednetworkfabric.NeighborGroup{ + // { + // Name: to.Ptr("example-neighborGroup"), + // Type: to.Ptr("microsoft.managednetworkfabric/neighborGroups"), + // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.193Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.194Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("KeyValue"), + // }, + // Properties: &armmanagednetworkfabric.NeighborGroupProperties{ + // Annotation: to.Ptr("annotation"), + // Destination: &armmanagednetworkfabric.NeighborGroupDestination{ + // IPv4Addresses: []*string{ + // to.Ptr("10.10.10.10"), + // to.Ptr("20.10.10.10"), + // to.Ptr("30.10.10.10"), + // to.Ptr("40.10.10.10"), + // to.Ptr("50.10.10.10"), + // to.Ptr("60.10.10.10"), + // to.Ptr("70.10.10.10"), + // to.Ptr("80.10.10.10"), + // to.Ptr("90.10.10.10")}, + // IPv6Addresses: []*string{ + // to.Ptr("2F::/100")}, + // }, + // NetworkTapIDs: []*string{ + // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, + // NetworkTapRuleIDs: []*string{ + // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-networkTapRule")}, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdevices_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdevices_client.go index 1fc733c6ac13..4f203467155e 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdevices_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdevices_client.go @@ -29,7 +29,7 @@ type NetworkDevicesClient struct { } // NewNetworkDevicesClient creates a new instance of NetworkDevicesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewNetworkDevicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkDevicesClient, error) { @@ -47,9 +47,9 @@ func NewNetworkDevicesClient(subscriptionID string, credential azcore.TokenCrede // BeginCreate - Create a Network Device resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the Network Device +// - networkDeviceName - Name of the Network Device. // - body - Request payload. // - options - NetworkDevicesClientBeginCreateOptions contains the optional parameters for the NetworkDevicesClient.BeginCreate // method. @@ -70,7 +70,7 @@ func (client *NetworkDevicesClient) BeginCreate(ctx context.Context, resourceGro // Create - Create a Network Device resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *NetworkDevicesClient) create(ctx context.Context, resourceGroupName string, networkDeviceName string, body NetworkDevice, options *NetworkDevicesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, networkDeviceName, body, options) if err != nil { @@ -89,9 +89,6 @@ func (client *NetworkDevicesClient) create(ctx context.Context, resourceGroupNam // createCreateRequest creates the Create request. func (client *NetworkDevicesClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, body NetworkDevice, options *NetworkDevicesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -106,7 +103,7 @@ func (client *NetworkDevicesClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -115,9 +112,9 @@ func (client *NetworkDevicesClient) createCreateRequest(ctx context.Context, res // BeginDelete - Delete the Network Device resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the Network Device +// - networkDeviceName - Name of the Network Device. // - options - NetworkDevicesClientBeginDeleteOptions contains the optional parameters for the NetworkDevicesClient.BeginDelete // method. func (client *NetworkDevicesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginDeleteOptions) (*runtime.Poller[NetworkDevicesClientDeleteResponse], error) { @@ -137,7 +134,7 @@ func (client *NetworkDevicesClient) BeginDelete(ctx context.Context, resourceGro // Delete - Delete the Network Device resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *NetworkDevicesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkDeviceName, options) if err != nil { @@ -147,7 +144,7 @@ func (client *NetworkDevicesClient) deleteOperation(ctx context.Context, resourc if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -156,9 +153,6 @@ func (client *NetworkDevicesClient) deleteOperation(ctx context.Context, resourc // deleteCreateRequest creates the Delete request. func (client *NetworkDevicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -173,85 +167,18 @@ func (client *NetworkDevicesClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// BeginGenerateSupportPackage - Generate Support Package for the given Network Device. +// Get - Gets the Network Device resource details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the NetworkDevice. -// - options - NetworkDevicesClientBeginGenerateSupportPackageOptions contains the optional parameters for the NetworkDevicesClient.BeginGenerateSupportPackage -// method. -func (client *NetworkDevicesClient) BeginGenerateSupportPackage(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginGenerateSupportPackageOptions) (*runtime.Poller[NetworkDevicesClientGenerateSupportPackageResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.generateSupportPackage(ctx, resourceGroupName, networkDeviceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientGenerateSupportPackageResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[NetworkDevicesClientGenerateSupportPackageResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// GenerateSupportPackage - Generate Support Package for the given Network Device. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -func (client *NetworkDevicesClient) generateSupportPackage(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginGenerateSupportPackageOptions) (*http.Response, error) { - req, err := client.generateSupportPackageCreateRequest(ctx, resourceGroupName, networkDeviceName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// generateSupportPackageCreateRequest creates the GenerateSupportPackage request. -func (client *NetworkDevicesClient) generateSupportPackageCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginGenerateSupportPackageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/generateSupportPackage" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkDeviceName == "" { - return nil, errors.New("parameter networkDeviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkDeviceName}", url.PathEscape(networkDeviceName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get the Network Device resource details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the Network Device +// - networkDeviceName - Name of the Network Device. // - options - NetworkDevicesClientGetOptions contains the optional parameters for the NetworkDevicesClient.Get method. func (client *NetworkDevicesClient) Get(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientGetOptions) (NetworkDevicesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, networkDeviceName, options) @@ -271,9 +198,6 @@ func (client *NetworkDevicesClient) Get(ctx context.Context, resourceGroupName s // getCreateRequest creates the Get request. func (client *NetworkDevicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -288,7 +212,7 @@ func (client *NetworkDevicesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,210 +227,9 @@ func (client *NetworkDevicesClient) getHandleResponse(resp *http.Response) (Netw return result, nil } -// BeginGetDynamicInterfaceMaps - Get the dynamic interface maps for the given Network Device. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the NetworkDevice. -// - options - NetworkDevicesClientBeginGetDynamicInterfaceMapsOptions contains the optional parameters for the NetworkDevicesClient.BeginGetDynamicInterfaceMaps -// method. -func (client *NetworkDevicesClient) BeginGetDynamicInterfaceMaps(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginGetDynamicInterfaceMapsOptions) (*runtime.Poller[NetworkDevicesClientGetDynamicInterfaceMapsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getDynamicInterfaceMaps(ctx, resourceGroupName, networkDeviceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientGetDynamicInterfaceMapsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[NetworkDevicesClientGetDynamicInterfaceMapsResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// GetDynamicInterfaceMaps - Get the dynamic interface maps for the given Network Device. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -func (client *NetworkDevicesClient) getDynamicInterfaceMaps(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginGetDynamicInterfaceMapsOptions) (*http.Response, error) { - req, err := client.getDynamicInterfaceMapsCreateRequest(ctx, resourceGroupName, networkDeviceName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getDynamicInterfaceMapsCreateRequest creates the GetDynamicInterfaceMaps request. -func (client *NetworkDevicesClient) getDynamicInterfaceMapsCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginGetDynamicInterfaceMapsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/getDynamicInterfaceMaps" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkDeviceName == "" { - return nil, errors.New("parameter networkDeviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkDeviceName}", url.PathEscape(networkDeviceName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginGetStaticInterfaceMaps - Get the static interface maps for the given Network Device. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the NetworkDevice. -// - options - NetworkDevicesClientBeginGetStaticInterfaceMapsOptions contains the optional parameters for the NetworkDevicesClient.BeginGetStaticInterfaceMaps -// method. -func (client *NetworkDevicesClient) BeginGetStaticInterfaceMaps(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginGetStaticInterfaceMapsOptions) (*runtime.Poller[NetworkDevicesClientGetStaticInterfaceMapsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getStaticInterfaceMaps(ctx, resourceGroupName, networkDeviceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientGetStaticInterfaceMapsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[NetworkDevicesClientGetStaticInterfaceMapsResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// GetStaticInterfaceMaps - Get the static interface maps for the given Network Device. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -func (client *NetworkDevicesClient) getStaticInterfaceMaps(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginGetStaticInterfaceMapsOptions) (*http.Response, error) { - req, err := client.getStaticInterfaceMapsCreateRequest(ctx, resourceGroupName, networkDeviceName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getStaticInterfaceMapsCreateRequest creates the GetStaticInterfaceMaps request. -func (client *NetworkDevicesClient) getStaticInterfaceMapsCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginGetStaticInterfaceMapsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/getStaticInterfaceMaps" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkDeviceName == "" { - return nil, errors.New("parameter networkDeviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkDeviceName}", url.PathEscape(networkDeviceName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginGetStatus - Get the running status of the Network Device. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the NetworkDevice. -// - options - NetworkDevicesClientBeginGetStatusOptions contains the optional parameters for the NetworkDevicesClient.BeginGetStatus -// method. -func (client *NetworkDevicesClient) BeginGetStatus(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginGetStatusOptions) (*runtime.Poller[NetworkDevicesClientGetStatusResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getStatus(ctx, resourceGroupName, networkDeviceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientGetStatusResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[NetworkDevicesClientGetStatusResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// GetStatus - Get the running status of the Network Device. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -func (client *NetworkDevicesClient) getStatus(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginGetStatusOptions) (*http.Response, error) { - req, err := client.getStatusCreateRequest(ctx, resourceGroupName, networkDeviceName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getStatusCreateRequest creates the GetStatus request. -func (client *NetworkDevicesClient) getStatusCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginGetStatusOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/getStatus" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkDeviceName == "" { - return nil, errors.New("parameter networkDeviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkDeviceName}", url.PathEscape(networkDeviceName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - // NewListByResourceGroupPager - List all the Network Device resources in a given resource group. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - NetworkDevicesClientListByResourceGroupOptions contains the optional parameters for the NetworkDevicesClient.NewListByResourceGroupPager // method. @@ -541,9 +264,6 @@ func (client *NetworkDevicesClient) NewListByResourceGroupPager(resourceGroupNam // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *NetworkDevicesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *NetworkDevicesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -554,7 +274,7 @@ func (client *NetworkDevicesClient) listByResourceGroupCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -571,7 +291,7 @@ func (client *NetworkDevicesClient) listByResourceGroupHandleResponse(resp *http // NewListBySubscriptionPager - List all the Network Device resources in a given subscription. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - options - NetworkDevicesClientListBySubscriptionOptions contains the optional parameters for the NetworkDevicesClient.NewListBySubscriptionPager // method. func (client *NetworkDevicesClient) NewListBySubscriptionPager(options *NetworkDevicesClientListBySubscriptionOptions) *runtime.Pager[NetworkDevicesClientListBySubscriptionResponse] { @@ -605,16 +325,13 @@ func (client *NetworkDevicesClient) NewListBySubscriptionPager(options *NetworkD // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *NetworkDevicesClient) listBySubscriptionCreateRequest(ctx context.Context, options *NetworkDevicesClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDevices" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -632,14 +349,15 @@ func (client *NetworkDevicesClient) listBySubscriptionHandleResponse(resp *http. // BeginReboot - Reboot the Network Device. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the NetworkDevice. +// - networkDeviceName - Name of the Network Device. +// - body - Request payload. // - options - NetworkDevicesClientBeginRebootOptions contains the optional parameters for the NetworkDevicesClient.BeginReboot // method. -func (client *NetworkDevicesClient) BeginReboot(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginRebootOptions) (*runtime.Poller[NetworkDevicesClientRebootResponse], error) { +func (client *NetworkDevicesClient) BeginReboot(ctx context.Context, resourceGroupName string, networkDeviceName string, body RebootProperties, options *NetworkDevicesClientBeginRebootOptions) (*runtime.Poller[NetworkDevicesClientRebootResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.reboot(ctx, resourceGroupName, networkDeviceName, options) + resp, err := client.reboot(ctx, resourceGroupName, networkDeviceName, body, options) if err != nil { return nil, err } @@ -654,9 +372,9 @@ func (client *NetworkDevicesClient) BeginReboot(ctx context.Context, resourceGro // Reboot - Reboot the Network Device. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview -func (client *NetworkDevicesClient) reboot(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginRebootOptions) (*http.Response, error) { - req, err := client.rebootCreateRequest(ctx, resourceGroupName, networkDeviceName, options) +// Generated from API version 2023-06-15 +func (client *NetworkDevicesClient) reboot(ctx context.Context, resourceGroupName string, networkDeviceName string, body RebootProperties, options *NetworkDevicesClientBeginRebootOptions) (*http.Response, error) { + req, err := client.rebootCreateRequest(ctx, resourceGroupName, networkDeviceName, body, options) if err != nil { return nil, err } @@ -664,18 +382,15 @@ func (client *NetworkDevicesClient) reboot(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil } // rebootCreateRequest creates the Reboot request. -func (client *NetworkDevicesClient) rebootCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginRebootOptions) (*policy.Request, error) { +func (client *NetworkDevicesClient) rebootCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, body RebootProperties, options *NetworkDevicesClientBeginRebootOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/reboot" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -690,40 +405,40 @@ func (client *NetworkDevicesClient) rebootCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil + return req, runtime.MarshalAsJSON(req, body) } -// BeginRestoreConfig - Restore the configuration of the Network Device resource to last known good configuration. +// BeginRefreshConfiguration - Refreshes the configuration the Network Device. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the NetworkDevice. -// - options - NetworkDevicesClientBeginRestoreConfigOptions contains the optional parameters for the NetworkDevicesClient.BeginRestoreConfig +// - networkDeviceName - Name of the Network Device. +// - options - NetworkDevicesClientBeginRefreshConfigurationOptions contains the optional parameters for the NetworkDevicesClient.BeginRefreshConfiguration // method. -func (client *NetworkDevicesClient) BeginRestoreConfig(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginRestoreConfigOptions) (*runtime.Poller[NetworkDevicesClientRestoreConfigResponse], error) { +func (client *NetworkDevicesClient) BeginRefreshConfiguration(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginRefreshConfigurationOptions) (*runtime.Poller[NetworkDevicesClientRefreshConfigurationResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.restoreConfig(ctx, resourceGroupName, networkDeviceName, options) + resp, err := client.refreshConfiguration(ctx, resourceGroupName, networkDeviceName, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientRestoreConfigResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientRefreshConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[NetworkDevicesClientRestoreConfigResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken[NetworkDevicesClientRefreshConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } -// RestoreConfig - Restore the configuration of the Network Device resource to last known good configuration. +// RefreshConfiguration - Refreshes the configuration the Network Device. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview -func (client *NetworkDevicesClient) restoreConfig(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginRestoreConfigOptions) (*http.Response, error) { - req, err := client.restoreConfigCreateRequest(ctx, resourceGroupName, networkDeviceName, options) +// Generated from API version 2023-06-15 +func (client *NetworkDevicesClient) refreshConfiguration(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginRefreshConfigurationOptions) (*http.Response, error) { + req, err := client.refreshConfigurationCreateRequest(ctx, resourceGroupName, networkDeviceName, options) if err != nil { return nil, err } @@ -731,18 +446,15 @@ func (client *NetworkDevicesClient) restoreConfig(ctx context.Context, resourceG if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil } -// restoreConfigCreateRequest creates the RestoreConfig request. -func (client *NetworkDevicesClient) restoreConfigCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginRestoreConfigOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/restoreConfig" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } +// refreshConfigurationCreateRequest creates the RefreshConfiguration request. +func (client *NetworkDevicesClient) refreshConfigurationCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginRefreshConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/refreshConfiguration" urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -757,7 +469,7 @@ func (client *NetworkDevicesClient) restoreConfigCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -766,9 +478,9 @@ func (client *NetworkDevicesClient) restoreConfigCreateRequest(ctx context.Conte // BeginUpdate - Update certain properties of the Network Device resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the Network Device +// - networkDeviceName - Name of the Network Device. // - body - Network Device properties to update. // - options - NetworkDevicesClientBeginUpdateOptions contains the optional parameters for the NetworkDevicesClient.BeginUpdate // method. @@ -789,7 +501,7 @@ func (client *NetworkDevicesClient) BeginUpdate(ctx context.Context, resourceGro // Update - Update certain properties of the Network Device resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *NetworkDevicesClient) update(ctx context.Context, resourceGroupName string, networkDeviceName string, body NetworkDevicePatchParameters, options *NetworkDevicesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, networkDeviceName, body, options) if err != nil { @@ -808,9 +520,6 @@ func (client *NetworkDevicesClient) update(ctx context.Context, resourceGroupNam // updateCreateRequest creates the Update request. func (client *NetworkDevicesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, body NetworkDevicePatchParameters, options *NetworkDevicesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -825,41 +534,41 @@ func (client *NetworkDevicesClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) } -// BeginUpdatePowerCycle - Update PDU power cycle of the Network Device. +// BeginUpdateAdministrativeState - Updates the Administrative state of the Network Device. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the NetworkDevice. +// - networkDeviceName - Name of the Network Device. // - body - Request payload. -// - options - NetworkDevicesClientBeginUpdatePowerCycleOptions contains the optional parameters for the NetworkDevicesClient.BeginUpdatePowerCycle +// - options - NetworkDevicesClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkDevicesClient.BeginUpdateAdministrativeState // method. -func (client *NetworkDevicesClient) BeginUpdatePowerCycle(ctx context.Context, resourceGroupName string, networkDeviceName string, body UpdatePowerCycleProperties, options *NetworkDevicesClientBeginUpdatePowerCycleOptions) (*runtime.Poller[NetworkDevicesClientUpdatePowerCycleResponse], error) { +func (client *NetworkDevicesClient) BeginUpdateAdministrativeState(ctx context.Context, resourceGroupName string, networkDeviceName string, body UpdateDeviceAdministrativeState, options *NetworkDevicesClientBeginUpdateAdministrativeStateOptions) (*runtime.Poller[NetworkDevicesClientUpdateAdministrativeStateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.updatePowerCycle(ctx, resourceGroupName, networkDeviceName, body, options) + resp, err := client.updateAdministrativeState(ctx, resourceGroupName, networkDeviceName, body, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientUpdatePowerCycleResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientUpdateAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[NetworkDevicesClientUpdatePowerCycleResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken[NetworkDevicesClientUpdateAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } -// UpdatePowerCycle - Update PDU power cycle of the Network Device. +// UpdateAdministrativeState - Updates the Administrative state of the Network Device. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview -func (client *NetworkDevicesClient) updatePowerCycle(ctx context.Context, resourceGroupName string, networkDeviceName string, body UpdatePowerCycleProperties, options *NetworkDevicesClientBeginUpdatePowerCycleOptions) (*http.Response, error) { - req, err := client.updatePowerCycleCreateRequest(ctx, resourceGroupName, networkDeviceName, body, options) +// Generated from API version 2023-06-15 +func (client *NetworkDevicesClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, networkDeviceName string, body UpdateDeviceAdministrativeState, options *NetworkDevicesClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { + req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, networkDeviceName, body, options) if err != nil { return nil, err } @@ -867,18 +576,15 @@ func (client *NetworkDevicesClient) updatePowerCycle(ctx context.Context, resour if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil } -// updatePowerCycleCreateRequest creates the UpdatePowerCycle request. -func (client *NetworkDevicesClient) updatePowerCycleCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, body UpdatePowerCycleProperties, options *NetworkDevicesClientBeginUpdatePowerCycleOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/updatePowerCycle" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } +// updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. +func (client *NetworkDevicesClient) updateAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, body UpdateDeviceAdministrativeState, options *NetworkDevicesClientBeginUpdateAdministrativeStateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/updateAdministrativeState" urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -893,41 +599,41 @@ func (client *NetworkDevicesClient) updatePowerCycleCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) } -// BeginUpdateVersion - Update the SKU version of the Network Device resource. +// BeginUpgrade - Upgrades the version of the Network Device. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the NetworkDevice. +// - networkDeviceName - Name of the Network Device. // - body - Request payload. -// - options - NetworkDevicesClientBeginUpdateVersionOptions contains the optional parameters for the NetworkDevicesClient.BeginUpdateVersion +// - options - NetworkDevicesClientBeginUpgradeOptions contains the optional parameters for the NetworkDevicesClient.BeginUpgrade // method. -func (client *NetworkDevicesClient) BeginUpdateVersion(ctx context.Context, resourceGroupName string, networkDeviceName string, body UpdateVersionProperties, options *NetworkDevicesClientBeginUpdateVersionOptions) (*runtime.Poller[NetworkDevicesClientUpdateVersionResponse], error) { +func (client *NetworkDevicesClient) BeginUpgrade(ctx context.Context, resourceGroupName string, networkDeviceName string, body UpdateVersion, options *NetworkDevicesClientBeginUpgradeOptions) (*runtime.Poller[NetworkDevicesClientUpgradeResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.updateVersion(ctx, resourceGroupName, networkDeviceName, body, options) + resp, err := client.upgrade(ctx, resourceGroupName, networkDeviceName, body, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientUpdateVersionResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientUpgradeResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[NetworkDevicesClientUpdateVersionResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken[NetworkDevicesClientUpgradeResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } -// UpdateVersion - Update the SKU version of the Network Device resource. +// Upgrade - Upgrades the version of the Network Device. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview -func (client *NetworkDevicesClient) updateVersion(ctx context.Context, resourceGroupName string, networkDeviceName string, body UpdateVersionProperties, options *NetworkDevicesClientBeginUpdateVersionOptions) (*http.Response, error) { - req, err := client.updateVersionCreateRequest(ctx, resourceGroupName, networkDeviceName, body, options) +// Generated from API version 2023-06-15 +func (client *NetworkDevicesClient) upgrade(ctx context.Context, resourceGroupName string, networkDeviceName string, body UpdateVersion, options *NetworkDevicesClientBeginUpgradeOptions) (*http.Response, error) { + req, err := client.upgradeCreateRequest(ctx, resourceGroupName, networkDeviceName, body, options) if err != nil { return nil, err } @@ -935,18 +641,15 @@ func (client *NetworkDevicesClient) updateVersion(ctx context.Context, resourceG if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil } -// updateVersionCreateRequest creates the UpdateVersion request. -func (client *NetworkDevicesClient) updateVersionCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, body UpdateVersionProperties, options *NetworkDevicesClientBeginUpdateVersionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/updateVersion" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } +// upgradeCreateRequest creates the Upgrade request. +func (client *NetworkDevicesClient) upgradeCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, body UpdateVersion, options *NetworkDevicesClientBeginUpgradeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/upgrade" urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -961,7 +664,7 @@ func (client *NetworkDevicesClient) updateVersionCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdevices_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdevices_client_example_test.go index 160b6c41a555..307b93eac7c3 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdevices_client_example_test.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdevices_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_Create_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Create_MaximumSet_Gen.json func ExampleNetworkDevicesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,17 +29,16 @@ func ExampleNetworkDevicesClient_BeginCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkDevicesClient().BeginCreate(ctx, "resourceGroupName", "networkDeviceName", armmanagednetworkfabric.NetworkDevice{ - Location: to.Ptr("eastus"), + poller, err := clientFactory.NewNetworkDevicesClient().BeginCreate(ctx, "example-rg", "example-device", armmanagednetworkfabric.NetworkDevice{ + Location: to.Ptr("eastuseuap"), Tags: map[string]*string{ - "keyID": to.Ptr("keyValue"), + "keyID": to.Ptr("KeyValue"), }, Properties: &armmanagednetworkfabric.NetworkDeviceProperties{ - Annotation: to.Ptr("null"), - HostName: to.Ptr("networkDeviceName"), - SerialNumber: to.Ptr("Arista;DCS-7280PR3-24;12.05;JPE21330382"), - NetworkDeviceRole: to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleTypesCE), - NetworkDeviceSKU: to.Ptr("DefaultSku"), + Annotation: to.Ptr("annotation"), + HostName: to.Ptr("NFA-Device"), + SerialNumber: to.Ptr("Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX"), + NetworkDeviceSKU: to.Ptr("DeviceSku"), }, }, nil) if err != nil { @@ -53,35 +52,39 @@ func ExampleNetworkDevicesClient_BeginCreate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkDevice = armmanagednetworkfabric.NetworkDevice{ - // Name: to.Ptr("networkDeviceName"), + // Name: to.Ptr("example-device"), // Type: to.Ptr("microsoft.managednetworkfabric/networkdevices"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-device"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T07:58:04.840Z"); return t}()), - // CreatedBy: to.Ptr("d1bd24c7-b27f-477e-86dd-939e107873d7"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T07:58:04.840Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), // LastModifiedBy: to.Ptr("email@address.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("eastus"), + // Location: to.Ptr("eastuseuap"), // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.NetworkDeviceProperties{ - // Annotation: to.Ptr("null"), - // HostName: to.Ptr("networkDeviceName"), - // SerialNumber: to.Ptr("Arista;DCS-7280PR3-24;12.05;JPE21330382"), - // NetworkDeviceRole: to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleTypesCE), - // NetworkDeviceSKU: to.Ptr("DefaultSku"), - // NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // Annotation: to.Ptr("annotation"), + // HostName: to.Ptr("NFA-Device"), + // SerialNumber: to.Ptr("Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ManagementIPv4Address: to.Ptr("10.10.10.10"), + // ManagementIPv6Address: to.Ptr("2F::1/100"), + // NetworkDeviceRole: to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleCE), + // NetworkDeviceSKU: to.Ptr("DeviceSku"), + // NetworkRackID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // Version: to.Ptr("null"), + // Version: to.Ptr("1.0"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_Get_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Get_MaximumSet_Gen.json func ExampleNetworkDevicesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -92,7 +95,7 @@ func ExampleNetworkDevicesClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewNetworkDevicesClient().Get(ctx, "resourceGroupName", "networkDeviceName", nil) + res, err := clientFactory.NewNetworkDevicesClient().Get(ctx, "example-rg", "example-device", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -100,35 +103,39 @@ func ExampleNetworkDevicesClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkDevice = armmanagednetworkfabric.NetworkDevice{ - // Name: to.Ptr("networkDeviceName"), + // Name: to.Ptr("example-device"), // Type: to.Ptr("microsoft.managednetworkfabric/networkdevices"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-device"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T07:58:04.840Z"); return t}()), - // CreatedBy: to.Ptr("d1bd24c7-b27f-477e-86dd-939e107873d7"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T07:58:04.840Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), // LastModifiedBy: to.Ptr("email@address.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("eastus"), + // Location: to.Ptr("eastuseuap"), // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.NetworkDeviceProperties{ - // Annotation: to.Ptr("null"), - // HostName: to.Ptr("networkDeviceName"), - // SerialNumber: to.Ptr("Arista;DCS-7280PR3-24;12.05;JPE21330382"), - // NetworkDeviceRole: to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleTypesCE), - // NetworkDeviceSKU: to.Ptr("DefaultSku"), - // NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // Annotation: to.Ptr("annotation"), + // HostName: to.Ptr("NFA-Device"), + // SerialNumber: to.Ptr("Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ManagementIPv4Address: to.Ptr("10.10.10.10"), + // ManagementIPv6Address: to.Ptr("2F::1/100"), + // NetworkDeviceRole: to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleCE), + // NetworkDeviceSKU: to.Ptr("DeviceSku"), + // NetworkRackID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // Version: to.Ptr("null"), + // Version: to.Ptr("1.0"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_Update_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Update_MaximumSet_Gen.json func ExampleNetworkDevicesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -139,14 +146,14 @@ func ExampleNetworkDevicesClient_BeginUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkDevicesClient().BeginUpdate(ctx, "resourceGroupName", "networkDeviceName", armmanagednetworkfabric.NetworkDevicePatchParameters{ - Properties: &armmanagednetworkfabric.NetworkDevicePatchParametersProperties{ - Annotation: to.Ptr("null"), - HostName: to.Ptr("networkDeviceName"), - SerialNumber: to.Ptr("Arista;DCS-7280PR3-24;12.05;JPE21330382"), - }, + poller, err := clientFactory.NewNetworkDevicesClient().BeginUpdate(ctx, "example-rg", "example-device", armmanagednetworkfabric.NetworkDevicePatchParameters{ Tags: map[string]*string{ - "keyID": to.Ptr("keyValue"), + "keyID": to.Ptr("KeyValue"), + }, + Properties: &armmanagednetworkfabric.NetworkDevicePatchParametersProperties{ + Annotation: to.Ptr("annotation"), + HostName: to.Ptr("NFA-Device"), + SerialNumber: to.Ptr("Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX"), }, }, nil) if err != nil { @@ -160,35 +167,39 @@ func ExampleNetworkDevicesClient_BeginUpdate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkDevice = armmanagednetworkfabric.NetworkDevice{ - // Name: to.Ptr("networkDeviceName"), + // Name: to.Ptr("example-device"), // Type: to.Ptr("microsoft.managednetworkfabric/networkdevices"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-device"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T07:58:04.840Z"); return t}()), - // CreatedBy: to.Ptr("d1bd24c7-b27f-477e-86dd-939e107873d7"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T07:58:04.840Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), // LastModifiedBy: to.Ptr("email@address.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("eastus"), + // Location: to.Ptr("eastuseuap"), // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.NetworkDeviceProperties{ - // Annotation: to.Ptr("null"), - // HostName: to.Ptr("networkDeviceName"), - // SerialNumber: to.Ptr("Arista;DCS-7280PR3-24;12.05;JPE21330382"), - // NetworkDeviceRole: to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleTypesCE), - // NetworkDeviceSKU: to.Ptr("DefaultSku"), - // NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // Annotation: to.Ptr("annotation"), + // HostName: to.Ptr("NFA-Device"), + // SerialNumber: to.Ptr("Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ManagementIPv4Address: to.Ptr("10.10.10.10"), + // ManagementIPv6Address: to.Ptr("2F::1/100"), + // NetworkDeviceRole: to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleCE), + // NetworkDeviceSKU: to.Ptr("DeviceSku"), + // NetworkRackID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // Version: to.Ptr("null"), + // Version: to.Ptr("1.0"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_Delete_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Delete_MaximumSet_Gen.json func ExampleNetworkDevicesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -199,7 +210,7 @@ func ExampleNetworkDevicesClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkDevicesClient().BeginDelete(ctx, "resourceGroupName", "networkDeviceName", nil) + poller, err := clientFactory.NewNetworkDevicesClient().BeginDelete(ctx, "example-rg", "example-device", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -209,7 +220,7 @@ func ExampleNetworkDevicesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_ListByResourceGroup_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_ListByResourceGroup_MaximumSet_Gen.json func ExampleNetworkDevicesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -220,7 +231,7 @@ func ExampleNetworkDevicesClient_NewListByResourceGroupPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewNetworkDevicesClient().NewListByResourceGroupPager("resourceGroupName", nil) + pager := clientFactory.NewNetworkDevicesClient().NewListByResourceGroupPager("example-rg", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -234,37 +245,41 @@ func ExampleNetworkDevicesClient_NewListByResourceGroupPager() { // page.NetworkDevicesListResult = armmanagednetworkfabric.NetworkDevicesListResult{ // Value: []*armmanagednetworkfabric.NetworkDevice{ // { - // Name: to.Ptr("networkDeviceName"), + // Name: to.Ptr("example-device"), // Type: to.Ptr("microsoft.managednetworkfabric/networkdevices"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-device"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T07:58:04.840Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T07:58:04.840Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), // LastModifiedBy: to.Ptr("email@address.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("eastus"), + // Location: to.Ptr("eastuseuap"), // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.NetworkDeviceProperties{ - // Annotation: to.Ptr("null"), - // HostName: to.Ptr("networkDeviceName"), - // SerialNumber: to.Ptr("Arista;DCS-7280PR3-24;12.05;JPE21330382"), - // NetworkDeviceRole: to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleTypesCE), - // NetworkDeviceSKU: to.Ptr("DefaultSku"), - // NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // Annotation: to.Ptr("annotation"), + // HostName: to.Ptr("NFA-Device"), + // SerialNumber: to.Ptr("Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ManagementIPv4Address: to.Ptr("10.10.10.10"), + // ManagementIPv6Address: to.Ptr("2F::1/100"), + // NetworkDeviceRole: to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleCE), + // NetworkDeviceSKU: to.Ptr("DeviceSku"), + // NetworkRackID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // Version: to.Ptr("null"), + // Version: to.Ptr("1.0"), // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_ListBySubscription_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_ListBySubscription_MaximumSet_Gen.json func ExampleNetworkDevicesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -289,37 +304,41 @@ func ExampleNetworkDevicesClient_NewListBySubscriptionPager() { // page.NetworkDevicesListResult = armmanagednetworkfabric.NetworkDevicesListResult{ // Value: []*armmanagednetworkfabric.NetworkDevice{ // { - // Name: to.Ptr("networkDeviceName"), + // Name: to.Ptr("example-device"), // Type: to.Ptr("microsoft.managednetworkfabric/networkdevices"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-device"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T07:58:04.840Z"); return t}()), - // CreatedBy: to.Ptr("d1bd24c7-b27f-477e-86dd-939e107873d7"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T07:58:04.840Z"); return t}()), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), // LastModifiedBy: to.Ptr("email@address.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("eastus"), + // Location: to.Ptr("eastuseuap"), // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.NetworkDeviceProperties{ - // Annotation: to.Ptr("null"), - // HostName: to.Ptr("networkDeviceName"), - // SerialNumber: to.Ptr("Arista;DCS-7280PR3-24;12.05;JPE21330382"), - // NetworkDeviceRole: to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleTypesCE), - // NetworkDeviceSKU: to.Ptr("DefaultSku"), - // NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // Annotation: to.Ptr("annotation"), + // HostName: to.Ptr("NFA-Device"), + // SerialNumber: to.Ptr("Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // ManagementIPv4Address: to.Ptr("10.10.10.10"), + // ManagementIPv6Address: to.Ptr("2F::1/100"), + // NetworkDeviceRole: to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleCE), + // NetworkDeviceSKU: to.Ptr("DeviceSku"), + // NetworkRackID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // Version: to.Ptr("null"), + // Version: to.Ptr("1.0"), // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_reboot_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Reboot_MaximumSet_Gen.json func ExampleNetworkDevicesClient_BeginReboot() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -330,62 +349,39 @@ func ExampleNetworkDevicesClient_BeginReboot() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkDevicesClient().BeginReboot(ctx, "resourceGroupName", "networkDeviceName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_restoreConfig_MaximumSet_Gen.json -func ExampleNetworkDevicesClient_BeginRestoreConfig() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkDevicesClient().BeginRestoreConfig(ctx, "resourceGroupName", "networkDeviceName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_updateVersion_MaximumSet_Gen.json -func ExampleNetworkDevicesClient_BeginUpdateVersion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkDevicesClient().BeginUpdateVersion(ctx, "resourceGroupName", "networkDeviceName", armmanagednetworkfabric.UpdateVersionProperties{ - SKUVersion: to.Ptr("DefaultSku"), + poller, err := clientFactory.NewNetworkDevicesClient().BeginReboot(ctx, "example-rg", "example-device", armmanagednetworkfabric.RebootProperties{ + RebootType: to.Ptr(armmanagednetworkfabric.RebootTypeGracefulRebootWithZTP), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_generateSupportPackage_MaximumSet_Gen.json -func ExampleNetworkDevicesClient_BeginGenerateSupportPackage() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_RefreshConfiguration_MaximumSet_Gen.json +func ExampleNetworkDevicesClient_BeginRefreshConfiguration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -395,18 +391,37 @@ func ExampleNetworkDevicesClient_BeginGenerateSupportPackage() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkDevicesClient().BeginGenerateSupportPackage(ctx, "resourceGroupName", "networkDeviceName", nil) + poller, err := clientFactory.NewNetworkDevicesClient().BeginRefreshConfiguration(ctx, "example-rg", "example-device", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_updatePowerCycle_MaximumSet_Gen.json -func ExampleNetworkDevicesClient_BeginUpdatePowerCycle() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_UpdateAdministrativeState_MaximumSet_Gen.json +func ExampleNetworkDevicesClient_BeginUpdateAdministrativeState() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -416,63 +431,41 @@ func ExampleNetworkDevicesClient_BeginUpdatePowerCycle() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkDevicesClient().BeginUpdatePowerCycle(ctx, "resourceGroupName", "networkDeviceName", armmanagednetworkfabric.UpdatePowerCycleProperties{ - PowerEnd: to.Ptr(armmanagednetworkfabric.PowerEndPrimary), - State: to.Ptr(armmanagednetworkfabric.StateOn), + poller, err := clientFactory.NewNetworkDevicesClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-device", armmanagednetworkfabric.UpdateDeviceAdministrativeState{ + ResourceIDs: []*string{ + to.Ptr("")}, + State: to.Ptr(armmanagednetworkfabric.DeviceAdministrativeStateRMA), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_getStatus_MaximumSet_Gen.json -func ExampleNetworkDevicesClient_BeginGetStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkDevicesClient().BeginGetStatus(ctx, "resourceGroupName", "networkDeviceName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_getStaticInterfaceMaps_MaximumSet_Gen.json -func ExampleNetworkDevicesClient_BeginGetStaticInterfaceMaps() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkDevicesClient().BeginGetStaticInterfaceMaps(ctx, "resourceGroupName", "networkDeviceName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_getDynamicInterfaceMaps_MaximumSet_Gen.json -func ExampleNetworkDevicesClient_BeginGetDynamicInterfaceMaps() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Upgrade_MaximumSet_Gen.json +func ExampleNetworkDevicesClient_BeginUpgrade() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -482,12 +475,33 @@ func ExampleNetworkDevicesClient_BeginGetDynamicInterfaceMaps() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkDevicesClient().BeginGetDynamicInterfaceMaps(ctx, "resourceGroupName", "networkDeviceName", nil) + poller, err := clientFactory.NewNetworkDevicesClient().BeginUpgrade(ctx, "example-rg", "example-device", armmanagednetworkfabric.UpdateVersion{ + Version: to.Ptr("1.0.0"), + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdeviceskus_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdeviceskus_client.go index 3eb73a8669b6..a0baa1e40e80 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdeviceskus_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdeviceskus_client.go @@ -29,7 +29,7 @@ type NetworkDeviceSKUsClient struct { } // NewNetworkDeviceSKUsClient creates a new instance of NetworkDeviceSKUsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewNetworkDeviceSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkDeviceSKUsClient, error) { @@ -44,11 +44,11 @@ func NewNetworkDeviceSKUsClient(subscriptionID string, credential azcore.TokenCr return client, nil } -// Get - Get Network Device SKU details. +// Get - Get a Network Device SKU details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview -// - networkDeviceSKUName - Name of the Network Device Sku +// Generated from API version 2023-06-15 +// - networkDeviceSKUName - Name of the Network Device SKU. // - options - NetworkDeviceSKUsClientGetOptions contains the optional parameters for the NetworkDeviceSKUsClient.Get method. func (client *NetworkDeviceSKUsClient) Get(ctx context.Context, networkDeviceSKUName string, options *NetworkDeviceSKUsClientGetOptions) (NetworkDeviceSKUsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, networkDeviceSKUName, options) @@ -68,9 +68,6 @@ func (client *NetworkDeviceSKUsClient) Get(ctx context.Context, networkDeviceSKU // getCreateRequest creates the Get request. func (client *NetworkDeviceSKUsClient) getCreateRequest(ctx context.Context, networkDeviceSKUName string, options *NetworkDeviceSKUsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus/{networkDeviceSkuName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if networkDeviceSKUName == "" { return nil, errors.New("parameter networkDeviceSKUName cannot be empty") @@ -81,7 +78,7 @@ func (client *NetworkDeviceSKUsClient) getCreateRequest(ctx context.Context, net return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -98,7 +95,7 @@ func (client *NetworkDeviceSKUsClient) getHandleResponse(resp *http.Response) (N // NewListBySubscriptionPager - List Network Device SKUs for the given subscription. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - options - NetworkDeviceSKUsClientListBySubscriptionOptions contains the optional parameters for the NetworkDeviceSKUsClient.NewListBySubscriptionPager // method. func (client *NetworkDeviceSKUsClient) NewListBySubscriptionPager(options *NetworkDeviceSKUsClientListBySubscriptionOptions) *runtime.Pager[NetworkDeviceSKUsClientListBySubscriptionResponse] { @@ -132,16 +129,13 @@ func (client *NetworkDeviceSKUsClient) NewListBySubscriptionPager(options *Netwo // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *NetworkDeviceSKUsClient) listBySubscriptionCreateRequest(ctx context.Context, options *NetworkDeviceSKUsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdeviceskus_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdeviceskus_client_example_test.go index 40bd3581a88c..ae159d459675 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdeviceskus_client_example_test.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdeviceskus_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDeviceSkus_Get_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDeviceSkus_Get_MaximumSet_Gen.json func ExampleNetworkDeviceSKUsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -28,7 +28,7 @@ func ExampleNetworkDeviceSKUsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewNetworkDeviceSKUsClient().Get(ctx, "DefaultSku", nil) + res, err := clientFactory.NewNetworkDeviceSKUsClient().Get(ctx, "example-deviceSku", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -36,53 +36,45 @@ func ExampleNetworkDeviceSKUsClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkDeviceSKU = armmanagednetworkfabric.NetworkDeviceSKU{ - // ID: to.Ptr("resourceId"), + // Name: to.Ptr("example-deviceSku"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkDeviceSkus"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus/example-deviceSku"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:55:43.467Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:55:43.467Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, // Properties: &armmanagednetworkfabric.NetworkDeviceSKUProperties{ // Interfaces: []*armmanagednetworkfabric.DeviceInterfaceProperties{ // { - // Identifier: to.Ptr("1"), - // InterfaceType: to.Ptr("Ethernet"), + // Identifier: to.Ptr("HundredGigE0/0"), + // InterfaceType: to.Ptr("type1"), // SupportedConnectorTypes: []*armmanagednetworkfabric.SupportedConnectorProperties{ // { - // ConnectorType: to.Ptr("10GBASE-LRL"), - // MaxSpeedInMbps: to.Ptr[int32](10240), - // }}, - // }, - // { - // Identifier: to.Ptr("2"), - // InterfaceType: to.Ptr("Ethernet"), - // SupportedConnectorTypes: []*armmanagednetworkfabric.SupportedConnectorProperties{ - // { - // ConnectorType: to.Ptr("10GBASE-LRL"), - // MaxSpeedInMbps: to.Ptr[int32](10240), + // ConnectorType: to.Ptr("Optical"), + // MaxSpeedInMbps: to.Ptr[int32](100), // }}, // }}, - // Limits: &armmanagednetworkfabric.DeviceLimits{ - // MaxBidirectionalForwardingDetectionPeers: to.Ptr[int32](0), - // MaxBorderGatewayProtocolPeers: to.Ptr[int32](0), - // MaxSubInterfaces: to.Ptr[int32](0), - // MaxTunnelInterfaces: to.Ptr[int32](0), - // MaxVirtualRouterFunctions: to.Ptr[int32](0), - // PhysicalInterfaceCount: to.Ptr[int32](2), - // }, // Manufacturer: to.Ptr("Arista"), - // Model: to.Ptr("DCS-7280DR3A-36-F"), + // Model: to.Ptr("model1"), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // SupportedRoleTypes: []*armmanagednetworkfabric.NetworkDeviceRoleName{ - // to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleNameCE), - // to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleNameToR)}, + // to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleNameCE)}, // SupportedVersions: []*armmanagednetworkfabric.SupportedVersionProperties{ // { - // IsCurrent: to.Ptr(armmanagednetworkfabric.IsCurrentVersionTrue), - // IsTest: to.Ptr(armmanagednetworkfabric.IsTestVersionFalse), - // VendorFirmwareVersion: to.Ptr("1.1.2"), - // VendorOsVersion: to.Ptr("4.22.2"), - // Version: to.Ptr("4.22.2,1.1.2"), + // IsDefault: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), + // VendorFirmwareVersion: to.Ptr("11.2"), + // VendorOsVersion: to.Ptr("2.0"), + // Version: to.Ptr("1.0.0"), // }}, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDeviceSkus_ListBySubscription_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDeviceSkus_ListBySubscription_MaximumSet_Gen.json func ExampleNetworkDeviceSKUsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -107,241 +99,42 @@ func ExampleNetworkDeviceSKUsClient_NewListBySubscriptionPager() { // page.NetworkDeviceSKUsListResult = armmanagednetworkfabric.NetworkDeviceSKUsListResult{ // Value: []*armmanagednetworkfabric.NetworkDeviceSKU{ // { - // Name: to.Ptr("A-DCS-7280DR3A-36-F"), - // Type: to.Ptr("NetworkDeviceSkus"), - // ID: to.Ptr("A-DCS-7280DR3A-36-F"), + // Name: to.Ptr("example-deviceSku"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkDeviceSkus"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus/example-deviceSku"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-04T13:05:13.867Z"); return t}()), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:55:43.467Z"); return t}()), // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-04T13:05:13.867Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:55:43.467Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Properties: &armmanagednetworkfabric.NetworkDeviceSKUProperties{ // Interfaces: []*armmanagednetworkfabric.DeviceInterfaceProperties{ // { - // Identifier: to.Ptr("1"), - // InterfaceType: to.Ptr("Ethernet"), + // Identifier: to.Ptr("HundredGigE0/0"), + // InterfaceType: to.Ptr("type1"), // SupportedConnectorTypes: []*armmanagednetworkfabric.SupportedConnectorProperties{ // { - // ConnectorType: to.Ptr("10GBASE-LRL"), - // MaxSpeedInMbps: to.Ptr[int32](10240), - // }}, - // }, - // { - // Identifier: to.Ptr("2"), - // InterfaceType: to.Ptr("Ethernet"), - // SupportedConnectorTypes: []*armmanagednetworkfabric.SupportedConnectorProperties{ - // { - // ConnectorType: to.Ptr("10GBASE-LRL"), - // MaxSpeedInMbps: to.Ptr[int32](10240), + // ConnectorType: to.Ptr("Optical"), + // MaxSpeedInMbps: to.Ptr[int32](100), // }}, // }}, - // Limits: &armmanagednetworkfabric.DeviceLimits{ - // MaxBidirectionalForwardingDetectionPeers: to.Ptr[int32](0), - // MaxBorderGatewayProtocolPeers: to.Ptr[int32](0), - // MaxSubInterfaces: to.Ptr[int32](0), - // MaxTunnelInterfaces: to.Ptr[int32](0), - // MaxVirtualRouterFunctions: to.Ptr[int32](0), - // PhysicalInterfaceCount: to.Ptr[int32](2), - // }, // Manufacturer: to.Ptr("Arista"), - // Model: to.Ptr("DCS-7280DR3A-36-F"), + // Model: to.Ptr("model1"), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // SupportedRoleTypes: []*armmanagednetworkfabric.NetworkDeviceRoleName{ - // to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleNameCE), - // to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleNameToR)}, + // to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleNameCE)}, // SupportedVersions: []*armmanagednetworkfabric.SupportedVersionProperties{ // { - // IsCurrent: to.Ptr(armmanagednetworkfabric.IsCurrentVersionTrue), - // IsTest: to.Ptr(armmanagednetworkfabric.IsTestVersionFalse), - // VendorFirmwareVersion: to.Ptr("1.1.2"), - // VendorOsVersion: to.Ptr("4.22.2"), - // Version: to.Ptr("4.22.2,1.1.2"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("A-DCS-7280DR3K-24-F"), - // Type: to.Ptr("NetworkDeviceSkus"), - // ID: to.Ptr("A-DCS-7280DR3K-24-F"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-04T13:05:13.867Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-04T13:05:13.867Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // }, - // Properties: &armmanagednetworkfabric.NetworkDeviceSKUProperties{ - // Interfaces: []*armmanagednetworkfabric.DeviceInterfaceProperties{ - // { - // Identifier: to.Ptr(""), - // InterfaceType: to.Ptr(""), - // SupportedConnectorTypes: []*armmanagednetworkfabric.SupportedConnectorProperties{ - // { - // ConnectorType: to.Ptr(""), - // MaxSpeedInMbps: to.Ptr[int32](0), - // }}, + // IsDefault: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), + // VendorFirmwareVersion: to.Ptr("11.2"), + // VendorOsVersion: to.Ptr("2.0"), + // Version: to.Ptr("1.0.0"), // }}, - // Limits: &armmanagednetworkfabric.DeviceLimits{ - // MaxBidirectionalForwardingDetectionPeers: to.Ptr[int32](0), - // MaxBorderGatewayProtocolPeers: to.Ptr[int32](0), - // MaxSubInterfaces: to.Ptr[int32](0), - // MaxTunnelInterfaces: to.Ptr[int32](0), - // MaxVirtualRouterFunctions: to.Ptr[int32](0), - // PhysicalInterfaceCount: to.Ptr[int32](0), - // }, - // Manufacturer: to.Ptr("Arista"), - // Model: to.Ptr("DCS-7280DR3K-24-F"), - // SupportedRoleTypes: []*armmanagednetworkfabric.NetworkDeviceRoleName{ - // to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleNameNPB)}, - // SupportedVersions: []*armmanagednetworkfabric.SupportedVersionProperties{ - // { - // IsCurrent: to.Ptr(armmanagednetworkfabric.IsCurrentVersionTrue), - // IsTest: to.Ptr(armmanagednetworkfabric.IsTestVersionFalse), - // VendorFirmwareVersion: to.Ptr(""), - // VendorOsVersion: to.Ptr(""), - // Version: to.Ptr(""), - // }}, - // }, // }, - // { - // Name: to.Ptr("O-OM2248-10G-US"), - // Type: to.Ptr("NetworkDeviceSkus"), - // ID: to.Ptr("O-OM2248-10G-US"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-04T13:05:13.867Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-04T13:05:13.867Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // }, - // Properties: &armmanagednetworkfabric.NetworkDeviceSKUProperties{ - // Interfaces: []*armmanagednetworkfabric.DeviceInterfaceProperties{ - // { - // Identifier: to.Ptr(""), - // InterfaceType: to.Ptr(""), - // SupportedConnectorTypes: []*armmanagednetworkfabric.SupportedConnectorProperties{ - // { - // ConnectorType: to.Ptr(""), - // MaxSpeedInMbps: to.Ptr[int32](0), - // }}, - // }}, - // Limits: &armmanagednetworkfabric.DeviceLimits{ - // MaxBidirectionalForwardingDetectionPeers: to.Ptr[int32](0), - // MaxBorderGatewayProtocolPeers: to.Ptr[int32](0), - // MaxSubInterfaces: to.Ptr[int32](0), - // MaxTunnelInterfaces: to.Ptr[int32](0), - // MaxVirtualRouterFunctions: to.Ptr[int32](0), - // PhysicalInterfaceCount: to.Ptr[int32](0), - // }, - // Manufacturer: to.Ptr("OpenGear"), - // Model: to.Ptr("OM2248-10G-US"), - // SupportedRoleTypes: []*armmanagednetworkfabric.NetworkDeviceRoleName{ - // to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleNameTS)}, - // SupportedVersions: []*armmanagednetworkfabric.SupportedVersionProperties{ - // { - // IsCurrent: to.Ptr(armmanagednetworkfabric.IsCurrentVersionTrue), - // IsTest: to.Ptr(armmanagednetworkfabric.IsTestVersionFalse), - // VendorFirmwareVersion: to.Ptr(""), - // VendorOsVersion: to.Ptr(""), - // Version: to.Ptr(""), - // }}, - // }, - // }, - // { - // Name: to.Ptr("A-DCS-7010TX-48-F"), - // Type: to.Ptr("NetworkDeviceSkus"), - // ID: to.Ptr("A-DCS-7010TX-48-F"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-04T13:05:13.867Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-04T13:05:13.867Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // }, - // Properties: &armmanagednetworkfabric.NetworkDeviceSKUProperties{ - // Interfaces: []*armmanagednetworkfabric.DeviceInterfaceProperties{ - // { - // Identifier: to.Ptr(""), - // InterfaceType: to.Ptr(""), - // SupportedConnectorTypes: []*armmanagednetworkfabric.SupportedConnectorProperties{ - // { - // ConnectorType: to.Ptr(""), - // MaxSpeedInMbps: to.Ptr[int32](0), - // }}, - // }}, - // Limits: &armmanagednetworkfabric.DeviceLimits{ - // MaxBidirectionalForwardingDetectionPeers: to.Ptr[int32](0), - // MaxBorderGatewayProtocolPeers: to.Ptr[int32](0), - // MaxSubInterfaces: to.Ptr[int32](0), - // MaxTunnelInterfaces: to.Ptr[int32](0), - // MaxVirtualRouterFunctions: to.Ptr[int32](0), - // PhysicalInterfaceCount: to.Ptr[int32](0), - // }, - // Manufacturer: to.Ptr("Arista"), - // Model: to.Ptr("DCS-7010TX-48-F"), - // SupportedRoleTypes: []*armmanagednetworkfabric.NetworkDeviceRoleName{ - // to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleNameManagement)}, - // SupportedVersions: []*armmanagednetworkfabric.SupportedVersionProperties{ - // { - // IsCurrent: to.Ptr(armmanagednetworkfabric.IsCurrentVersionTrue), - // IsTest: to.Ptr(armmanagednetworkfabric.IsTestVersionFalse), - // VendorFirmwareVersion: to.Ptr(""), - // VendorOsVersion: to.Ptr(""), - // Version: to.Ptr(""), - // }}, - // }, - // }, - // { - // Name: to.Ptr("A-DCS-7280DR3-24-F"), - // Type: to.Ptr("NetworkDeviceSkus"), - // ID: to.Ptr("A-DCS-7280DR3-24-F"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-04T13:05:13.867Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-04T13:05:13.867Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // }, - // Properties: &armmanagednetworkfabric.NetworkDeviceSKUProperties{ - // Interfaces: []*armmanagednetworkfabric.DeviceInterfaceProperties{ - // { - // Identifier: to.Ptr(""), - // InterfaceType: to.Ptr(""), - // SupportedConnectorTypes: []*armmanagednetworkfabric.SupportedConnectorProperties{ - // { - // ConnectorType: to.Ptr(""), - // MaxSpeedInMbps: to.Ptr[int32](0), - // }}, - // }}, - // Limits: &armmanagednetworkfabric.DeviceLimits{ - // MaxBidirectionalForwardingDetectionPeers: to.Ptr[int32](0), - // MaxBorderGatewayProtocolPeers: to.Ptr[int32](0), - // MaxSubInterfaces: to.Ptr[int32](0), - // MaxTunnelInterfaces: to.Ptr[int32](0), - // MaxVirtualRouterFunctions: to.Ptr[int32](0), - // PhysicalInterfaceCount: to.Ptr[int32](0), - // }, - // Manufacturer: to.Ptr("Arista"), - // Model: to.Ptr("DCS-7280DR3-24-F"), - // SupportedRoleTypes: []*armmanagednetworkfabric.NetworkDeviceRoleName{ - // to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleNameCE), - // to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleNameToR)}, - // SupportedVersions: []*armmanagednetworkfabric.SupportedVersionProperties{ - // { - // IsCurrent: to.Ptr(armmanagednetworkfabric.IsCurrentVersionTrue), - // IsTest: to.Ptr(armmanagednetworkfabric.IsTestVersionFalse), - // VendorFirmwareVersion: to.Ptr(""), - // VendorOsVersion: to.Ptr(""), - // Version: to.Ptr(""), - // }}, - // }, - // }}, - // } + // }}, + // } } } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabriccontrollers_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabriccontrollers_client.go index ee4c37796bcc..52bb32ccbc57 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabriccontrollers_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabriccontrollers_client.go @@ -29,7 +29,7 @@ type NetworkFabricControllersClient struct { } // NewNetworkFabricControllersClient creates a new instance of NetworkFabricControllersClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewNetworkFabricControllersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkFabricControllersClient, error) { @@ -47,9 +47,9 @@ func NewNetworkFabricControllersClient(subscriptionID string, credential azcore. // BeginCreate - Creates a Network Fabric Controller. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkFabricControllerName - Name of the Network Fabric Controller +// - networkFabricControllerName - Name of the Network Fabric Controller. // - body - Request payload. // - options - NetworkFabricControllersClientBeginCreateOptions contains the optional parameters for the NetworkFabricControllersClient.BeginCreate // method. @@ -70,7 +70,7 @@ func (client *NetworkFabricControllersClient) BeginCreate(ctx context.Context, r // Create - Creates a Network Fabric Controller. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *NetworkFabricControllersClient) create(ctx context.Context, resourceGroupName string, networkFabricControllerName string, body NetworkFabricController, options *NetworkFabricControllersClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, networkFabricControllerName, body, options) if err != nil { @@ -89,9 +89,6 @@ func (client *NetworkFabricControllersClient) create(ctx context.Context, resour // createCreateRequest creates the Create request. func (client *NetworkFabricControllersClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkFabricControllerName string, body NetworkFabricController, options *NetworkFabricControllersClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -106,7 +103,7 @@ func (client *NetworkFabricControllersClient) createCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -115,9 +112,9 @@ func (client *NetworkFabricControllersClient) createCreateRequest(ctx context.Co // BeginDelete - Deletes the Network Fabric Controller resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkFabricControllerName - Name of the Network Fabric Controller +// - networkFabricControllerName - Name of the Network Fabric Controller. // - options - NetworkFabricControllersClientBeginDeleteOptions contains the optional parameters for the NetworkFabricControllersClient.BeginDelete // method. func (client *NetworkFabricControllersClient) BeginDelete(ctx context.Context, resourceGroupName string, networkFabricControllerName string, options *NetworkFabricControllersClientBeginDeleteOptions) (*runtime.Poller[NetworkFabricControllersClientDeleteResponse], error) { @@ -137,7 +134,7 @@ func (client *NetworkFabricControllersClient) BeginDelete(ctx context.Context, r // Delete - Deletes the Network Fabric Controller resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *NetworkFabricControllersClient) deleteOperation(ctx context.Context, resourceGroupName string, networkFabricControllerName string, options *NetworkFabricControllersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkFabricControllerName, options) if err != nil { @@ -147,7 +144,7 @@ func (client *NetworkFabricControllersClient) deleteOperation(ctx context.Contex if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -156,9 +153,6 @@ func (client *NetworkFabricControllersClient) deleteOperation(ctx context.Contex // deleteCreateRequest creates the Delete request. func (client *NetworkFabricControllersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkFabricControllerName string, options *NetworkFabricControllersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -173,141 +167,7 @@ func (client *NetworkFabricControllersClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDisableWorkloadManagementNetwork - Disables the workloadManagementNetwork (Tenant Network). -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkFabricControllerName - Name of the networkFabricController. -// - options - NetworkFabricControllersClientBeginDisableWorkloadManagementNetworkOptions contains the optional parameters for -// the NetworkFabricControllersClient.BeginDisableWorkloadManagementNetwork method. -func (client *NetworkFabricControllersClient) BeginDisableWorkloadManagementNetwork(ctx context.Context, resourceGroupName string, networkFabricControllerName string, options *NetworkFabricControllersClientBeginDisableWorkloadManagementNetworkOptions) (*runtime.Poller[NetworkFabricControllersClientDisableWorkloadManagementNetworkResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.disableWorkloadManagementNetwork(ctx, resourceGroupName, networkFabricControllerName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricControllersClientDisableWorkloadManagementNetworkResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[NetworkFabricControllersClientDisableWorkloadManagementNetworkResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// DisableWorkloadManagementNetwork - Disables the workloadManagementNetwork (Tenant Network). -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -func (client *NetworkFabricControllersClient) disableWorkloadManagementNetwork(ctx context.Context, resourceGroupName string, networkFabricControllerName string, options *NetworkFabricControllersClientBeginDisableWorkloadManagementNetworkOptions) (*http.Response, error) { - req, err := client.disableWorkloadManagementNetworkCreateRequest(ctx, resourceGroupName, networkFabricControllerName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// disableWorkloadManagementNetworkCreateRequest creates the DisableWorkloadManagementNetwork request. -func (client *NetworkFabricControllersClient) disableWorkloadManagementNetworkCreateRequest(ctx context.Context, resourceGroupName string, networkFabricControllerName string, options *NetworkFabricControllersClientBeginDisableWorkloadManagementNetworkOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}/disableWorkloadManagementNetwork" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkFabricControllerName == "" { - return nil, errors.New("parameter networkFabricControllerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkFabricControllerName}", url.PathEscape(networkFabricControllerName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginEnableWorkloadManagementNetwork - Enables the workloadManagementNetwork (Tenant Network). -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkFabricControllerName - Name of the networkFabricController. -// - options - NetworkFabricControllersClientBeginEnableWorkloadManagementNetworkOptions contains the optional parameters for -// the NetworkFabricControllersClient.BeginEnableWorkloadManagementNetwork method. -func (client *NetworkFabricControllersClient) BeginEnableWorkloadManagementNetwork(ctx context.Context, resourceGroupName string, networkFabricControllerName string, options *NetworkFabricControllersClientBeginEnableWorkloadManagementNetworkOptions) (*runtime.Poller[NetworkFabricControllersClientEnableWorkloadManagementNetworkResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.enableWorkloadManagementNetwork(ctx, resourceGroupName, networkFabricControllerName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricControllersClientEnableWorkloadManagementNetworkResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[NetworkFabricControllersClientEnableWorkloadManagementNetworkResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// EnableWorkloadManagementNetwork - Enables the workloadManagementNetwork (Tenant Network). -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -func (client *NetworkFabricControllersClient) enableWorkloadManagementNetwork(ctx context.Context, resourceGroupName string, networkFabricControllerName string, options *NetworkFabricControllersClientBeginEnableWorkloadManagementNetworkOptions) (*http.Response, error) { - req, err := client.enableWorkloadManagementNetworkCreateRequest(ctx, resourceGroupName, networkFabricControllerName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// enableWorkloadManagementNetworkCreateRequest creates the EnableWorkloadManagementNetwork request. -func (client *NetworkFabricControllersClient) enableWorkloadManagementNetworkCreateRequest(ctx context.Context, resourceGroupName string, networkFabricControllerName string, options *NetworkFabricControllersClientBeginEnableWorkloadManagementNetworkOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}/enableWorkloadManagementNetwork" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkFabricControllerName == "" { - return nil, errors.New("parameter networkFabricControllerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkFabricControllerName}", url.PathEscape(networkFabricControllerName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -316,9 +176,9 @@ func (client *NetworkFabricControllersClient) enableWorkloadManagementNetworkCre // Get - Shows the provisioning status of Network Fabric Controller. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkFabricControllerName - Name of the Network Fabric Controller +// - networkFabricControllerName - Name of the Network Fabric Controller. // - options - NetworkFabricControllersClientGetOptions contains the optional parameters for the NetworkFabricControllersClient.Get // method. func (client *NetworkFabricControllersClient) Get(ctx context.Context, resourceGroupName string, networkFabricControllerName string, options *NetworkFabricControllersClientGetOptions) (NetworkFabricControllersClientGetResponse, error) { @@ -339,9 +199,6 @@ func (client *NetworkFabricControllersClient) Get(ctx context.Context, resourceG // getCreateRequest creates the Get request. func (client *NetworkFabricControllersClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkFabricControllerName string, options *NetworkFabricControllersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -356,7 +213,7 @@ func (client *NetworkFabricControllersClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -373,7 +230,7 @@ func (client *NetworkFabricControllersClient) getHandleResponse(resp *http.Respo // NewListByResourceGroupPager - Lists all the NetworkFabricControllers thats available in the resource group. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - NetworkFabricControllersClientListByResourceGroupOptions contains the optional parameters for the NetworkFabricControllersClient.NewListByResourceGroupPager // method. @@ -408,9 +265,6 @@ func (client *NetworkFabricControllersClient) NewListByResourceGroupPager(resour // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *NetworkFabricControllersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *NetworkFabricControllersClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -421,7 +275,7 @@ func (client *NetworkFabricControllersClient) listByResourceGroupCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -438,7 +292,7 @@ func (client *NetworkFabricControllersClient) listByResourceGroupHandleResponse( // NewListBySubscriptionPager - Lists all the NetworkFabricControllers by subscription. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - options - NetworkFabricControllersClientListBySubscriptionOptions contains the optional parameters for the NetworkFabricControllersClient.NewListBySubscriptionPager // method. func (client *NetworkFabricControllersClient) NewListBySubscriptionPager(options *NetworkFabricControllersClientListBySubscriptionOptions) *runtime.Pager[NetworkFabricControllersClientListBySubscriptionResponse] { @@ -472,16 +326,13 @@ func (client *NetworkFabricControllersClient) NewListBySubscriptionPager(options // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *NetworkFabricControllersClient) listBySubscriptionCreateRequest(ctx context.Context, options *NetworkFabricControllersClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -499,9 +350,9 @@ func (client *NetworkFabricControllersClient) listBySubscriptionHandleResponse(r // BeginUpdate - Updates are currently not supported for the Network Fabric Controller resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkFabricControllerName - Name of the Network Fabric Controller +// - networkFabricControllerName - Name of the Network Fabric Controller. // - body - Network Fabric Controller properties to update. // - options - NetworkFabricControllersClientBeginUpdateOptions contains the optional parameters for the NetworkFabricControllersClient.BeginUpdate // method. @@ -522,7 +373,7 @@ func (client *NetworkFabricControllersClient) BeginUpdate(ctx context.Context, r // Update - Updates are currently not supported for the Network Fabric Controller resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *NetworkFabricControllersClient) update(ctx context.Context, resourceGroupName string, networkFabricControllerName string, body NetworkFabricControllerPatch, options *NetworkFabricControllersClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, networkFabricControllerName, body, options) if err != nil { @@ -541,9 +392,6 @@ func (client *NetworkFabricControllersClient) update(ctx context.Context, resour // updateCreateRequest creates the Update request. func (client *NetworkFabricControllersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, networkFabricControllerName string, body NetworkFabricControllerPatch, options *NetworkFabricControllersClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -558,7 +406,7 @@ func (client *NetworkFabricControllersClient) updateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabriccontrollers_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabriccontrollers_client_example_test.go index 2635fbcfaf2d..682fd287a8d6 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabriccontrollers_client_example_test.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabriccontrollers_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_Create_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Create_MaximumSet_Gen.json func ExampleNetworkFabricControllersClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,25 +29,28 @@ func ExampleNetworkFabricControllersClient_BeginCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkFabricControllersClient().BeginCreate(ctx, "resourceGroupName", "NetworkControllerName", armmanagednetworkfabric.NetworkFabricController{ + poller, err := clientFactory.NewNetworkFabricControllersClient().BeginCreate(ctx, "example-rg", "example-networkController", armmanagednetworkfabric.NetworkFabricController{ Location: to.Ptr("eastus"), Properties: &armmanagednetworkfabric.NetworkFabricControllerProperties{ - Annotation: to.Ptr("lab 1"), + Annotation: to.Ptr("annotation"), InfrastructureExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ { - ExpressRouteAuthorizationKey: to.Ptr("xxxxxxx"), - ExpressRouteCircuitID: to.Ptr("/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), + ExpressRouteAuthorizationKey: to.Ptr("1234ABCD-0A1B-1234-5678-123456ABCDEF"), + ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), }}, WorkloadExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ { ExpressRouteAuthorizationKey: to.Ptr("xxxxx"), - ExpressRouteCircuitID: to.Ptr("/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), + ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), }}, - IPv4AddressSpace: to.Ptr("172.253.0.0/19"), + IPv4AddressSpace: to.Ptr("172.253.0.0/19"), + IPv6AddressSpace: to.Ptr("::/60"), + IsWorkloadManagementNetworkEnabled: to.Ptr(armmanagednetworkfabric.IsWorkloadManagementNetworkEnabledTrue), ManagedResourceGroupConfiguration: &armmanagednetworkfabric.ManagedResourceGroupConfiguration{ Name: to.Ptr("managedResourceGroupName"), Location: to.Ptr("eastus"), }, + NfcSKU: to.Ptr(armmanagednetworkfabric.NfcSKUStandard), }, }, nil) if err != nil { @@ -61,50 +64,59 @@ func ExampleNetworkFabricControllersClient_BeginCreate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkFabricController = armmanagednetworkfabric.NetworkFabricController{ - // Name: to.Ptr("NetworkFabricName"), + // Name: to.Ptr("example-networkController"), // Type: to.Ptr("microsoft.managednetworkfabric/networkfabriccontrollers"), - // ID: to.Ptr("/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/networkFabricControllerName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkController"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T05:01:43.008Z"); return t}()), - // CreatedBy: to.Ptr("user@company.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T05:01:43.008Z"); return t}()), - // LastModifiedBy: to.Ptr("User"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), // Properties: &armmanagednetworkfabric.NetworkFabricControllerProperties{ + // Annotation: to.Ptr("annotation"), // InfrastructureExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), + // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), // }}, // WorkloadExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), + // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), // }}, - // InfrastructureServices: &armmanagednetworkfabric.InfrastructureServices{ + // InfrastructureServices: &armmanagednetworkfabric.ControllerServices{ // IPv4AddressSpaces: []*string{ // to.Ptr("172.253.0.0/19")}, // IPv6AddressSpaces: []*string{ // }, // }, + // IPv4AddressSpace: to.Ptr("172.253.0.0/19"), + // IPv6AddressSpace: to.Ptr("::/60"), + // IsWorkloadManagementNetworkEnabled: to.Ptr(armmanagednetworkfabric.IsWorkloadManagementNetworkEnabledTrue), // ManagedResourceGroupConfiguration: &armmanagednetworkfabric.ManagedResourceGroupConfiguration{ // Name: to.Ptr("managedResourceGroupName"), // Location: to.Ptr("eastus"), // }, // NetworkFabricIDs: []*string{ - // }, - // WorkloadServices: &armmanagednetworkfabric.WorkloadServices{ - // IPv4AddressSpaces: []*string{ - // to.Ptr("172.253.28.0/22")}, - // IPv6AddressSpaces: []*string{ + // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/eaxmple-fabric")}, + // NfcSKU: to.Ptr(armmanagednetworkfabric.NfcSKUStandard), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // TenantInternetGatewayIDs: []*string{ + // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, + // WorkloadManagementNetwork: to.Ptr(true), + // WorkloadServices: &armmanagednetworkfabric.ControllerServices{ + // IPv4AddressSpaces: []*string{ + // to.Ptr("172.253.28.0/22")}, + // IPv6AddressSpaces: []*string{ + // }, + // }, // }, - // }, - // }, - // } + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_Get_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Get_MaximumSet_Gen.json func ExampleNetworkFabricControllersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -115,7 +127,7 @@ func ExampleNetworkFabricControllersClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewNetworkFabricControllersClient().Get(ctx, "resourceGroupName", "networkFabricControllerName", nil) + res, err := clientFactory.NewNetworkFabricControllersClient().Get(ctx, "example-rg", "example-networkController", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -123,48 +135,59 @@ func ExampleNetworkFabricControllersClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkFabricController = armmanagednetworkfabric.NetworkFabricController{ - // Name: to.Ptr("NetworkFabricName"), + // Name: to.Ptr("example-networkController"), // Type: to.Ptr("microsoft.managednetworkfabric/networkfabriccontrollers"), - // ID: to.Ptr("/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/networkFabricControllerName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkController"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T05:01:43.008Z"); return t}()), - // CreatedBy: to.Ptr("user@company.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T05:01:43.008Z"); return t}()), - // LastModifiedBy: to.Ptr("User"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), // Properties: &armmanagednetworkfabric.NetworkFabricControllerProperties{ + // Annotation: to.Ptr("annotation"), // InfrastructureExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), + // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), // }}, // WorkloadExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), + // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), // }}, - // InfrastructureServices: &armmanagednetworkfabric.InfrastructureServices{ + // InfrastructureServices: &armmanagednetworkfabric.ControllerServices{ // IPv4AddressSpaces: []*string{ // to.Ptr("172.253.0.0/19")}, + // IPv6AddressSpaces: []*string{ + // }, // }, + // IPv4AddressSpace: to.Ptr("172.253.0.0/19"), + // IPv6AddressSpace: to.Ptr("::/60"), + // IsWorkloadManagementNetworkEnabled: to.Ptr(armmanagednetworkfabric.IsWorkloadManagementNetworkEnabledTrue), // ManagedResourceGroupConfiguration: &armmanagednetworkfabric.ManagedResourceGroupConfiguration{ // Name: to.Ptr("managedResourceGroupName"), // Location: to.Ptr("eastus"), // }, // NetworkFabricIDs: []*string{ - // }, - // WorkloadServices: &armmanagednetworkfabric.WorkloadServices{ - // IPv4AddressSpaces: []*string{ - // to.Ptr("172.253.28.0/22")}, - // IPv6AddressSpaces: []*string{ + // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/eaxmple-fabric")}, + // NfcSKU: to.Ptr(armmanagednetworkfabric.NfcSKUStandard), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // TenantInternetGatewayIDs: []*string{ + // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, + // WorkloadManagementNetwork: to.Ptr(true), + // WorkloadServices: &armmanagednetworkfabric.ControllerServices{ + // IPv4AddressSpaces: []*string{ + // to.Ptr("172.253.28.0/22")}, + // IPv6AddressSpaces: []*string{ + // }, + // }, // }, - // }, - // }, - // } + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_Update_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Update_MaximumSet_Gen.json func ExampleNetworkFabricControllersClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -175,12 +198,17 @@ func ExampleNetworkFabricControllersClient_BeginUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkFabricControllersClient().BeginUpdate(ctx, "resourceGroupName", "networkFabricControllerName", armmanagednetworkfabric.NetworkFabricControllerPatch{ + poller, err := clientFactory.NewNetworkFabricControllersClient().BeginUpdate(ctx, "example-rg", "example-networkController", armmanagednetworkfabric.NetworkFabricControllerPatch{ Properties: &armmanagednetworkfabric.NetworkFabricControllerPatchableProperties{ + InfrastructureExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ + { + ExpressRouteAuthorizationKey: to.Ptr("xxxxxxx"), + ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), + }}, WorkloadExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ { ExpressRouteAuthorizationKey: to.Ptr("xxxxxxx"), - ExpressRouteCircuitID: to.Ptr("/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), + ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), }}, }, }, nil) @@ -195,48 +223,59 @@ func ExampleNetworkFabricControllersClient_BeginUpdate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkFabricController = armmanagednetworkfabric.NetworkFabricController{ - // Name: to.Ptr("NetworkFabricName"), + // Name: to.Ptr("example-networkController"), // Type: to.Ptr("microsoft.managednetworkfabric/networkfabriccontrollers"), - // ID: to.Ptr("/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/networkFabricControllerName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkController"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T05:01:43.008Z"); return t}()), - // CreatedBy: to.Ptr("user@company.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T05:01:43.008Z"); return t}()), - // LastModifiedBy: to.Ptr("User"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), // Properties: &armmanagednetworkfabric.NetworkFabricControllerProperties{ + // Annotation: to.Ptr("annotation"), // InfrastructureExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), + // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), // }}, // WorkloadExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), + // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), // }}, - // InfrastructureServices: &armmanagednetworkfabric.InfrastructureServices{ + // InfrastructureServices: &armmanagednetworkfabric.ControllerServices{ // IPv4AddressSpaces: []*string{ // to.Ptr("172.253.0.0/19")}, + // IPv6AddressSpaces: []*string{ + // }, // }, + // IPv4AddressSpace: to.Ptr("172.253.0.0/19"), + // IPv6AddressSpace: to.Ptr("::/60"), + // IsWorkloadManagementNetworkEnabled: to.Ptr(armmanagednetworkfabric.IsWorkloadManagementNetworkEnabledTrue), // ManagedResourceGroupConfiguration: &armmanagednetworkfabric.ManagedResourceGroupConfiguration{ // Name: to.Ptr("managedResourceGroupName"), // Location: to.Ptr("eastus"), // }, // NetworkFabricIDs: []*string{ - // }, - // WorkloadServices: &armmanagednetworkfabric.WorkloadServices{ - // IPv4AddressSpaces: []*string{ - // to.Ptr("172.253.28.0/22")}, - // IPv6AddressSpaces: []*string{ + // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/eaxmple-fabric")}, + // NfcSKU: to.Ptr(armmanagednetworkfabric.NfcSKUStandard), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // TenantInternetGatewayIDs: []*string{ + // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, + // WorkloadManagementNetwork: to.Ptr(true), + // WorkloadServices: &armmanagednetworkfabric.ControllerServices{ + // IPv4AddressSpaces: []*string{ + // to.Ptr("172.253.28.0/22")}, + // IPv6AddressSpaces: []*string{ + // }, + // }, // }, - // }, - // }, - // } + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_Delete_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Delete_MaximumSet_Gen.json func ExampleNetworkFabricControllersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -247,7 +286,7 @@ func ExampleNetworkFabricControllersClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkFabricControllersClient().BeginDelete(ctx, "resourceGroupName", "networkFabricControllerName", nil) + poller, err := clientFactory.NewNetworkFabricControllersClient().BeginDelete(ctx, "example-rg", "example-networkController", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -257,7 +296,7 @@ func ExampleNetworkFabricControllersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_ListByResourceGroup_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_ListByResourceGroup_MaximumSet_Gen.json func ExampleNetworkFabricControllersClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -268,7 +307,7 @@ func ExampleNetworkFabricControllersClient_NewListByResourceGroupPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewNetworkFabricControllersClient().NewListByResourceGroupPager("resourceGroupName", nil) + pager := clientFactory.NewNetworkFabricControllersClient().NewListByResourceGroupPager("example-rg", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -282,50 +321,61 @@ func ExampleNetworkFabricControllersClient_NewListByResourceGroupPager() { // page.NetworkFabricControllersListResult = armmanagednetworkfabric.NetworkFabricControllersListResult{ // Value: []*armmanagednetworkfabric.NetworkFabricController{ // { - // Name: to.Ptr("NetworkFabricName"), + // Name: to.Ptr("example-networkController"), // Type: to.Ptr("microsoft.managednetworkfabric/networkfabriccontrollers"), - // ID: to.Ptr("/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/networkFabricControllerName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkController"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T05:01:43.008Z"); return t}()), - // CreatedBy: to.Ptr("user@company.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T05:01:43.008Z"); return t}()), - // LastModifiedBy: to.Ptr("User"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), // Properties: &armmanagednetworkfabric.NetworkFabricControllerProperties{ + // Annotation: to.Ptr("annotation"), // InfrastructureExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), + // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), // }}, // WorkloadExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), + // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), // }}, - // InfrastructureServices: &armmanagednetworkfabric.InfrastructureServices{ + // InfrastructureServices: &armmanagednetworkfabric.ControllerServices{ // IPv4AddressSpaces: []*string{ // to.Ptr("172.253.0.0/19")}, + // IPv6AddressSpaces: []*string{ + // }, // }, + // IPv4AddressSpace: to.Ptr("172.253.0.0/19"), + // IPv6AddressSpace: to.Ptr("::/60"), + // IsWorkloadManagementNetworkEnabled: to.Ptr(armmanagednetworkfabric.IsWorkloadManagementNetworkEnabledTrue), // ManagedResourceGroupConfiguration: &armmanagednetworkfabric.ManagedResourceGroupConfiguration{ // Name: to.Ptr("managedResourceGroupName"), // Location: to.Ptr("eastus"), // }, // NetworkFabricIDs: []*string{ - // }, - // WorkloadServices: &armmanagednetworkfabric.WorkloadServices{ - // IPv4AddressSpaces: []*string{ - // to.Ptr("172.253.28.0/22")}, - // IPv6AddressSpaces: []*string{ + // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/eaxmple-fabric")}, + // NfcSKU: to.Ptr(armmanagednetworkfabric.NfcSKUStandard), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // TenantInternetGatewayIDs: []*string{ + // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, + // WorkloadManagementNetwork: to.Ptr(true), + // WorkloadServices: &armmanagednetworkfabric.ControllerServices{ + // IPv4AddressSpaces: []*string{ + // to.Ptr("172.253.28.0/22")}, + // IPv6AddressSpaces: []*string{ + // }, + // }, // }, - // }, - // }, - // }}, - // } + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_ListBySubscription_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_ListBySubscription_MaximumSet_Gen.json func ExampleNetworkFabricControllersClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -350,87 +400,56 @@ func ExampleNetworkFabricControllersClient_NewListBySubscriptionPager() { // page.NetworkFabricControllersListResult = armmanagednetworkfabric.NetworkFabricControllersListResult{ // Value: []*armmanagednetworkfabric.NetworkFabricController{ // { - // Name: to.Ptr("NetworkFabricName"), + // Name: to.Ptr("example-networkController"), // Type: to.Ptr("microsoft.managednetworkfabric/networkfabriccontrollers"), - // ID: to.Ptr("/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/networkFabricControllerName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkController"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T05:01:43.008Z"); return t}()), - // CreatedBy: to.Ptr("user@company.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T05:01:43.008Z"); return t}()), - // LastModifiedBy: to.Ptr("User"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), // Properties: &armmanagednetworkfabric.NetworkFabricControllerProperties{ + // Annotation: to.Ptr("annotation"), // InfrastructureExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), + // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), // }}, // WorkloadExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), + // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), // }}, - // InfrastructureServices: &armmanagednetworkfabric.InfrastructureServices{ + // InfrastructureServices: &armmanagednetworkfabric.ControllerServices{ // IPv4AddressSpaces: []*string{ // to.Ptr("172.253.0.0/19")}, + // IPv6AddressSpaces: []*string{ + // }, // }, + // IPv4AddressSpace: to.Ptr("172.253.0.0/19"), + // IPv6AddressSpace: to.Ptr("::/60"), + // IsWorkloadManagementNetworkEnabled: to.Ptr(armmanagednetworkfabric.IsWorkloadManagementNetworkEnabledTrue), // ManagedResourceGroupConfiguration: &armmanagednetworkfabric.ManagedResourceGroupConfiguration{ // Name: to.Ptr("managedResourceGroupName"), // Location: to.Ptr("eastus"), // }, // NetworkFabricIDs: []*string{ - // }, - // WorkloadServices: &armmanagednetworkfabric.WorkloadServices{ - // IPv4AddressSpaces: []*string{ - // to.Ptr("172.253.28.0/22")}, - // IPv6AddressSpaces: []*string{ + // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/eaxmple-fabric")}, + // NfcSKU: to.Ptr(armmanagednetworkfabric.NfcSKUStandard), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // TenantInternetGatewayIDs: []*string{ + // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, + // WorkloadManagementNetwork: to.Ptr(true), + // WorkloadServices: &armmanagednetworkfabric.ControllerServices{ + // IPv4AddressSpaces: []*string{ + // to.Ptr("172.253.28.0/22")}, + // IPv6AddressSpaces: []*string{ + // }, + // }, // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_enableWorkloadManagementNetwork_MaximumSet_Gen.json -func ExampleNetworkFabricControllersClient_BeginEnableWorkloadManagementNetwork() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFabricControllersClient().BeginEnableWorkloadManagementNetwork(ctx, "resourceGroupName", "networkFabricControllerName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_disableWorkloadManagementNetwork_MaximumSet_Gen.json -func ExampleNetworkFabricControllersClient_BeginDisableWorkloadManagementNetwork() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFabricControllersClient().BeginDisableWorkloadManagementNetwork(ctx, "resourceGroupName", "networkFabricControllerName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) + // }}, + // } } } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabrics_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabrics_client.go index 5d25e8a36b0b..d1a33ffe2d2e 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabrics_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabrics_client.go @@ -29,7 +29,7 @@ type NetworkFabricsClient struct { } // NewNetworkFabricsClient creates a new instance of NetworkFabricsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewNetworkFabricsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkFabricsClient, error) { @@ -44,12 +44,76 @@ func NewNetworkFabricsClient(subscriptionID string, credential azcore.TokenCrede return client, nil } +// BeginCommitConfiguration - Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric level. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkFabricName - Name of the Network Fabric. +// - options - NetworkFabricsClientBeginCommitConfigurationOptions contains the optional parameters for the NetworkFabricsClient.BeginCommitConfiguration +// method. +func (client *NetworkFabricsClient) BeginCommitConfiguration(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginCommitConfigurationOptions) (*runtime.Poller[NetworkFabricsClientCommitConfigurationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.commitConfiguration(ctx, resourceGroupName, networkFabricName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientCommitConfigurationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkFabricsClientCommitConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CommitConfiguration - Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric level. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkFabricsClient) commitConfiguration(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginCommitConfigurationOptions) (*http.Response, error) { + req, err := client.commitConfigurationCreateRequest(ctx, resourceGroupName, networkFabricName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// commitConfigurationCreateRequest creates the CommitConfiguration request. +func (client *NetworkFabricsClient) commitConfigurationCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginCommitConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/commitConfiguration" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkFabricName == "" { + return nil, errors.New("parameter networkFabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFabricName}", url.PathEscape(networkFabricName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // BeginCreate - Create Network Fabric resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkFabricName - Name of the Network Fabric +// - networkFabricName - Name of the Network Fabric. // - body - Request payload. // - options - NetworkFabricsClientBeginCreateOptions contains the optional parameters for the NetworkFabricsClient.BeginCreate // method. @@ -70,7 +134,7 @@ func (client *NetworkFabricsClient) BeginCreate(ctx context.Context, resourceGro // Create - Create Network Fabric resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *NetworkFabricsClient) create(ctx context.Context, resourceGroupName string, networkFabricName string, body NetworkFabric, options *NetworkFabricsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, networkFabricName, body, options) if err != nil { @@ -89,9 +153,6 @@ func (client *NetworkFabricsClient) create(ctx context.Context, resourceGroupNam // createCreateRequest creates the Create request. func (client *NetworkFabricsClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, body NetworkFabric, options *NetworkFabricsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -106,7 +167,7 @@ func (client *NetworkFabricsClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -115,9 +176,9 @@ func (client *NetworkFabricsClient) createCreateRequest(ctx context.Context, res // BeginDelete - Delete Network Fabric resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkFabricName - Name of the Network Fabric +// - networkFabricName - Name of the Network Fabric. // - options - NetworkFabricsClientBeginDeleteOptions contains the optional parameters for the NetworkFabricsClient.BeginDelete // method. func (client *NetworkFabricsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginDeleteOptions) (*runtime.Poller[NetworkFabricsClientDeleteResponse], error) { @@ -137,7 +198,7 @@ func (client *NetworkFabricsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Delete Network Fabric resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *NetworkFabricsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkFabricName, options) if err != nil { @@ -147,7 +208,7 @@ func (client *NetworkFabricsClient) deleteOperation(ctx context.Context, resourc if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -156,9 +217,6 @@ func (client *NetworkFabricsClient) deleteOperation(ctx context.Context, resourc // deleteCreateRequest creates the Delete request. func (client *NetworkFabricsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -173,7 +231,7 @@ func (client *NetworkFabricsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,9 +240,9 @@ func (client *NetworkFabricsClient) deleteCreateRequest(ctx context.Context, res // BeginDeprovision - Deprovisions the underlying resources in the given Network Fabric instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkFabricName - Name of the NetworkFabric. +// - networkFabricName - Name of the Network Fabric. // - options - NetworkFabricsClientBeginDeprovisionOptions contains the optional parameters for the NetworkFabricsClient.BeginDeprovision // method. func (client *NetworkFabricsClient) BeginDeprovision(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginDeprovisionOptions) (*runtime.Poller[NetworkFabricsClientDeprovisionResponse], error) { @@ -204,7 +262,7 @@ func (client *NetworkFabricsClient) BeginDeprovision(ctx context.Context, resour // Deprovision - Deprovisions the underlying resources in the given Network Fabric instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *NetworkFabricsClient) deprovision(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginDeprovisionOptions) (*http.Response, error) { req, err := client.deprovisionCreateRequest(ctx, resourceGroupName, networkFabricName, options) if err != nil { @@ -214,7 +272,7 @@ func (client *NetworkFabricsClient) deprovision(ctx context.Context, resourceGro if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -223,9 +281,6 @@ func (client *NetworkFabricsClient) deprovision(ctx context.Context, resourceGro // deprovisionCreateRequest creates the Deprovision request. func (client *NetworkFabricsClient) deprovisionCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginDeprovisionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/deprovision" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -240,7 +295,7 @@ func (client *NetworkFabricsClient) deprovisionCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,9 +304,9 @@ func (client *NetworkFabricsClient) deprovisionCreateRequest(ctx context.Context // Get - Get Network Fabric resource details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkFabricName - Name of the Network Fabric +// - networkFabricName - Name of the Network Fabric. // - options - NetworkFabricsClientGetOptions contains the optional parameters for the NetworkFabricsClient.Get method. func (client *NetworkFabricsClient) Get(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientGetOptions) (NetworkFabricsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, networkFabricName, options) @@ -271,9 +326,6 @@ func (client *NetworkFabricsClient) Get(ctx context.Context, resourceGroupName s // getCreateRequest creates the Get request. func (client *NetworkFabricsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -288,7 +340,7 @@ func (client *NetworkFabricsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,9 +355,73 @@ func (client *NetworkFabricsClient) getHandleResponse(resp *http.Response) (Netw return result, nil } +// BeginGetTopology - Gets Topology of the underlying resources in the given Network Fabric instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkFabricName - Name of the Network Fabric. +// - options - NetworkFabricsClientBeginGetTopologyOptions contains the optional parameters for the NetworkFabricsClient.BeginGetTopology +// method. +func (client *NetworkFabricsClient) BeginGetTopology(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginGetTopologyOptions) (*runtime.Poller[NetworkFabricsClientGetTopologyResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getTopology(ctx, resourceGroupName, networkFabricName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientGetTopologyResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkFabricsClientGetTopologyResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// GetTopology - Gets Topology of the underlying resources in the given Network Fabric instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkFabricsClient) getTopology(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginGetTopologyOptions) (*http.Response, error) { + req, err := client.getTopologyCreateRequest(ctx, resourceGroupName, networkFabricName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getTopologyCreateRequest creates the GetTopology request. +func (client *NetworkFabricsClient) getTopologyCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginGetTopologyOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/getTopology" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkFabricName == "" { + return nil, errors.New("parameter networkFabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFabricName}", url.PathEscape(networkFabricName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // NewListByResourceGroupPager - List all the Network Fabric resources in the given resource group. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - NetworkFabricsClientListByResourceGroupOptions contains the optional parameters for the NetworkFabricsClient.NewListByResourceGroupPager // method. @@ -340,9 +456,6 @@ func (client *NetworkFabricsClient) NewListByResourceGroupPager(resourceGroupNam // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *NetworkFabricsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *NetworkFabricsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -353,7 +466,7 @@ func (client *NetworkFabricsClient) listByResourceGroupCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -370,7 +483,7 @@ func (client *NetworkFabricsClient) listByResourceGroupHandleResponse(resp *http // NewListBySubscriptionPager - List all the Network Fabric resources in the given subscription. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - options - NetworkFabricsClientListBySubscriptionOptions contains the optional parameters for the NetworkFabricsClient.NewListBySubscriptionPager // method. func (client *NetworkFabricsClient) NewListBySubscriptionPager(options *NetworkFabricsClientListBySubscriptionOptions) *runtime.Pager[NetworkFabricsClientListBySubscriptionResponse] { @@ -404,16 +517,13 @@ func (client *NetworkFabricsClient) NewListBySubscriptionPager(options *NetworkF // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *NetworkFabricsClient) listBySubscriptionCreateRequest(ctx context.Context, options *NetworkFabricsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabrics" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -431,9 +541,9 @@ func (client *NetworkFabricsClient) listBySubscriptionHandleResponse(resp *http. // BeginProvision - Provisions the underlying resources in the given Network Fabric instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkFabricName - Name of the NetworkFabric. +// - networkFabricName - Name of the Network Fabric. // - options - NetworkFabricsClientBeginProvisionOptions contains the optional parameters for the NetworkFabricsClient.BeginProvision // method. func (client *NetworkFabricsClient) BeginProvision(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginProvisionOptions) (*runtime.Poller[NetworkFabricsClientProvisionResponse], error) { @@ -453,7 +563,7 @@ func (client *NetworkFabricsClient) BeginProvision(ctx context.Context, resource // Provision - Provisions the underlying resources in the given Network Fabric instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *NetworkFabricsClient) provision(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginProvisionOptions) (*http.Response, error) { req, err := client.provisionCreateRequest(ctx, resourceGroupName, networkFabricName, options) if err != nil { @@ -463,7 +573,7 @@ func (client *NetworkFabricsClient) provision(ctx context.Context, resourceGroup if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -472,9 +582,70 @@ func (client *NetworkFabricsClient) provision(ctx context.Context, resourceGroup // provisionCreateRequest creates the Provision request. func (client *NetworkFabricsClient) provisionCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginProvisionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/provision" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkFabricName == "" { + return nil, errors.New("parameter networkFabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFabricName}", url.PathEscape(networkFabricName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginRefreshConfiguration - Refreshes the configuration of the underlying resources in the given Network Fabric instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkFabricName - Name of the Network Fabric. +// - options - NetworkFabricsClientBeginRefreshConfigurationOptions contains the optional parameters for the NetworkFabricsClient.BeginRefreshConfiguration +// method. +func (client *NetworkFabricsClient) BeginRefreshConfiguration(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginRefreshConfigurationOptions) (*runtime.Poller[NetworkFabricsClientRefreshConfigurationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.refreshConfiguration(ctx, resourceGroupName, networkFabricName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientRefreshConfigurationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkFabricsClientRefreshConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// RefreshConfiguration - Refreshes the configuration of the underlying resources in the given Network Fabric instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkFabricsClient) refreshConfiguration(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginRefreshConfigurationOptions) (*http.Response, error) { + req, err := client.refreshConfigurationCreateRequest(ctx, resourceGroupName, networkFabricName, options) + if err != nil { + return nil, err } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// refreshConfigurationCreateRequest creates the RefreshConfiguration request. +func (client *NetworkFabricsClient) refreshConfigurationCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginRefreshConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/refreshConfiguration" urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -489,7 +660,7 @@ func (client *NetworkFabricsClient) provisionCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -498,13 +669,13 @@ func (client *NetworkFabricsClient) provisionCreateRequest(ctx context.Context, // BeginUpdate - Update certain properties of the Network Fabric resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkFabricName - Name of the Network Fabric +// - networkFabricName - Name of the Network Fabric. // - body - Network Fabric properties to update. // - options - NetworkFabricsClientBeginUpdateOptions contains the optional parameters for the NetworkFabricsClient.BeginUpdate // method. -func (client *NetworkFabricsClient) BeginUpdate(ctx context.Context, resourceGroupName string, networkFabricName string, body NetworkFabricPatchParameters, options *NetworkFabricsClientBeginUpdateOptions) (*runtime.Poller[NetworkFabricsClientUpdateResponse], error) { +func (client *NetworkFabricsClient) BeginUpdate(ctx context.Context, resourceGroupName string, networkFabricName string, body NetworkFabricPatch, options *NetworkFabricsClientBeginUpdateOptions) (*runtime.Poller[NetworkFabricsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, networkFabricName, body, options) if err != nil { @@ -521,8 +692,8 @@ func (client *NetworkFabricsClient) BeginUpdate(ctx context.Context, resourceGro // Update - Update certain properties of the Network Fabric resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview -func (client *NetworkFabricsClient) update(ctx context.Context, resourceGroupName string, networkFabricName string, body NetworkFabricPatchParameters, options *NetworkFabricsClientBeginUpdateOptions) (*http.Response, error) { +// Generated from API version 2023-06-15 +func (client *NetworkFabricsClient) update(ctx context.Context, resourceGroupName string, networkFabricName string, body NetworkFabricPatch, options *NetworkFabricsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, networkFabricName, body, options) if err != nil { return nil, err @@ -538,11 +709,8 @@ func (client *NetworkFabricsClient) update(ctx context.Context, resourceGroupNam } // updateCreateRequest creates the Update request. -func (client *NetworkFabricsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, body NetworkFabricPatchParameters, options *NetworkFabricsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *NetworkFabricsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, body NetworkFabricPatch, options *NetworkFabricsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -557,7 +725,271 @@ func (client *NetworkFabricsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginUpdateInfraManagementBfdConfiguration - Updates the Infra Management BFD Configuration of the underlying resources +// in the given Network Fabric instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkFabricName - Name of the Network Fabric. +// - body - Request payload. +// - options - NetworkFabricsClientBeginUpdateInfraManagementBfdConfigurationOptions contains the optional parameters for the +// NetworkFabricsClient.BeginUpdateInfraManagementBfdConfiguration method. +func (client *NetworkFabricsClient) BeginUpdateInfraManagementBfdConfiguration(ctx context.Context, resourceGroupName string, networkFabricName string, body UpdateAdministrativeState, options *NetworkFabricsClientBeginUpdateInfraManagementBfdConfigurationOptions) (*runtime.Poller[NetworkFabricsClientUpdateInfraManagementBfdConfigurationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateInfraManagementBfdConfiguration(ctx, resourceGroupName, networkFabricName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientUpdateInfraManagementBfdConfigurationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkFabricsClientUpdateInfraManagementBfdConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateInfraManagementBfdConfiguration - Updates the Infra Management BFD Configuration of the underlying resources in the +// given Network Fabric instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkFabricsClient) updateInfraManagementBfdConfiguration(ctx context.Context, resourceGroupName string, networkFabricName string, body UpdateAdministrativeState, options *NetworkFabricsClientBeginUpdateInfraManagementBfdConfigurationOptions) (*http.Response, error) { + req, err := client.updateInfraManagementBfdConfigurationCreateRequest(ctx, resourceGroupName, networkFabricName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateInfraManagementBfdConfigurationCreateRequest creates the UpdateInfraManagementBfdConfiguration request. +func (client *NetworkFabricsClient) updateInfraManagementBfdConfigurationCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, body UpdateAdministrativeState, options *NetworkFabricsClientBeginUpdateInfraManagementBfdConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateInfraManagementBfdConfiguration" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkFabricName == "" { + return nil, errors.New("parameter networkFabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFabricName}", url.PathEscape(networkFabricName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginUpdateWorkloadManagementBfdConfiguration - Updates the Workload Management BFD Configuration of the underlying resources +// in the given Network Fabric instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkFabricName - Name of the Network Fabric. +// - body - Request payload. +// - options - NetworkFabricsClientBeginUpdateWorkloadManagementBfdConfigurationOptions contains the optional parameters for +// the NetworkFabricsClient.BeginUpdateWorkloadManagementBfdConfiguration method. +func (client *NetworkFabricsClient) BeginUpdateWorkloadManagementBfdConfiguration(ctx context.Context, resourceGroupName string, networkFabricName string, body UpdateAdministrativeState, options *NetworkFabricsClientBeginUpdateWorkloadManagementBfdConfigurationOptions) (*runtime.Poller[NetworkFabricsClientUpdateWorkloadManagementBfdConfigurationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateWorkloadManagementBfdConfiguration(ctx, resourceGroupName, networkFabricName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientUpdateWorkloadManagementBfdConfigurationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkFabricsClientUpdateWorkloadManagementBfdConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateWorkloadManagementBfdConfiguration - Updates the Workload Management BFD Configuration of the underlying resources +// in the given Network Fabric instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkFabricsClient) updateWorkloadManagementBfdConfiguration(ctx context.Context, resourceGroupName string, networkFabricName string, body UpdateAdministrativeState, options *NetworkFabricsClientBeginUpdateWorkloadManagementBfdConfigurationOptions) (*http.Response, error) { + req, err := client.updateWorkloadManagementBfdConfigurationCreateRequest(ctx, resourceGroupName, networkFabricName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateWorkloadManagementBfdConfigurationCreateRequest creates the UpdateWorkloadManagementBfdConfiguration request. +func (client *NetworkFabricsClient) updateWorkloadManagementBfdConfigurationCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, body UpdateAdministrativeState, options *NetworkFabricsClientBeginUpdateWorkloadManagementBfdConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateWorkloadManagementBfdConfiguration" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkFabricName == "" { + return nil, errors.New("parameter networkFabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFabricName}", url.PathEscape(networkFabricName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginUpgrade - Upgrades the version of the underlying resources in the given Network Fabric instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkFabricName - Name of the Network Fabric. +// - body - Network Fabric properties to update. +// - options - NetworkFabricsClientBeginUpgradeOptions contains the optional parameters for the NetworkFabricsClient.BeginUpgrade +// method. +func (client *NetworkFabricsClient) BeginUpgrade(ctx context.Context, resourceGroupName string, networkFabricName string, body UpdateVersion, options *NetworkFabricsClientBeginUpgradeOptions) (*runtime.Poller[NetworkFabricsClientUpgradeResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.upgrade(ctx, resourceGroupName, networkFabricName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientUpgradeResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkFabricsClientUpgradeResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Upgrade - Upgrades the version of the underlying resources in the given Network Fabric instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkFabricsClient) upgrade(ctx context.Context, resourceGroupName string, networkFabricName string, body UpdateVersion, options *NetworkFabricsClientBeginUpgradeOptions) (*http.Response, error) { + req, err := client.upgradeCreateRequest(ctx, resourceGroupName, networkFabricName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// upgradeCreateRequest creates the Upgrade request. +func (client *NetworkFabricsClient) upgradeCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, body UpdateVersion, options *NetworkFabricsClientBeginUpgradeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/upgrade" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkFabricName == "" { + return nil, errors.New("parameter networkFabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFabricName}", url.PathEscape(networkFabricName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginValidateConfiguration - Validates the configuration of the underlying resources in the given Network Fabric instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkFabricName - Name of the Network Fabric. +// - body - Validate configuration properties. +// - options - NetworkFabricsClientBeginValidateConfigurationOptions contains the optional parameters for the NetworkFabricsClient.BeginValidateConfiguration +// method. +func (client *NetworkFabricsClient) BeginValidateConfiguration(ctx context.Context, resourceGroupName string, networkFabricName string, body ValidateConfigurationProperties, options *NetworkFabricsClientBeginValidateConfigurationOptions) (*runtime.Poller[NetworkFabricsClientValidateConfigurationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.validateConfiguration(ctx, resourceGroupName, networkFabricName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientValidateConfigurationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkFabricsClientValidateConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ValidateConfiguration - Validates the configuration of the underlying resources in the given Network Fabric instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkFabricsClient) validateConfiguration(ctx context.Context, resourceGroupName string, networkFabricName string, body ValidateConfigurationProperties, options *NetworkFabricsClientBeginValidateConfigurationOptions) (*http.Response, error) { + req, err := client.validateConfigurationCreateRequest(ctx, resourceGroupName, networkFabricName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// validateConfigurationCreateRequest creates the ValidateConfiguration request. +func (client *NetworkFabricsClient) validateConfigurationCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, body ValidateConfigurationProperties, options *NetworkFabricsClientBeginValidateConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/validateConfiguration" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkFabricName == "" { + return nil, errors.New("parameter networkFabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFabricName}", url.PathEscape(networkFabricName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabrics_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabrics_client_example_test.go index 98cc23ff0059..18adbbd86e22 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabrics_client_example_test.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabrics_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_Create_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Create_MaximumSet_Gen.json func ExampleNetworkFabricsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,63 +29,93 @@ func ExampleNetworkFabricsClient_BeginCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkFabricsClient().BeginCreate(ctx, "resourceGroupName", "FabricName", armmanagednetworkfabric.NetworkFabric{ + poller, err := clientFactory.NewNetworkFabricsClient().BeginCreate(ctx, "example-rg", "example-fabric", armmanagednetworkfabric.NetworkFabric{ Location: to.Ptr("eastuseuap"), Tags: map[string]*string{ - "key6468": to.Ptr(""), + "keyID": to.Ptr("keyValue"), }, Properties: &armmanagednetworkfabric.NetworkFabricProperties{ - Annotation: to.Ptr("annotationValue"), - FabricASN: to.Ptr[int32](29249), + Annotation: to.Ptr("annotation"), + FabricASN: to.Ptr[int64](29249), IPv4Prefix: to.Ptr("10.18.0.0/19"), IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/59"), - ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfiguration{ + ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfigurationProperties{ InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - OptionAProperties: &armmanagednetworkfabric.OptionAProperties{ - PrimaryIPv4Prefix: to.Ptr("20.0.0.12/30"), - PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a8/126"), + NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ + PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), - SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/126"), - Mtu: to.Ptr[int32](5892), - PeerASN: to.Ptr[int32](42666), - VlanID: to.Ptr[int32](2724), + SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + IntervalInMilliSeconds: to.Ptr[int32](300), + Multiplier: to.Ptr[int32](10), + }, + Mtu: to.Ptr[int32](1501), + PeerASN: to.Ptr[int64](1235), + VlanID: to.Ptr[int32](3001), }, - OptionBProperties: &armmanagednetworkfabric.OptionBPropertiesAutoGenerated{ + OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ ExportRouteTargets: []*string{ - to.Ptr("65046:10039")}, + to.Ptr("65046:10050")}, ImportRouteTargets: []*string{ - to.Ptr("65046:10039")}, + to.Ptr("65046:10050")}, + RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + ExportIPv4RouteTargets: []*string{ + to.Ptr("65046:10039")}, + ExportIPv6RouteTargets: []*string{ + to.Ptr("65046:10039")}, + ImportIPv4RouteTargets: []*string{ + to.Ptr("65046:10039")}, + ImportIPv6RouteTargets: []*string{ + to.Ptr("65046:10039")}, + }, }, PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), }, WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - OptionAProperties: &armmanagednetworkfabric.OptionAProperties{ + NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), - Mtu: to.Ptr[int32](5892), - PeerASN: to.Ptr[int32](42666), - VlanID: to.Ptr[int32](2724), + BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + IntervalInMilliSeconds: to.Ptr[int32](300), + Multiplier: to.Ptr[int32](5), + }, + Mtu: to.Ptr[int32](1500), + PeerASN: to.Ptr[int64](61234), + VlanID: to.Ptr[int32](3000), }, - OptionBProperties: &armmanagednetworkfabric.OptionBPropertiesAutoGenerated{ + OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ ExportRouteTargets: []*string{ to.Ptr("65046:10050")}, ImportRouteTargets: []*string{ to.Ptr("65046:10050")}, + RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + ExportIPv4RouteTargets: []*string{ + to.Ptr("65046:10039")}, + ExportIPv6RouteTargets: []*string{ + to.Ptr("65046:10039")}, + ImportIPv4RouteTargets: []*string{ + to.Ptr("65046:10039")}, + ImportIPv6RouteTargets: []*string{ + to.Ptr("65046:10039")}, + }, }, PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), }, }, - NetworkFabricControllerID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName"), + NetworkFabricControllerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-fabricController"), NetworkFabricSKU: to.Ptr("M4-A400-A100-C16-aa"), RackCount: to.Ptr[int32](4), ServerCountPerRack: to.Ptr[int32](8), TerminalServerConfiguration: &armmanagednetworkfabric.TerminalServerConfiguration{ - PrimaryIPv4Prefix: to.Ptr("20.0.0.12/30"), - PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a8/126"), + PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), - SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/126"), + SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), Password: to.Ptr("xxxx"), SerialNumber: to.Ptr("123456"), Username: to.Ptr("username"), @@ -103,105 +133,128 @@ func ExampleNetworkFabricsClient_BeginCreate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkFabric = armmanagednetworkfabric.NetworkFabric{ - // Name: to.Ptr("FabricName"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkfabrics"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName"), + // Name: to.Ptr("example-fabric"), + // Type: to.Ptr("Microsoft.ManagedNetworkFabric/networkFabrics"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-17T11:01:18.007Z"); return t}()), - // CreatedBy: to.Ptr("User@email.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), + // CreatedBy: to.Ptr("email@email.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-17T11:01:18.007Z"); return t}()), - // LastModifiedBy: to.Ptr("User"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastuseuap"), // Tags: map[string]*string{ - // "key6468": to.Ptr(""), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.NetworkFabricProperties{ - // Annotation: to.Ptr("annotationValue"), + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // FabricASN: to.Ptr[int64](29249), + // FabricVersion: to.Ptr("version1"), + // IPv4Prefix: to.Ptr("10.18.0.0/19"), + // IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/59"), // L2IsolationDomains: []*string{ - // to.Ptr("/subscriptions/xxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2Domain")}, // L3IsolationDomains: []*string{ - // to.Ptr("/subscriptions/xxxxx/resourceGroups/resourecegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")}, - // Racks: []*string{ - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkRacks/fab3AggRack"), - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkRacks/fab3CompRack1"), - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkRacks/fab3CompRack2")}, - // FabricASN: to.Ptr[int32](29249), - // IPv4Prefix: to.Ptr("10.18.0.0/19"), - // IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/59"), - // ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfiguration{ - // InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnects/DefaultNNI"), - // OptionAProperties: &armmanagednetworkfabric.OptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("20.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a8/126"), - // SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/126"), - // BfdConfiguration: &armmanagednetworkfabric.FabricBfdConfiguration{ - // Interval: to.Ptr[int32](8), - // Multiplier: to.Ptr[int32](29), - // }, - // Mtu: to.Ptr[int32](5892), - // PeerASN: to.Ptr[int32](42666), - // VlanID: to.Ptr[int32](2724), + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3Domain")}, + // ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfigurationProperties{ + // InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), + // SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), + // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](10), // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBPropertiesAutoGenerated{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnect/DefaultNNI"), - // OptionAProperties: &armmanagednetworkfabric.OptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), - // PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), - // SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), - // SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), - // BfdConfiguration: &armmanagednetworkfabric.FabricBfdConfiguration{ - // Interval: to.Ptr[int32](8), - // Multiplier: to.Ptr[int32](29), - // }, - // Mtu: to.Ptr[int32](5892), - // PeerASN: to.Ptr[int32](42666), - // VlanID: to.Ptr[int32](2724), - // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBPropertiesAutoGenerated{ - // ExportRouteTargets: []*string{ - // to.Ptr("65047:10080")}, - // ImportRouteTargets: []*string{ + // Mtu: to.Ptr[int32](1501), + // PeerASN: to.Ptr[int64](1235), + // VlanID: to.Ptr[int32](3001), + // }, + // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ + // ExportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + // ExportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ExportIPv6RouteTargets: []*string{ // to.Ptr("65046:10050")}, + // ImportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // }, + // }, + // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // }, - // NetworkFabricControllerID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName"), - // NetworkFabricSKU: to.Ptr("M4-A400-A100-C16-aa"), - // OperationalState: to.Ptr(armmanagednetworkfabric.NetworkFabricOperationalStateProvisioning), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RackCount: to.Ptr[int32](4), - // RouterID: to.Ptr("routerId"), - // ServerCountPerRack: to.Ptr[int32](8), - // TerminalServerConfiguration: &armmanagednetworkfabric.TerminalServerConfiguration{ - // PrimaryIPv4Prefix: to.Ptr("20.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a8/126"), - // SecondaryIPv4Prefix: to.Ptr("20.0.0.14/30"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/126"), - // SerialNumber: to.Ptr("123456"), - // Username: to.Ptr("username"), - // NetworkDeviceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName"), - // }, - // }, - // } + // WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), + // PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), + // SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), + // SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), + // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](5), + // }, + // Mtu: to.Ptr[int32](1500), + // PeerASN: to.Ptr[int64](61234), + // VlanID: to.Ptr[int32](3000), + // }, + // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ + // ExportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + // ExportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ExportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // }, + // }, + // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), + // }, + // }, + // NetworkFabricControllerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-fabricController"), + // NetworkFabricSKU: to.Ptr("M4-A400-A100-C16-aa"), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // RackCount: to.Ptr[int32](4), + // Racks: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-networkRack")}, + // RouterIDs: []*string{ + // to.Ptr("routerId")}, + // ServerCountPerRack: to.Ptr[int32](8), + // TerminalServerConfiguration: &armmanagednetworkfabric.TerminalServerConfiguration{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), + // SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), + // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + // SerialNumber: to.Ptr("123456"), + // Username: to.Ptr("username"), + // NetworkDeviceID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_Get_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Get_MaximumSet_Gen.json func ExampleNetworkFabricsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -212,7 +265,7 @@ func ExampleNetworkFabricsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewNetworkFabricsClient().Get(ctx, "resourceGroupName", "FabricName", nil) + res, err := clientFactory.NewNetworkFabricsClient().Get(ctx, "example-rg", "example-fabric", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -220,105 +273,128 @@ func ExampleNetworkFabricsClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkFabric = armmanagednetworkfabric.NetworkFabric{ - // Name: to.Ptr("FabricName"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkfabrics"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName"), + // Name: to.Ptr("example-fabric"), + // Type: to.Ptr("Microsoft.ManagedNetworkFabric/networkFabrics"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-17T11:01:18.007Z"); return t}()), - // CreatedBy: to.Ptr("User@email.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), + // CreatedBy: to.Ptr("email@email.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-17T11:01:18.007Z"); return t}()), - // LastModifiedBy: to.Ptr("User"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastuseuap"), // Tags: map[string]*string{ - // "key6468": to.Ptr(""), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.NetworkFabricProperties{ - // Annotation: to.Ptr("annotationValue"), + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // FabricASN: to.Ptr[int64](29249), + // FabricVersion: to.Ptr("version1"), + // IPv4Prefix: to.Ptr("10.18.0.0/19"), + // IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/59"), // L2IsolationDomains: []*string{ - // to.Ptr("/subscriptions/xxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2Domain")}, // L3IsolationDomains: []*string{ - // to.Ptr("/subscriptions/xxxxx/resourceGroups/resourecegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")}, - // Racks: []*string{ - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkRacks/fab3AggRack"), - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkRacks/fab3CompRack1"), - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkRacks/fab3CompRack2")}, - // FabricASN: to.Ptr[int32](29249), - // IPv4Prefix: to.Ptr("10.18.0.0/19"), - // IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/59"), - // ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfiguration{ - // InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnects/DefaultNNI"), - // OptionAProperties: &armmanagednetworkfabric.OptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("20.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a8/126"), - // SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/126"), - // BfdConfiguration: &armmanagednetworkfabric.FabricBfdConfiguration{ - // Interval: to.Ptr[int32](8), - // Multiplier: to.Ptr[int32](29), - // }, - // Mtu: to.Ptr[int32](5892), - // PeerASN: to.Ptr[int32](42666), - // VlanID: to.Ptr[int32](2724), + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3Domain")}, + // ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfigurationProperties{ + // InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), + // SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), + // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](10), // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBPropertiesAutoGenerated{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnect/DefaultNNI"), - // OptionAProperties: &armmanagednetworkfabric.OptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), - // PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), - // SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), - // SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), - // BfdConfiguration: &armmanagednetworkfabric.FabricBfdConfiguration{ - // Interval: to.Ptr[int32](8), - // Multiplier: to.Ptr[int32](29), - // }, - // Mtu: to.Ptr[int32](5892), - // PeerASN: to.Ptr[int32](42666), - // VlanID: to.Ptr[int32](2724), - // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBPropertiesAutoGenerated{ - // ExportRouteTargets: []*string{ - // to.Ptr("65047:10080")}, - // ImportRouteTargets: []*string{ + // Mtu: to.Ptr[int32](1501), + // PeerASN: to.Ptr[int64](1235), + // VlanID: to.Ptr[int32](3001), + // }, + // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ + // ExportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + // ExportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ExportIPv6RouteTargets: []*string{ // to.Ptr("65046:10050")}, + // ImportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // }, + // }, + // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // }, - // NetworkFabricControllerID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName"), - // NetworkFabricSKU: to.Ptr("M4-A400-A100-C16-aa"), - // OperationalState: to.Ptr(armmanagednetworkfabric.NetworkFabricOperationalStateProvisioning), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RackCount: to.Ptr[int32](4), - // RouterID: to.Ptr("routerId"), - // ServerCountPerRack: to.Ptr[int32](8), - // TerminalServerConfiguration: &armmanagednetworkfabric.TerminalServerConfiguration{ - // PrimaryIPv4Prefix: to.Ptr("20.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a8/126"), - // SecondaryIPv4Prefix: to.Ptr("20.0.0.14/30"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/126"), - // SerialNumber: to.Ptr("123456"), - // Username: to.Ptr("username"), - // NetworkDeviceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName"), - // }, - // }, - // } + // WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), + // PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), + // SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), + // SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), + // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](5), + // }, + // Mtu: to.Ptr[int32](1500), + // PeerASN: to.Ptr[int64](61234), + // VlanID: to.Ptr[int32](3000), + // }, + // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ + // ExportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + // ExportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ExportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // }, + // }, + // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), + // }, + // }, + // NetworkFabricControllerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-fabricController"), + // NetworkFabricSKU: to.Ptr("M4-A400-A100-C16-aa"), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // RackCount: to.Ptr[int32](4), + // Racks: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-networkRack")}, + // RouterIDs: []*string{ + // to.Ptr("routerId")}, + // ServerCountPerRack: to.Ptr[int32](8), + // TerminalServerConfiguration: &armmanagednetworkfabric.TerminalServerConfiguration{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), + // SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), + // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + // SerialNumber: to.Ptr("123456"), + // Username: to.Ptr("username"), + // NetworkDeviceID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_Update_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Update_MaximumSet_Gen.json func ExampleNetworkFabricsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -329,17 +405,94 @@ func ExampleNetworkFabricsClient_BeginUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkFabricsClient().BeginUpdate(ctx, "resourceGroupName", "FabricName", armmanagednetworkfabric.NetworkFabricPatchParameters{ - Properties: &armmanagednetworkfabric.NetworkFabricPatchParametersProperties{ - Annotation: to.Ptr("annotationValue"), - TerminalServerConfiguration: &armmanagednetworkfabric.TerminalServerPatchableProperties{ - Password: to.Ptr("xxxxxxx"), - SerialNumber: to.Ptr("234567"), - Username: to.Ptr("username"), - }, - }, + poller, err := clientFactory.NewNetworkFabricsClient().BeginUpdate(ctx, "example-rg", "example-fabric", armmanagednetworkfabric.NetworkFabricPatch{ Tags: map[string]*string{ - "key1758": to.Ptr(""), + "keyID": to.Ptr("KeyValue"), + }, + Properties: &armmanagednetworkfabric.NetworkFabricPatchProperties{ + Annotation: to.Ptr("annotation1"), + FabricASN: to.Ptr[int64](12345), + IPv4Prefix: to.Ptr("10.18.0.0/17"), + IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/60"), + ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfigurationPatchableProperties{ + InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationPatchableProperties{ + NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPatchablePropertiesOptionAProperties{ + PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), + SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), + SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + IntervalInMilliSeconds: to.Ptr[int32](300), + Multiplier: to.Ptr[int32](10), + }, + Mtu: to.Ptr[int32](1501), + PeerASN: to.Ptr[int64](1235), + VlanID: to.Ptr[int32](3001), + }, + OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ + ExportRouteTargets: []*string{ + to.Ptr("65046:10050")}, + ImportRouteTargets: []*string{ + to.Ptr("65046:10050")}, + RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + ExportIPv4RouteTargets: []*string{ + to.Ptr("65046:10050")}, + ExportIPv6RouteTargets: []*string{ + to.Ptr("65046:10050")}, + ImportIPv4RouteTargets: []*string{ + to.Ptr("65046:10050")}, + ImportIPv6RouteTargets: []*string{ + to.Ptr("65046:10050")}, + }, + }, + PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionB), + }, + WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationPatchableProperties{ + NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPatchablePropertiesOptionAProperties{ + PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), + PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), + SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), + SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), + BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + IntervalInMilliSeconds: to.Ptr[int32](300), + Multiplier: to.Ptr[int32](5), + }, + Mtu: to.Ptr[int32](1500), + PeerASN: to.Ptr[int64](61234), + VlanID: to.Ptr[int32](3000), + }, + OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ + ExportRouteTargets: []*string{ + to.Ptr("65046:10050")}, + ImportRouteTargets: []*string{ + to.Ptr("65046:10050")}, + RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + ExportIPv4RouteTargets: []*string{ + to.Ptr("65046:10050")}, + ExportIPv6RouteTargets: []*string{ + to.Ptr("65046:10050")}, + ImportIPv4RouteTargets: []*string{ + to.Ptr("65046:10050")}, + ImportIPv6RouteTargets: []*string{ + to.Ptr("65046:10050")}, + }, + }, + PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), + }, + }, + RackCount: to.Ptr[int32](6), + ServerCountPerRack: to.Ptr[int32](10), + TerminalServerConfiguration: &armmanagednetworkfabric.NetworkFabricPatchablePropertiesTerminalServerConfiguration{ + PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), + SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), + SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + Password: to.Ptr("xxxxxxxx"), + SerialNumber: to.Ptr("1234567"), + Username: to.Ptr("username1"), + }, }, }, nil) if err != nil { @@ -353,105 +506,128 @@ func ExampleNetworkFabricsClient_BeginUpdate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkFabric = armmanagednetworkfabric.NetworkFabric{ - // Name: to.Ptr("FabricName"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkfabrics"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName"), + // Name: to.Ptr("example-fabric"), + // Type: to.Ptr("Microsoft.ManagedNetworkFabric/networkFabrics"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-17T11:01:18.007Z"); return t}()), - // CreatedBy: to.Ptr("User@email.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), + // CreatedBy: to.Ptr("email@email.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-17T11:01:18.007Z"); return t}()), - // LastModifiedBy: to.Ptr("User"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastuseuap"), // Tags: map[string]*string{ - // "key6468": to.Ptr(""), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.NetworkFabricProperties{ - // Annotation: to.Ptr("annotationValue"), + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // FabricASN: to.Ptr[int64](12345), + // FabricVersion: to.Ptr("version1"), + // IPv4Prefix: to.Ptr("10.18.0.0/17"), + // IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/60"), // L2IsolationDomains: []*string{ - // to.Ptr("/subscriptions/xxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2Domain")}, // L3IsolationDomains: []*string{ - // to.Ptr("/subscriptions/xxxxx/resourceGroups/resourecegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")}, - // Racks: []*string{ - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkRacks/fab3AggRack"), - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkRacks/fab3CompRack1"), - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkRacks/fab3CompRack2")}, - // FabricASN: to.Ptr[int32](29249), - // IPv4Prefix: to.Ptr("10.18.0.0/19"), - // IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/59"), - // ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfiguration{ - // InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnects/DefaultNNI"), - // OptionAProperties: &armmanagednetworkfabric.OptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("20.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a8/126"), - // SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/126"), - // BfdConfiguration: &armmanagednetworkfabric.FabricBfdConfiguration{ - // Interval: to.Ptr[int32](8), - // Multiplier: to.Ptr[int32](29), - // }, - // Mtu: to.Ptr[int32](5892), - // PeerASN: to.Ptr[int32](42666), - // VlanID: to.Ptr[int32](2724), + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3Domain")}, + // ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfigurationProperties{ + // InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), + // SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), + // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](10), // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBPropertiesAutoGenerated{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnect/DefaultNNI"), - // OptionAProperties: &armmanagednetworkfabric.OptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), - // PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), - // SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), - // SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), - // BfdConfiguration: &armmanagednetworkfabric.FabricBfdConfiguration{ - // Interval: to.Ptr[int32](8), - // Multiplier: to.Ptr[int32](29), - // }, - // Mtu: to.Ptr[int32](5892), - // PeerASN: to.Ptr[int32](42666), - // VlanID: to.Ptr[int32](2724), - // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBPropertiesAutoGenerated{ - // ExportRouteTargets: []*string{ - // to.Ptr("65047:10080")}, - // ImportRouteTargets: []*string{ + // Mtu: to.Ptr[int32](1501), + // PeerASN: to.Ptr[int64](1235), + // VlanID: to.Ptr[int32](3001), + // }, + // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ + // ExportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + // ExportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ExportIPv6RouteTargets: []*string{ // to.Ptr("65046:10050")}, + // ImportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // }, + // }, + // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionB), // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // }, - // NetworkFabricControllerID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName"), - // NetworkFabricSKU: to.Ptr("M4-A400-A100-C16-aa"), - // OperationalState: to.Ptr(armmanagednetworkfabric.NetworkFabricOperationalStateProvisioning), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RackCount: to.Ptr[int32](4), - // RouterID: to.Ptr("routerId"), - // ServerCountPerRack: to.Ptr[int32](8), - // TerminalServerConfiguration: &armmanagednetworkfabric.TerminalServerConfiguration{ - // PrimaryIPv4Prefix: to.Ptr("20.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a8/126"), - // SecondaryIPv4Prefix: to.Ptr("20.0.0.14/30"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/126"), - // SerialNumber: to.Ptr("234567"), - // Username: to.Ptr("username"), - // NetworkDeviceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName"), - // }, - // }, - // } + // WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), + // PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), + // SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), + // SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), + // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](5), + // }, + // Mtu: to.Ptr[int32](1500), + // PeerASN: to.Ptr[int64](61234), + // VlanID: to.Ptr[int32](3000), + // }, + // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ + // ExportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + // ExportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ExportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // }, + // }, + // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), + // }, + // }, + // NetworkFabricControllerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-fabricController"), + // NetworkFabricSKU: to.Ptr("M4-A400-A100-C16-aa"), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // RackCount: to.Ptr[int32](6), + // Racks: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-networkRack")}, + // RouterIDs: []*string{ + // to.Ptr("routerId")}, + // ServerCountPerRack: to.Ptr[int32](10), + // TerminalServerConfiguration: &armmanagednetworkfabric.TerminalServerConfiguration{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), + // SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), + // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + // SerialNumber: to.Ptr("1234567"), + // Username: to.Ptr("username1"), + // NetworkDeviceID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_Delete_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Delete_MaximumSet_Gen.json func ExampleNetworkFabricsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -462,7 +638,7 @@ func ExampleNetworkFabricsClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkFabricsClient().BeginDelete(ctx, "rgNetworkFabrics", "lrhjxlxlhgvufessdcuetcwnto", nil) + poller, err := clientFactory.NewNetworkFabricsClient().BeginDelete(ctx, "example-rg", "example-fabric", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -472,7 +648,7 @@ func ExampleNetworkFabricsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_ListByResourceGroup_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_ListByResourceGroup_MaximumSet_Gen.json func ExampleNetworkFabricsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -483,7 +659,7 @@ func ExampleNetworkFabricsClient_NewListByResourceGroupPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewNetworkFabricsClient().NewListByResourceGroupPager("rgNetworkFabrics", nil) + pager := clientFactory.NewNetworkFabricsClient().NewListByResourceGroupPager("example-rg", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -497,107 +673,130 @@ func ExampleNetworkFabricsClient_NewListByResourceGroupPager() { // page.NetworkFabricsListResult = armmanagednetworkfabric.NetworkFabricsListResult{ // Value: []*armmanagednetworkfabric.NetworkFabric{ // { - // Name: to.Ptr("FabricName"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkfabrics"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName"), + // Name: to.Ptr("example-fabric"), + // Type: to.Ptr("Microsoft.ManagedNetworkFabric/networkFabrics"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-17T11:01:18.007Z"); return t}()), - // CreatedBy: to.Ptr("User@email.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), + // CreatedBy: to.Ptr("email@email.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-17T11:01:18.007Z"); return t}()), - // LastModifiedBy: to.Ptr("User"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastuseuap"), // Tags: map[string]*string{ - // "key6468": to.Ptr(""), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.NetworkFabricProperties{ - // Annotation: to.Ptr("annotationValue"), + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // FabricASN: to.Ptr[int64](29249), + // FabricVersion: to.Ptr("version1"), + // IPv4Prefix: to.Ptr("10.18.0.0/19"), + // IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/59"), // L2IsolationDomains: []*string{ - // to.Ptr("/subscriptions/xxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2Domain")}, // L3IsolationDomains: []*string{ - // to.Ptr("/subscriptions/xxxxx/resourceGroups/resourecegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")}, - // Racks: []*string{ - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkRacks/fab3AggRack"), - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkRacks/fab3CompRack1"), - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkRacks/fab3CompRack2")}, - // FabricASN: to.Ptr[int32](29249), - // IPv4Prefix: to.Ptr("10.18.0.0/19"), - // IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/59"), - // ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfiguration{ - // InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnects/DefaultNNI"), - // OptionAProperties: &armmanagednetworkfabric.OptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("20.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a8/126"), - // SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/126"), - // BfdConfiguration: &armmanagednetworkfabric.FabricBfdConfiguration{ - // Interval: to.Ptr[int32](8), - // Multiplier: to.Ptr[int32](29), - // }, - // Mtu: to.Ptr[int32](5892), - // PeerASN: to.Ptr[int32](42666), - // VlanID: to.Ptr[int32](2724), + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3Domain")}, + // ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfigurationProperties{ + // InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), + // SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), + // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](10), // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBPropertiesAutoGenerated{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnect/DefaultNNI"), - // OptionAProperties: &armmanagednetworkfabric.OptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), - // PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), - // SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), - // SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), - // BfdConfiguration: &armmanagednetworkfabric.FabricBfdConfiguration{ - // Interval: to.Ptr[int32](8), - // Multiplier: to.Ptr[int32](29), - // }, - // Mtu: to.Ptr[int32](5892), - // PeerASN: to.Ptr[int32](42666), - // VlanID: to.Ptr[int32](2724), - // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBPropertiesAutoGenerated{ - // ExportRouteTargets: []*string{ - // to.Ptr("65047:10080")}, - // ImportRouteTargets: []*string{ + // Mtu: to.Ptr[int32](1501), + // PeerASN: to.Ptr[int64](1235), + // VlanID: to.Ptr[int32](3001), + // }, + // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ + // ExportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + // ExportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ExportIPv6RouteTargets: []*string{ // to.Ptr("65046:10050")}, + // ImportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // }, + // }, + // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // }, - // NetworkFabricControllerID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName"), - // NetworkFabricSKU: to.Ptr("M4-A400-A100-C16-aa"), - // OperationalState: to.Ptr(armmanagednetworkfabric.NetworkFabricOperationalStateProvisioning), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RackCount: to.Ptr[int32](4), - // RouterID: to.Ptr("routerId"), - // ServerCountPerRack: to.Ptr[int32](8), - // TerminalServerConfiguration: &armmanagednetworkfabric.TerminalServerConfiguration{ - // PrimaryIPv4Prefix: to.Ptr("20.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a8/126"), - // SecondaryIPv4Prefix: to.Ptr("20.0.0.14/30"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/126"), - // SerialNumber: to.Ptr("123456"), - // Username: to.Ptr("username"), - // NetworkDeviceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName"), - // }, - // }, - // }}, - // } + // WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), + // PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), + // SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), + // SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), + // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](5), + // }, + // Mtu: to.Ptr[int32](1500), + // PeerASN: to.Ptr[int64](61234), + // VlanID: to.Ptr[int32](3000), + // }, + // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ + // ExportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + // ExportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ExportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // }, + // }, + // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), + // }, + // }, + // NetworkFabricControllerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-fabricController"), + // NetworkFabricSKU: to.Ptr("M4-A400-A100-C16-aa"), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // RackCount: to.Ptr[int32](4), + // Racks: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-networkRack")}, + // RouterIDs: []*string{ + // to.Ptr("routerId")}, + // ServerCountPerRack: to.Ptr[int32](8), + // TerminalServerConfiguration: &armmanagednetworkfabric.TerminalServerConfiguration{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), + // SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), + // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + // SerialNumber: to.Ptr("123456"), + // Username: to.Ptr("username"), + // NetworkDeviceID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice"), + // }, + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_ListBySubscription_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_ListBySubscription_MaximumSet_Gen.json func ExampleNetworkFabricsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -622,107 +821,130 @@ func ExampleNetworkFabricsClient_NewListBySubscriptionPager() { // page.NetworkFabricsListResult = armmanagednetworkfabric.NetworkFabricsListResult{ // Value: []*armmanagednetworkfabric.NetworkFabric{ // { - // Name: to.Ptr("FabricName"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkfabrics"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName"), + // Name: to.Ptr("example-fabric"), + // Type: to.Ptr("Microsoft.ManagedNetworkFabric/networkFabrics"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-17T11:01:18.007Z"); return t}()), - // CreatedBy: to.Ptr("User@email.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), + // CreatedBy: to.Ptr("email@email.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-17T11:01:18.007Z"); return t}()), - // LastModifiedBy: to.Ptr("User"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Location: to.Ptr("eastuseuap"), // Tags: map[string]*string{ - // "key6468": to.Ptr(""), + // "keyID": to.Ptr("KeyValue"), // }, // Properties: &armmanagednetworkfabric.NetworkFabricProperties{ - // Annotation: to.Ptr("annotationValue"), + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // FabricASN: to.Ptr[int64](29249), + // FabricVersion: to.Ptr("version1"), + // IPv4Prefix: to.Ptr("10.18.0.0/19"), + // IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/59"), // L2IsolationDomains: []*string{ - // to.Ptr("/subscriptions/xxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2Domain")}, // L3IsolationDomains: []*string{ - // to.Ptr("/subscriptions/xxxxx/resourceGroups/resourecegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")}, - // Racks: []*string{ - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkRacks/fab3AggRack"), - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkRacks/fab3CompRack1"), - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkRacks/fab3CompRack2")}, - // FabricASN: to.Ptr[int32](29249), - // IPv4Prefix: to.Ptr("10.18.0.0/19"), - // IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/59"), - // ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfiguration{ - // InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnects/DefaultNNI"), - // OptionAProperties: &armmanagednetworkfabric.OptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("20.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a8/126"), - // SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/126"), - // BfdConfiguration: &armmanagednetworkfabric.FabricBfdConfiguration{ - // Interval: to.Ptr[int32](8), - // Multiplier: to.Ptr[int32](29), - // }, - // Mtu: to.Ptr[int32](5892), - // PeerASN: to.Ptr[int32](42666), - // VlanID: to.Ptr[int32](2724), + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3Domain")}, + // ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfigurationProperties{ + // InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), + // SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), + // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](10), // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBPropertiesAutoGenerated{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnect/DefaultNNI"), - // OptionAProperties: &armmanagednetworkfabric.OptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), - // PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), - // SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), - // SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), - // BfdConfiguration: &armmanagednetworkfabric.FabricBfdConfiguration{ - // Interval: to.Ptr[int32](8), - // Multiplier: to.Ptr[int32](29), - // }, - // Mtu: to.Ptr[int32](5892), - // PeerASN: to.Ptr[int32](42666), - // VlanID: to.Ptr[int32](2724), - // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBPropertiesAutoGenerated{ - // ExportRouteTargets: []*string{ - // to.Ptr("65047:10080")}, - // ImportRouteTargets: []*string{ + // Mtu: to.Ptr[int32](1501), + // PeerASN: to.Ptr[int64](1235), + // VlanID: to.Ptr[int32](3001), + // }, + // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ + // ExportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + // ExportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ExportIPv6RouteTargets: []*string{ // to.Ptr("65046:10050")}, + // ImportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // }, + // }, + // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // }, - // NetworkFabricControllerID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName"), - // NetworkFabricSKU: to.Ptr("M4-A400-A100-C16-aa"), - // OperationalState: to.Ptr(armmanagednetworkfabric.NetworkFabricOperationalStateProvisioning), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RackCount: to.Ptr[int32](4), - // RouterID: to.Ptr("routerId"), - // ServerCountPerRack: to.Ptr[int32](8), - // TerminalServerConfiguration: &armmanagednetworkfabric.TerminalServerConfiguration{ - // PrimaryIPv4Prefix: to.Ptr("20.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a8/126"), - // SecondaryIPv4Prefix: to.Ptr("20.0.0.14/30"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/126"), - // SerialNumber: to.Ptr("123456"), - // Username: to.Ptr("username"), - // NetworkDeviceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName"), - // }, - // }, - // }}, - // } + // WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), + // PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), + // SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), + // SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), + // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](5), + // }, + // Mtu: to.Ptr[int32](1500), + // PeerASN: to.Ptr[int64](61234), + // VlanID: to.Ptr[int32](3000), + // }, + // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ + // ExportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportRouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ + // ExportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ExportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportIPv4RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // ImportIPv6RouteTargets: []*string{ + // to.Ptr("65046:10050")}, + // }, + // }, + // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), + // }, + // }, + // NetworkFabricControllerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-fabricController"), + // NetworkFabricSKU: to.Ptr("M4-A400-A100-C16-aa"), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // RackCount: to.Ptr[int32](4), + // Racks: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-networkRack")}, + // RouterIDs: []*string{ + // to.Ptr("routerId")}, + // ServerCountPerRack: to.Ptr[int32](8), + // TerminalServerConfiguration: &armmanagednetworkfabric.TerminalServerConfiguration{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), + // SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), + // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + // SerialNumber: to.Ptr("123456"), + // Username: to.Ptr("username"), + // NetworkDeviceID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice"), + // }, + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_provision_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_provision_MaximumSet_Gen.json func ExampleNetworkFabricsClient_BeginProvision() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -733,17 +955,40 @@ func ExampleNetworkFabricsClient_BeginProvision() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkFabricsClient().BeginProvision(ctx, "resourceGroupName", "FabricName", nil) + poller, err := clientFactory.NewNetworkFabricsClient().BeginProvision(ctx, "example-rg", "example-fabric", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForDeviceUpdate = armmanagednetworkfabric.CommonPostActionResponseForDeviceUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // FailedDevices: []*string{ + // to.Ptr("")}, + // SuccessfulDevices: []*string{ + // to.Ptr("")}, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_deprovision_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_deprovision_MaximumSet_Gen.json func ExampleNetworkFabricsClient_BeginDeprovision() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -754,12 +999,329 @@ func ExampleNetworkFabricsClient_BeginDeprovision() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkFabricsClient().BeginDeprovision(ctx, "resourceGroupName", "FabricName", nil) + poller, err := clientFactory.NewNetworkFabricsClient().BeginDeprovision(ctx, "example-rg", "example-fabric", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForDeviceUpdate = armmanagednetworkfabric.CommonPostActionResponseForDeviceUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr("200"), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // FailedDevices: []*string{ + // to.Ptr("")}, + // SuccessfulDevices: []*string{ + // to.Ptr("")}, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_upgrade_MaximumSet_Gen.json +func ExampleNetworkFabricsClient_BeginUpgrade() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkFabricsClient().BeginUpgrade(ctx, "example-rg", "example-fabric", armmanagednetworkfabric.UpdateVersion{ + Version: to.Ptr("version1"), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_refreshConfiguration_MaximumSet_Gen.json +func ExampleNetworkFabricsClient_BeginRefreshConfiguration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkFabricsClient().BeginRefreshConfiguration(ctx, "example-rg", "example-fabric", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr("lvazqudujtegfmv"), + // }}, + // Code: to.Ptr("utdowavxlslkhmy"), + // Message: to.Ptr("otosyssdlaizpidtzcmiwvesc"), + // Target: to.Ptr("kht"), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_UpdateWorkloadManagementBfdConfiguration_MaximumSet_Gen.json +func ExampleNetworkFabricsClient_BeginUpdateWorkloadManagementBfdConfiguration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkFabricsClient().BeginUpdateWorkloadManagementBfdConfiguration(ctx, "example-rg", "example-fabric", armmanagednetworkfabric.UpdateAdministrativeState{ + ResourceIDs: []*string{ + to.Ptr("")}, + State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_UpdateInfraManagementBfdConfiguration_MaximumSet_Gen.json +func ExampleNetworkFabricsClient_BeginUpdateInfraManagementBfdConfiguration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkFabricsClient().BeginUpdateInfraManagementBfdConfiguration(ctx, "example-rg", "example-fabric", armmanagednetworkfabric.UpdateAdministrativeState{ + ResourceIDs: []*string{ + to.Ptr("")}, + State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_ValidateConfiguration_MaximumSet_Gen.json +func ExampleNetworkFabricsClient_BeginValidateConfiguration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkFabricsClient().BeginValidateConfiguration(ctx, "example-rg", "example-fabric", armmanagednetworkfabric.ValidateConfigurationProperties{ + ValidateAction: to.Ptr(armmanagednetworkfabric.ValidateActionCabling), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ValidateConfigurationResponse = armmanagednetworkfabric.ValidateConfigurationResponse{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // URL: to.Ptr("https://ActionDetails"), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_GetTopology_MaximumSet_Gen.json +func ExampleNetworkFabricsClient_BeginGetTopology() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkFabricsClient().BeginGetTopology(ctx, "example-rg", "example-fabric", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ValidateConfigurationResponse = armmanagednetworkfabric.ValidateConfigurationResponse{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // URL: to.Ptr("https://ActionDetails"), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_CommitConfiguration_MaximumSet_Gen.json +func ExampleNetworkFabricsClient_BeginCommitConfiguration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkFabricsClient().BeginCommitConfiguration(ctx, "example-rg", "example-fabric", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr("202"), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabricskus_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabricskus_client.go index 596a49a1aa2f..b50ad0cc5e64 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabricskus_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabricskus_client.go @@ -29,7 +29,7 @@ type NetworkFabricSKUsClient struct { } // NewNetworkFabricSKUsClient creates a new instance of NetworkFabricSKUsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewNetworkFabricSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkFabricSKUsClient, error) { @@ -44,11 +44,11 @@ func NewNetworkFabricSKUsClient(subscriptionID string, credential azcore.TokenCr return client, nil } -// Get - Implements Network Fabric Sku GET method. +// Get - Implements Network Fabric SKU GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview -// - networkFabricSKUName - Name of the Network Fabric Sku +// Generated from API version 2023-06-15 +// - networkFabricSKUName - Name of the Network Fabric SKU. // - options - NetworkFabricSKUsClientGetOptions contains the optional parameters for the NetworkFabricSKUsClient.Get method. func (client *NetworkFabricSKUsClient) Get(ctx context.Context, networkFabricSKUName string, options *NetworkFabricSKUsClientGetOptions) (NetworkFabricSKUsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, networkFabricSKUName, options) @@ -68,9 +68,6 @@ func (client *NetworkFabricSKUsClient) Get(ctx context.Context, networkFabricSKU // getCreateRequest creates the Get request. func (client *NetworkFabricSKUsClient) getCreateRequest(ctx context.Context, networkFabricSKUName string, options *NetworkFabricSKUsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus/{networkFabricSkuName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if networkFabricSKUName == "" { return nil, errors.New("parameter networkFabricSKUName cannot be empty") @@ -81,7 +78,7 @@ func (client *NetworkFabricSKUsClient) getCreateRequest(ctx context.Context, net return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -96,9 +93,9 @@ func (client *NetworkFabricSKUsClient) getHandleResponse(resp *http.Response) (N return result, nil } -// NewListBySubscriptionPager - Implements NetworkFabricSkus list by subscription GET method. +// NewListBySubscriptionPager - Implements Network Fabric SKUs list by subscription GET method. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - options - NetworkFabricSKUsClientListBySubscriptionOptions contains the optional parameters for the NetworkFabricSKUsClient.NewListBySubscriptionPager // method. func (client *NetworkFabricSKUsClient) NewListBySubscriptionPager(options *NetworkFabricSKUsClientListBySubscriptionOptions) *runtime.Pager[NetworkFabricSKUsClientListBySubscriptionResponse] { @@ -132,16 +129,13 @@ func (client *NetworkFabricSKUsClient) NewListBySubscriptionPager(options *Netwo // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *NetworkFabricSKUsClient) listBySubscriptionCreateRequest(ctx context.Context, options *NetworkFabricSKUsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabricskus_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabricskus_client_example_test.go index cb55e0525175..ef93e0b96179 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabricskus_client_example_test.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabricskus_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricSkus_Get_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricSkus_Get_MaximumSet_Gen.json func ExampleNetworkFabricSKUsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -28,7 +28,7 @@ func ExampleNetworkFabricSKUsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewNetworkFabricSKUsClient().Get(ctx, "networkFabricSkuName", nil) + res, err := clientFactory.NewNetworkFabricSKUsClient().Get(ctx, "example-fabricsku", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -36,29 +36,30 @@ func ExampleNetworkFabricSKUsClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkFabricSKU = armmanagednetworkfabric.NetworkFabricSKU{ - // Name: to.Ptr("networkFabricSkuName"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkfabricsSku"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/networkFabricSku/networkFabricSkuName"), + // Name: to.Ptr("example-fabricsku"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkFabricSkus"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus/example-fabricsku"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T12:02:09.236Z"); return t}()), - // CreatedBy: to.Ptr("User@email.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:44:43.644Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T12:02:09.236Z"); return t}()), - // LastModifiedBy: to.Ptr("Userid"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:44:43.644Z"); return t}()), + // LastModifiedBy: to.Ptr("User@email.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Properties: &armmanagednetworkfabric.NetworkFabricSKUProperties{ - // Type: to.Ptr("MultiRack"), - // DetailsURI: to.Ptr("https://baseurl/images/skus/networkFabricSkuName"), - // MaxComputeRacks: to.Ptr[int32](8), - // MaxSupportedVer: to.Ptr("0.1.2"), - // MinSupportedVer: to.Ptr("0.1.1"), + // Type: to.Ptr(armmanagednetworkfabric.FabricSKUTypeSingleRack), + // MaxComputeRacks: to.Ptr[int32](4), + // MaximumServerCount: to.Ptr[int32](9), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } + // SupportedVersions: []*string{ + // to.Ptr("1.0.0")}, + // Details: to.Ptr("https://azure/fabricskuDetails"), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricSkus_ListBySubscription_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricSkus_ListBySubscription_MaximumSet_Gen.json func ExampleNetworkFabricSKUsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -83,26 +84,27 @@ func ExampleNetworkFabricSKUsClient_NewListBySubscriptionPager() { // page.NetworkFabricSKUsListResult = armmanagednetworkfabric.NetworkFabricSKUsListResult{ // Value: []*armmanagednetworkfabric.NetworkFabricSKU{ // { - // Name: to.Ptr("networkFabricSkuName"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkfabricsSku"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/networkFabricSku/networkFabricSkuName"), + // Name: to.Ptr("example-fabricsku"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkFabricSkus"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus/example-fabricsku"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T12:02:09.236Z"); return t}()), - // CreatedBy: to.Ptr("User@email.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:44:43.644Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T12:02:09.236Z"); return t}()), - // LastModifiedBy: to.Ptr("Userid"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:44:43.644Z"); return t}()), + // LastModifiedBy: to.Ptr("User@email.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Properties: &armmanagednetworkfabric.NetworkFabricSKUProperties{ - // Type: to.Ptr("MultiRack"), - // DetailsURI: to.Ptr("https://baseurl/images/skus/networkFabricSkuName"), - // MaxComputeRacks: to.Ptr[int32](8), - // MaxSupportedVer: to.Ptr("0.1.2"), - // MinSupportedVer: to.Ptr("0.1.1"), + // Type: to.Ptr(armmanagednetworkfabric.FabricSKUTypeSingleRack), + // MaxComputeRacks: to.Ptr[int32](4), + // MaximumServerCount: to.Ptr[int32](9), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } + // SupportedVersions: []*string{ + // to.Ptr("1.0.0")}, + // Details: to.Ptr("https://azure/fabricskuDetails"), + // }, + // }}, + // } } } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkinterfaces_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkinterfaces_client.go index 94a458417fe0..aec44dd8d64d 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkinterfaces_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkinterfaces_client.go @@ -29,7 +29,7 @@ type NetworkInterfacesClient struct { } // NewNetworkInterfacesClient creates a new instance of NetworkInterfacesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewNetworkInterfacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkInterfacesClient, error) { @@ -47,10 +47,10 @@ func NewNetworkInterfacesClient(subscriptionID string, credential azcore.TokenCr // BeginCreate - Create a Network Interface resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the NetworkDevice -// - networkInterfaceName - Name of the NetworkInterface +// - networkDeviceName - Name of the Network Device. +// - networkInterfaceName - Name of the Network Interface. // - body - Request payload. // - options - NetworkInterfacesClientBeginCreateOptions contains the optional parameters for the NetworkInterfacesClient.BeginCreate // method. @@ -71,7 +71,7 @@ func (client *NetworkInterfacesClient) BeginCreate(ctx context.Context, resource // Create - Create a Network Interface resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *NetworkInterfacesClient) create(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, body NetworkInterface, options *NetworkInterfacesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, networkDeviceName, networkInterfaceName, body, options) if err != nil { @@ -90,9 +90,6 @@ func (client *NetworkInterfacesClient) create(ctx context.Context, resourceGroup // createCreateRequest creates the Create request. func (client *NetworkInterfacesClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, body NetworkInterface, options *NetworkInterfacesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -111,7 +108,7 @@ func (client *NetworkInterfacesClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -120,10 +117,10 @@ func (client *NetworkInterfacesClient) createCreateRequest(ctx context.Context, // BeginDelete - Delete the Network Interface resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the NetworkDevice -// - networkInterfaceName - Name of the NetworkInterfaceName +// - networkDeviceName - Name of the Network Device. +// - networkInterfaceName - Name of the Network Interface. // - options - NetworkInterfacesClientBeginDeleteOptions contains the optional parameters for the NetworkInterfacesClient.BeginDelete // method. func (client *NetworkInterfacesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, options *NetworkInterfacesClientBeginDeleteOptions) (*runtime.Poller[NetworkInterfacesClientDeleteResponse], error) { @@ -143,7 +140,7 @@ func (client *NetworkInterfacesClient) BeginDelete(ctx context.Context, resource // Delete - Delete the Network Interface resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *NetworkInterfacesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, options *NetworkInterfacesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkDeviceName, networkInterfaceName, options) if err != nil { @@ -153,7 +150,7 @@ func (client *NetworkInterfacesClient) deleteOperation(ctx context.Context, reso if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -162,9 +159,6 @@ func (client *NetworkInterfacesClient) deleteOperation(ctx context.Context, reso // deleteCreateRequest creates the Delete request. func (client *NetworkInterfacesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, options *NetworkInterfacesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -183,7 +177,7 @@ func (client *NetworkInterfacesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,10 +186,10 @@ func (client *NetworkInterfacesClient) deleteCreateRequest(ctx context.Context, // Get - Get the Network Interface resource details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the NetworkDevice -// - networkInterfaceName - Name of the NetworkInterfaceName +// - networkDeviceName - Name of the Network Device. +// - networkInterfaceName - Name of the Network Interface. // - options - NetworkInterfacesClientGetOptions contains the optional parameters for the NetworkInterfacesClient.Get method. func (client *NetworkInterfacesClient) Get(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, options *NetworkInterfacesClientGetOptions) (NetworkInterfacesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, networkDeviceName, networkInterfaceName, options) @@ -215,9 +209,6 @@ func (client *NetworkInterfacesClient) Get(ctx context.Context, resourceGroupNam // getCreateRequest creates the Get request. func (client *NetworkInterfacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, options *NetworkInterfacesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -236,7 +227,7 @@ func (client *NetworkInterfacesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -251,119 +242,44 @@ func (client *NetworkInterfacesClient) getHandleResponse(resp *http.Response) (N return result, nil } -// BeginGetStatus - Get the running status of the Network Interface. -// If the operation fails it returns an *azcore.ResponseError type. +// NewListByNetworkDevicePager - List all the Network Interface resources in a given resource group. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the NetworkDevice. -// - networkInterfaceName - Name of the NetworkInterface -// - options - NetworkInterfacesClientBeginGetStatusOptions contains the optional parameters for the NetworkInterfacesClient.BeginGetStatus +// - networkDeviceName - Name of the Network Device. +// - options - NetworkInterfacesClientListByNetworkDeviceOptions contains the optional parameters for the NetworkInterfacesClient.NewListByNetworkDevicePager // method. -func (client *NetworkInterfacesClient) BeginGetStatus(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, options *NetworkInterfacesClientBeginGetStatusOptions) (*runtime.Poller[NetworkInterfacesClientGetStatusResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.getStatus(ctx, resourceGroupName, networkDeviceName, networkInterfaceName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkInterfacesClientGetStatusResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[NetworkInterfacesClientGetStatusResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// GetStatus - Get the running status of the Network Interface. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -func (client *NetworkInterfacesClient) getStatus(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, options *NetworkInterfacesClientBeginGetStatusOptions) (*http.Response, error) { - req, err := client.getStatusCreateRequest(ctx, resourceGroupName, networkDeviceName, networkInterfaceName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getStatusCreateRequest creates the GetStatus request. -func (client *NetworkInterfacesClient) getStatusCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, options *NetworkInterfacesClientBeginGetStatusOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}/getStatus" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkDeviceName == "" { - return nil, errors.New("parameter networkDeviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkDeviceName}", url.PathEscape(networkDeviceName)) - if networkInterfaceName == "" { - return nil, errors.New("parameter networkInterfaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkInterfaceName}", url.PathEscape(networkInterfaceName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// NewListPager - List all the Network Interface resources in a given resource group. -// -// Generated from API version 2023-02-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the NetworkDevice. -// - options - NetworkInterfacesClientListOptions contains the optional parameters for the NetworkInterfacesClient.NewListPager -// method. -func (client *NetworkInterfacesClient) NewListPager(resourceGroupName string, networkDeviceName string, options *NetworkInterfacesClientListOptions) *runtime.Pager[NetworkInterfacesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[NetworkInterfacesClientListResponse]{ - More: func(page NetworkInterfacesClientListResponse) bool { +func (client *NetworkInterfacesClient) NewListByNetworkDevicePager(resourceGroupName string, networkDeviceName string, options *NetworkInterfacesClientListByNetworkDeviceOptions) *runtime.Pager[NetworkInterfacesClientListByNetworkDeviceResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkInterfacesClientListByNetworkDeviceResponse]{ + More: func(page NetworkInterfacesClientListByNetworkDeviceResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *NetworkInterfacesClientListResponse) (NetworkInterfacesClientListResponse, error) { + Fetcher: func(ctx context.Context, page *NetworkInterfacesClientListByNetworkDeviceResponse) (NetworkInterfacesClientListByNetworkDeviceResponse, error) { var req *policy.Request var err error if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, networkDeviceName, options) + req, err = client.listByNetworkDeviceCreateRequest(ctx, resourceGroupName, networkDeviceName, options) } else { req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return NetworkInterfacesClientListResponse{}, err + return NetworkInterfacesClientListByNetworkDeviceResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return NetworkInterfacesClientListResponse{}, err + return NetworkInterfacesClientListByNetworkDeviceResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkInterfacesClientListResponse{}, runtime.NewResponseError(resp) + return NetworkInterfacesClientListByNetworkDeviceResponse{}, runtime.NewResponseError(resp) } - return client.listHandleResponse(resp) + return client.listByNetworkDeviceHandleResponse(resp) }, }) } -// listCreateRequest creates the List request. -func (client *NetworkInterfacesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkInterfacesClientListOptions) (*policy.Request, error) { +// listByNetworkDeviceCreateRequest creates the ListByNetworkDevice request. +func (client *NetworkInterfacesClient) listByNetworkDeviceCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkInterfacesClientListByNetworkDeviceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -378,17 +294,17 @@ func (client *NetworkInterfacesClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// listHandleResponse handles the List response. -func (client *NetworkInterfacesClient) listHandleResponse(resp *http.Response) (NetworkInterfacesClientListResponse, error) { - result := NetworkInterfacesClientListResponse{} +// listByNetworkDeviceHandleResponse handles the ListByNetworkDevice response. +func (client *NetworkInterfacesClient) listByNetworkDeviceHandleResponse(resp *http.Response) (NetworkInterfacesClientListByNetworkDeviceResponse, error) { + result := NetworkInterfacesClientListByNetworkDeviceResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.NetworkInterfacesList); err != nil { - return NetworkInterfacesClientListResponse{}, err + return NetworkInterfacesClientListByNetworkDeviceResponse{}, err } return result, nil } @@ -396,10 +312,10 @@ func (client *NetworkInterfacesClient) listHandleResponse(resp *http.Response) ( // BeginUpdate - Update certain properties of the Network Interface resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the NetworkDevice -// - networkInterfaceName - Name of the NetworkInterfaceName +// - networkDeviceName - Name of the Network Device. +// - networkInterfaceName - Name of the Network Interface. // - body - NetworkInterface properties to update. Only tags are supported. // - options - NetworkInterfacesClientBeginUpdateOptions contains the optional parameters for the NetworkInterfacesClient.BeginUpdate // method. @@ -410,7 +326,7 @@ func (client *NetworkInterfacesClient) BeginUpdate(ctx context.Context, resource return nil, err } return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkInterfacesClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + FinalStateVia: runtime.FinalStateViaLocation, }) } else { return runtime.NewPollerFromResumeToken[NetworkInterfacesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) @@ -420,7 +336,7 @@ func (client *NetworkInterfacesClient) BeginUpdate(ctx context.Context, resource // Update - Update certain properties of the Network Interface resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *NetworkInterfacesClient) update(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, body NetworkInterfacePatch, options *NetworkInterfacesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, networkDeviceName, networkInterfaceName, body, options) if err != nil { @@ -439,9 +355,6 @@ func (client *NetworkInterfacesClient) update(ctx context.Context, resourceGroup // updateCreateRequest creates the Update request. func (client *NetworkInterfacesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, body NetworkInterfacePatch, options *NetworkInterfacesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -460,7 +373,7 @@ func (client *NetworkInterfacesClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -469,10 +382,10 @@ func (client *NetworkInterfacesClient) updateCreateRequest(ctx context.Context, // BeginUpdateAdministrativeState - Update the admin state of the Network Interface. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkDeviceName - Name of the NetworkDevice. -// - networkInterfaceName - Name of the NetworkInterface +// - networkDeviceName - Name of the Network Device. +// - networkInterfaceName - Name of the Network Interface. // - body - Request payload. // - options - NetworkInterfacesClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkInterfacesClient.BeginUpdateAdministrativeState // method. @@ -493,7 +406,7 @@ func (client *NetworkInterfacesClient) BeginUpdateAdministrativeState(ctx contex // UpdateAdministrativeState - Update the admin state of the Network Interface. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *NetworkInterfacesClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, body UpdateAdministrativeState, options *NetworkInterfacesClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, networkDeviceName, networkInterfaceName, body, options) if err != nil { @@ -503,7 +416,7 @@ func (client *NetworkInterfacesClient) updateAdministrativeState(ctx context.Con if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -512,9 +425,6 @@ func (client *NetworkInterfacesClient) updateAdministrativeState(ctx context.Con // updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. func (client *NetworkInterfacesClient) updateAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, body UpdateAdministrativeState, options *NetworkInterfacesClientBeginUpdateAdministrativeStateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}/updateAdministrativeState" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -533,7 +443,7 @@ func (client *NetworkInterfacesClient) updateAdministrativeStateCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkinterfaces_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkinterfaces_client_example_test.go index 45488724f723..238942c6cb3a 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkinterfaces_client_example_test.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkinterfaces_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_Create_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Create_MaximumSet_Gen.json func ExampleNetworkInterfacesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,9 +29,9 @@ func ExampleNetworkInterfacesClient_BeginCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkInterfacesClient().BeginCreate(ctx, "resourceGroupName", "networkDeviceName", "networkInterfaceName", armmanagednetworkfabric.NetworkInterface{ + poller, err := clientFactory.NewNetworkInterfacesClient().BeginCreate(ctx, "example-rg", "example-device", "example-interface", armmanagednetworkfabric.NetworkInterface{ Properties: &armmanagednetworkfabric.NetworkInterfaceProperties{ - Annotation: to.Ptr("null"), + Annotation: to.Ptr("annotation"), }, }, nil) if err != nil { @@ -45,31 +45,31 @@ func ExampleNetworkInterfacesClient_BeginCreate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkInterface = armmanagednetworkfabric.NetworkInterface{ - // Name: to.Ptr("networkInterfaceName"), + // Name: to.Ptr("example-interface"), // Type: to.Ptr("microsoft.managednetworkfabric/networkdevices/networkinterfaces"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName/networkInterfaces/networkInterfaceName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-device/networkInterfaces/example-interface"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T07:58:04.840Z"); return t}()), - // CreatedBy: to.Ptr("d1bd24c7-b27f-477e-86dd-939e107873d7"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T07:58:04.840Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Properties: &armmanagednetworkfabric.NetworkInterfaceProperties{ - // Annotation: to.Ptr("null"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // ConnectedTo: to.Ptr("null"), + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConnectedTo: to.Ptr("external-interface"), // InterfaceType: to.Ptr(armmanagednetworkfabric.InterfaceTypeManagement), // IPv4Address: to.Ptr("10.2.2.8"), // IPv6Address: to.Ptr("10:2:0:0::"), - // PhysicalIdentifier: to.Ptr("Ethernet1"), + // PhysicalIdentifier: to.Ptr("Id"), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_Get_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Get_MaximumSet_Gen.json func ExampleNetworkInterfacesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -80,7 +80,7 @@ func ExampleNetworkInterfacesClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewNetworkInterfacesClient().Get(ctx, "resourceGroupName", "networkDeviceName", "networkInterfaceName", nil) + res, err := clientFactory.NewNetworkInterfacesClient().Get(ctx, "example-rg", "example-device", "example-interface", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -88,31 +88,31 @@ func ExampleNetworkInterfacesClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkInterface = armmanagednetworkfabric.NetworkInterface{ - // Name: to.Ptr("networkInterfaceName"), + // Name: to.Ptr("example-interface"), // Type: to.Ptr("microsoft.managednetworkfabric/networkdevices/networkinterfaces"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName/networkInterfaces/networkInterfaceName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-device/networkInterfaces/example-interface"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T07:58:04.840Z"); return t}()), - // CreatedBy: to.Ptr("d1bd24c7-b27f-477e-86dd-939e107873d7"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T07:58:04.840Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Properties: &armmanagednetworkfabric.NetworkInterfaceProperties{ - // Annotation: to.Ptr("null"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // ConnectedTo: to.Ptr("null"), + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConnectedTo: to.Ptr("external-interface"), // InterfaceType: to.Ptr(armmanagednetworkfabric.InterfaceTypeManagement), // IPv4Address: to.Ptr("10.2.2.8"), // IPv6Address: to.Ptr("10:2:0:0::"), - // PhysicalIdentifier: to.Ptr("Ethernet1"), + // PhysicalIdentifier: to.Ptr("Id"), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_Update_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Update_MaximumSet_Gen.json func ExampleNetworkInterfacesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -123,9 +123,9 @@ func ExampleNetworkInterfacesClient_BeginUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkInterfacesClient().BeginUpdate(ctx, "resourceGroupName", "networkDeviceName", "networkInterfaceName", armmanagednetworkfabric.NetworkInterfacePatch{ + poller, err := clientFactory.NewNetworkInterfacesClient().BeginUpdate(ctx, "example-rg", "example-device", "example-interface", armmanagednetworkfabric.NetworkInterfacePatch{ Properties: &armmanagednetworkfabric.NetworkInterfacePatchProperties{ - Annotation: to.Ptr("null"), + Annotation: to.Ptr("annotation"), }, }, nil) if err != nil { @@ -139,31 +139,31 @@ func ExampleNetworkInterfacesClient_BeginUpdate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkInterface = armmanagednetworkfabric.NetworkInterface{ - // Name: to.Ptr("networkInterfaceName"), + // Name: to.Ptr("example-interface"), // Type: to.Ptr("microsoft.managednetworkfabric/networkdevices/networkinterfaces"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName/networkInterfaces/networkInterfaceName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-device/networkInterfaces/example-interface"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T07:58:04.840Z"); return t}()), - // CreatedBy: to.Ptr("d1bd24c7-b27f-477e-86dd-939e107873d7"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T07:58:04.840Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Properties: &armmanagednetworkfabric.NetworkInterfaceProperties{ - // Annotation: to.Ptr("null"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // ConnectedTo: to.Ptr("null"), + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConnectedTo: to.Ptr("external-interface"), // InterfaceType: to.Ptr(armmanagednetworkfabric.InterfaceTypeManagement), // IPv4Address: to.Ptr("10.2.2.8"), // IPv6Address: to.Ptr("10:2:0:0::"), - // PhysicalIdentifier: to.Ptr("Ethernet1"), + // PhysicalIdentifier: to.Ptr("Id"), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_Delete_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Delete_MaximumSet_Gen.json func ExampleNetworkInterfacesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -174,7 +174,7 @@ func ExampleNetworkInterfacesClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkInterfacesClient().BeginDelete(ctx, "resourceGroupName", "networkDeviceName", "networkInterfaceName", nil) + poller, err := clientFactory.NewNetworkInterfacesClient().BeginDelete(ctx, "rgNetworkDevices", "sjzd", "emrgu", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -184,8 +184,8 @@ func ExampleNetworkInterfacesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_List_MaximumSet_Gen.json -func ExampleNetworkInterfacesClient_NewListPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_ListByNetworkDevice_MaximumSet_Gen.json +func ExampleNetworkInterfacesClient_NewListByNetworkDevicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -195,7 +195,7 @@ func ExampleNetworkInterfacesClient_NewListPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewNetworkInterfacesClient().NewListPager("resourceGroupName", "networkDeviceName", nil) + pager := clientFactory.NewNetworkInterfacesClient().NewListByNetworkDevicePager("example-rg", "example-device", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -209,25 +209,25 @@ func ExampleNetworkInterfacesClient_NewListPager() { // page.NetworkInterfacesList = armmanagednetworkfabric.NetworkInterfacesList{ // Value: []*armmanagednetworkfabric.NetworkInterface{ // { - // Name: to.Ptr("networkInterfaceName"), + // Name: to.Ptr("example-interface"), // Type: to.Ptr("microsoft.managednetworkfabric/networkdevices/networkinterfaces"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName/networkInterfaces/networkInterfaceName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-device/networkInterfaces/example-interface"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T07:58:04.840Z"); return t}()), - // CreatedBy: to.Ptr("d1bd24c7-b27f-477e-86dd-939e107873d7"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-18T07:58:04.840Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Properties: &armmanagednetworkfabric.NetworkInterfaceProperties{ - // Annotation: to.Ptr("null"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // ConnectedTo: to.Ptr("null"), + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConnectedTo: to.Ptr("external-interface"), // InterfaceType: to.Ptr(armmanagednetworkfabric.InterfaceTypeManagement), // IPv4Address: to.Ptr("10.2.2.8"), // IPv6Address: to.Ptr("10:2:0:0::"), - // PhysicalIdentifier: to.Ptr("Ethernet1"), + // PhysicalIdentifier: to.Ptr("Id"), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // }}, @@ -235,28 +235,7 @@ func ExampleNetworkInterfacesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_getStatus_MaximumSet_Gen.json -func ExampleNetworkInterfacesClient_BeginGetStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkInterfacesClient().BeginGetStatus(ctx, "resourceGroupName", "networkDeviceName", "networkInterfaceName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_updateAdministrativeState_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_UpdateAdministrativeState_MaximumSet_Gen.json func ExampleNetworkInterfacesClient_BeginUpdateAdministrativeState() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -267,14 +246,35 @@ func ExampleNetworkInterfacesClient_BeginUpdateAdministrativeState() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkInterfacesClient().BeginUpdateAdministrativeState(ctx, "resourceGroupName", "networkDeviceName", "networkInterfaceName", armmanagednetworkfabric.UpdateAdministrativeState{ - State: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnable), + poller, err := clientFactory.NewNetworkInterfacesClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-device", "example-interface", armmanagednetworkfabric.UpdateAdministrativeState{ + ResourceIDs: []*string{ + to.Ptr("")}, + State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkpacketbrokers_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkpacketbrokers_client.go new file mode 100644 index 000000000000..17cfe34768ca --- /dev/null +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkpacketbrokers_client.go @@ -0,0 +1,413 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armmanagednetworkfabric + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// NetworkPacketBrokersClient contains the methods for the NetworkPacketBrokers group. +// Don't use this type directly, use NewNetworkPacketBrokersClient() instead. +type NetworkPacketBrokersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNetworkPacketBrokersClient creates a new instance of NetworkPacketBrokersClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewNetworkPacketBrokersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkPacketBrokersClient, error) { + cl, err := arm.NewClient(moduleName+".NetworkPacketBrokersClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NetworkPacketBrokersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Creates a Network Packet Broker. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkPacketBrokerName - Name of the Network Packet Broker. +// - body - Request payload. +// - options - NetworkPacketBrokersClientBeginCreateOptions contains the optional parameters for the NetworkPacketBrokersClient.BeginCreate +// method. +func (client *NetworkPacketBrokersClient) BeginCreate(ctx context.Context, resourceGroupName string, networkPacketBrokerName string, body NetworkPacketBroker, options *NetworkPacketBrokersClientBeginCreateOptions) (*runtime.Poller[NetworkPacketBrokersClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, networkPacketBrokerName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkPacketBrokersClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkPacketBrokersClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Create - Creates a Network Packet Broker. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkPacketBrokersClient) create(ctx context.Context, resourceGroupName string, networkPacketBrokerName string, body NetworkPacketBroker, options *NetworkPacketBrokersClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, networkPacketBrokerName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createCreateRequest creates the Create request. +func (client *NetworkPacketBrokersClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkPacketBrokerName string, body NetworkPacketBroker, options *NetworkPacketBrokersClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkPacketBrokerName == "" { + return nil, errors.New("parameter networkPacketBrokerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkPacketBrokerName}", url.PathEscape(networkPacketBrokerName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginDelete - Deletes Network Packet Broker. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkPacketBrokerName - Name of the Network Packet Broker. +// - options - NetworkPacketBrokersClientBeginDeleteOptions contains the optional parameters for the NetworkPacketBrokersClient.BeginDelete +// method. +func (client *NetworkPacketBrokersClient) BeginDelete(ctx context.Context, resourceGroupName string, networkPacketBrokerName string, options *NetworkPacketBrokersClientBeginDeleteOptions) (*runtime.Poller[NetworkPacketBrokersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkPacketBrokerName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkPacketBrokersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkPacketBrokersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes Network Packet Broker. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkPacketBrokersClient) deleteOperation(ctx context.Context, resourceGroupName string, networkPacketBrokerName string, options *NetworkPacketBrokersClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkPacketBrokerName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *NetworkPacketBrokersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkPacketBrokerName string, options *NetworkPacketBrokersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkPacketBrokerName == "" { + return nil, errors.New("parameter networkPacketBrokerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkPacketBrokerName}", url.PathEscape(networkPacketBrokerName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves details of this Network Packet Broker. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkPacketBrokerName - Name of the Network Packet Broker. +// - options - NetworkPacketBrokersClientGetOptions contains the optional parameters for the NetworkPacketBrokersClient.Get +// method. +func (client *NetworkPacketBrokersClient) Get(ctx context.Context, resourceGroupName string, networkPacketBrokerName string, options *NetworkPacketBrokersClientGetOptions) (NetworkPacketBrokersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkPacketBrokerName, options) + if err != nil { + return NetworkPacketBrokersClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkPacketBrokersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NetworkPacketBrokersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *NetworkPacketBrokersClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkPacketBrokerName string, options *NetworkPacketBrokersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkPacketBrokerName == "" { + return nil, errors.New("parameter networkPacketBrokerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkPacketBrokerName}", url.PathEscape(networkPacketBrokerName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *NetworkPacketBrokersClient) getHandleResponse(resp *http.Response) (NetworkPacketBrokersClientGetResponse, error) { + result := NetworkPacketBrokersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkPacketBroker); err != nil { + return NetworkPacketBrokersClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Displays NetworkPacketBrokers list by resource group GET method. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - NetworkPacketBrokersClientListByResourceGroupOptions contains the optional parameters for the NetworkPacketBrokersClient.NewListByResourceGroupPager +// method. +func (client *NetworkPacketBrokersClient) NewListByResourceGroupPager(resourceGroupName string, options *NetworkPacketBrokersClientListByResourceGroupOptions) *runtime.Pager[NetworkPacketBrokersClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkPacketBrokersClientListByResourceGroupResponse]{ + More: func(page NetworkPacketBrokersClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NetworkPacketBrokersClientListByResourceGroupResponse) (NetworkPacketBrokersClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NetworkPacketBrokersClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkPacketBrokersClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NetworkPacketBrokersClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *NetworkPacketBrokersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *NetworkPacketBrokersClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *NetworkPacketBrokersClient) listByResourceGroupHandleResponse(resp *http.Response) (NetworkPacketBrokersClientListByResourceGroupResponse, error) { + result := NetworkPacketBrokersClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkPacketBrokersListResult); err != nil { + return NetworkPacketBrokersClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Displays Network Packet Brokers list by subscription GET method. +// +// Generated from API version 2023-06-15 +// - options - NetworkPacketBrokersClientListBySubscriptionOptions contains the optional parameters for the NetworkPacketBrokersClient.NewListBySubscriptionPager +// method. +func (client *NetworkPacketBrokersClient) NewListBySubscriptionPager(options *NetworkPacketBrokersClientListBySubscriptionOptions) *runtime.Pager[NetworkPacketBrokersClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkPacketBrokersClientListBySubscriptionResponse]{ + More: func(page NetworkPacketBrokersClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NetworkPacketBrokersClientListBySubscriptionResponse) (NetworkPacketBrokersClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NetworkPacketBrokersClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkPacketBrokersClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NetworkPacketBrokersClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *NetworkPacketBrokersClient) listBySubscriptionCreateRequest(ctx context.Context, options *NetworkPacketBrokersClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *NetworkPacketBrokersClient) listBySubscriptionHandleResponse(resp *http.Response) (NetworkPacketBrokersClientListBySubscriptionResponse, error) { + result := NetworkPacketBrokersClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkPacketBrokersListResult); err != nil { + return NetworkPacketBrokersClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// BeginUpdate - API to update certain properties of the Network Packet Broker resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkPacketBrokerName - Name of the Network Packet Broker. +// - body - Network Packet Broker properties to update. +// - options - NetworkPacketBrokersClientBeginUpdateOptions contains the optional parameters for the NetworkPacketBrokersClient.BeginUpdate +// method. +func (client *NetworkPacketBrokersClient) BeginUpdate(ctx context.Context, resourceGroupName string, networkPacketBrokerName string, body NetworkPacketBrokerPatch, options *NetworkPacketBrokersClientBeginUpdateOptions) (*runtime.Poller[NetworkPacketBrokersClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, networkPacketBrokerName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkPacketBrokersClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkPacketBrokersClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - API to update certain properties of the Network Packet Broker resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkPacketBrokersClient) update(ctx context.Context, resourceGroupName string, networkPacketBrokerName string, body NetworkPacketBrokerPatch, options *NetworkPacketBrokersClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, networkPacketBrokerName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *NetworkPacketBrokersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, networkPacketBrokerName string, body NetworkPacketBrokerPatch, options *NetworkPacketBrokersClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkPacketBrokerName == "" { + return nil, errors.New("parameter networkPacketBrokerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkPacketBrokerName}", url.PathEscape(networkPacketBrokerName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkpacketbrokers_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkpacketbrokers_client_example_test.go new file mode 100644 index 000000000000..81836c304c5d --- /dev/null +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkpacketbrokers_client_example_test.go @@ -0,0 +1,321 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armmanagednetworkfabric_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Create_MaximumSet_Gen.json +func ExampleNetworkPacketBrokersClient_BeginCreate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkPacketBrokersClient().BeginCreate(ctx, "example-rg", "example-networkPacketBroker", armmanagednetworkfabric.NetworkPacketBroker{ + Location: to.Ptr("eastuseuap"), + Tags: map[string]*string{ + "key2806": to.Ptr("key"), + }, + Properties: &armmanagednetworkfabric.NetworkPacketBrokerProperties{ + NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.NetworkPacketBroker = armmanagednetworkfabric.NetworkPacketBroker{ + // Name: to.Ptr("example-networkPacketBroker"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkPacketBrokers"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastuseuap"), + // Tags: map[string]*string{ + // "key2806": to.Ptr("key"), + // }, + // Properties: &armmanagednetworkfabric.NetworkPacketBrokerProperties{ + // NeighborGroupIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, + // NetworkDeviceIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), + // NetworkTapIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // SourceInterfaceIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Get_MaximumSet_Gen.json +func ExampleNetworkPacketBrokersClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewNetworkPacketBrokersClient().Get(ctx, "example-rg", "example-networkPacketBroker", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.NetworkPacketBroker = armmanagednetworkfabric.NetworkPacketBroker{ + // Name: to.Ptr("example-networkPacketBroker"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkPacketBrokers"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastuseuap"), + // Tags: map[string]*string{ + // "key2806": to.Ptr("key"), + // }, + // Properties: &armmanagednetworkfabric.NetworkPacketBrokerProperties{ + // NeighborGroupIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, + // NetworkDeviceIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), + // NetworkTapIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // SourceInterfaceIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Update_MaximumSet_Gen.json +func ExampleNetworkPacketBrokersClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkPacketBrokersClient().BeginUpdate(ctx, "example-rg", "example-networkPacketBroker", armmanagednetworkfabric.NetworkPacketBrokerPatch{ + Tags: map[string]*string{ + "key8772": to.Ptr("1234"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.NetworkPacketBroker = armmanagednetworkfabric.NetworkPacketBroker{ + // Name: to.Ptr("example-networkPacketBroker"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkPacketBrokers"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastuseuap"), + // Tags: map[string]*string{ + // "key8772": to.Ptr("1234"), + // }, + // Properties: &armmanagednetworkfabric.NetworkPacketBrokerProperties{ + // NeighborGroupIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, + // NetworkDeviceIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), + // NetworkTapIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // SourceInterfaceIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Delete_MaximumSet_Gen.json +func ExampleNetworkPacketBrokersClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkPacketBrokersClient().BeginDelete(ctx, "example-rg", "example-networkPacketBroker", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_ListByResourceGroup_MaximumSet_Gen.json +func ExampleNetworkPacketBrokersClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewNetworkPacketBrokersClient().NewListByResourceGroupPager("example-rg", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.NetworkPacketBrokersListResult = armmanagednetworkfabric.NetworkPacketBrokersListResult{ + // Value: []*armmanagednetworkfabric.NetworkPacketBroker{ + // { + // Name: to.Ptr("example-networkPacketBroker"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkPacketBrokers"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastuseuap"), + // Tags: map[string]*string{ + // "key2806": to.Ptr("key"), + // }, + // Properties: &armmanagednetworkfabric.NetworkPacketBrokerProperties{ + // NeighborGroupIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, + // NetworkDeviceIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), + // NetworkTapIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // SourceInterfaceIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_ListBySubscription_MaximumSet_Gen.json +func ExampleNetworkPacketBrokersClient_NewListBySubscriptionPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewNetworkPacketBrokersClient().NewListBySubscriptionPager(nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.NetworkPacketBrokersListResult = armmanagednetworkfabric.NetworkPacketBrokersListResult{ + // Value: []*armmanagednetworkfabric.NetworkPacketBroker{ + // { + // Name: to.Ptr("example-networkPacketBroker"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkPacketBrokers"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastuseuap"), + // Tags: map[string]*string{ + // "key2806": to.Ptr("key"), + // }, + // Properties: &armmanagednetworkfabric.NetworkPacketBrokerProperties{ + // NeighborGroupIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, + // NetworkDeviceIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), + // NetworkTapIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // SourceInterfaceIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkracks_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkracks_client.go index b651b06ac95c..a70356175031 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkracks_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkracks_client.go @@ -29,7 +29,7 @@ type NetworkRacksClient struct { } // NewNetworkRacksClient creates a new instance of NetworkRacksClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewNetworkRacksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkRacksClient, error) { @@ -47,9 +47,9 @@ func NewNetworkRacksClient(subscriptionID string, credential azcore.TokenCredent // BeginCreate - Create Network Rack resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkRackName - Name of the Network Rack +// - networkRackName - Name of the Network Rack. // - body - Request payload. // - options - NetworkRacksClientBeginCreateOptions contains the optional parameters for the NetworkRacksClient.BeginCreate // method. @@ -70,7 +70,7 @@ func (client *NetworkRacksClient) BeginCreate(ctx context.Context, resourceGroup // Create - Create Network Rack resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *NetworkRacksClient) create(ctx context.Context, resourceGroupName string, networkRackName string, body NetworkRack, options *NetworkRacksClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, networkRackName, body, options) if err != nil { @@ -89,9 +89,6 @@ func (client *NetworkRacksClient) create(ctx context.Context, resourceGroupName // createCreateRequest creates the Create request. func (client *NetworkRacksClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkRackName string, body NetworkRack, options *NetworkRacksClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -106,7 +103,7 @@ func (client *NetworkRacksClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -115,9 +112,9 @@ func (client *NetworkRacksClient) createCreateRequest(ctx context.Context, resou // BeginDelete - Delete Network Rack resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkRackName - Name of the Network Rack +// - networkRackName - Name of the Network Rack. // - options - NetworkRacksClientBeginDeleteOptions contains the optional parameters for the NetworkRacksClient.BeginDelete // method. func (client *NetworkRacksClient) BeginDelete(ctx context.Context, resourceGroupName string, networkRackName string, options *NetworkRacksClientBeginDeleteOptions) (*runtime.Poller[NetworkRacksClientDeleteResponse], error) { @@ -137,7 +134,7 @@ func (client *NetworkRacksClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Delete Network Rack resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *NetworkRacksClient) deleteOperation(ctx context.Context, resourceGroupName string, networkRackName string, options *NetworkRacksClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkRackName, options) if err != nil { @@ -156,9 +153,6 @@ func (client *NetworkRacksClient) deleteOperation(ctx context.Context, resourceG // deleteCreateRequest creates the Delete request. func (client *NetworkRacksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkRackName string, options *NetworkRacksClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -173,7 +167,7 @@ func (client *NetworkRacksClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,9 +176,9 @@ func (client *NetworkRacksClient) deleteCreateRequest(ctx context.Context, resou // Get - Get Network Rack resource details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkRackName - Name of the Network Rack +// - networkRackName - Name of the Network Rack. // - options - NetworkRacksClientGetOptions contains the optional parameters for the NetworkRacksClient.Get method. func (client *NetworkRacksClient) Get(ctx context.Context, resourceGroupName string, networkRackName string, options *NetworkRacksClientGetOptions) (NetworkRacksClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, networkRackName, options) @@ -204,9 +198,6 @@ func (client *NetworkRacksClient) Get(ctx context.Context, resourceGroupName str // getCreateRequest creates the Get request. func (client *NetworkRacksClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkRackName string, options *NetworkRacksClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -221,7 +212,7 @@ func (client *NetworkRacksClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,7 +229,7 @@ func (client *NetworkRacksClient) getHandleResponse(resp *http.Response) (Networ // NewListByResourceGroupPager - List all Network Rack resources in the given resource group. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - NetworkRacksClientListByResourceGroupOptions contains the optional parameters for the NetworkRacksClient.NewListByResourceGroupPager // method. @@ -273,9 +264,6 @@ func (client *NetworkRacksClient) NewListByResourceGroupPager(resourceGroupName // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *NetworkRacksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *NetworkRacksClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -286,7 +274,7 @@ func (client *NetworkRacksClient) listByResourceGroupCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,7 +291,7 @@ func (client *NetworkRacksClient) listByResourceGroupHandleResponse(resp *http.R // NewListBySubscriptionPager - List all Network Rack resources in the given subscription // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - options - NetworkRacksClientListBySubscriptionOptions contains the optional parameters for the NetworkRacksClient.NewListBySubscriptionPager // method. func (client *NetworkRacksClient) NewListBySubscriptionPager(options *NetworkRacksClientListBySubscriptionOptions) *runtime.Pager[NetworkRacksClientListBySubscriptionResponse] { @@ -337,16 +325,13 @@ func (client *NetworkRacksClient) NewListBySubscriptionPager(options *NetworkRac // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *NetworkRacksClient) listBySubscriptionCreateRequest(ctx context.Context, options *NetworkRacksClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkRacks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -364,13 +349,13 @@ func (client *NetworkRacksClient) listBySubscriptionHandleResponse(resp *http.Re // BeginUpdate - Update certain properties of the Network Rack resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkRackName - Name of the Network Rack +// - networkRackName - Name of the Network Rack. // - body - Network Rack properties to update. // - options - NetworkRacksClientBeginUpdateOptions contains the optional parameters for the NetworkRacksClient.BeginUpdate // method. -func (client *NetworkRacksClient) BeginUpdate(ctx context.Context, resourceGroupName string, networkRackName string, body NetworkRackPatch, options *NetworkRacksClientBeginUpdateOptions) (*runtime.Poller[NetworkRacksClientUpdateResponse], error) { +func (client *NetworkRacksClient) BeginUpdate(ctx context.Context, resourceGroupName string, networkRackName string, body TagsUpdate, options *NetworkRacksClientBeginUpdateOptions) (*runtime.Poller[NetworkRacksClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, networkRackName, body, options) if err != nil { @@ -387,8 +372,8 @@ func (client *NetworkRacksClient) BeginUpdate(ctx context.Context, resourceGroup // Update - Update certain properties of the Network Rack resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview -func (client *NetworkRacksClient) update(ctx context.Context, resourceGroupName string, networkRackName string, body NetworkRackPatch, options *NetworkRacksClientBeginUpdateOptions) (*http.Response, error) { +// Generated from API version 2023-06-15 +func (client *NetworkRacksClient) update(ctx context.Context, resourceGroupName string, networkRackName string, body TagsUpdate, options *NetworkRacksClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, networkRackName, body, options) if err != nil { return nil, err @@ -404,11 +389,8 @@ func (client *NetworkRacksClient) update(ctx context.Context, resourceGroupName } // updateCreateRequest creates the Update request. -func (client *NetworkRacksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, networkRackName string, body NetworkRackPatch, options *NetworkRacksClientBeginUpdateOptions) (*policy.Request, error) { +func (client *NetworkRacksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, networkRackName string, body TagsUpdate, options *NetworkRacksClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -423,7 +405,7 @@ func (client *NetworkRacksClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkracks_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkracks_client_example_test.go index b5b345953c0d..e427701e45e5 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkracks_client_example_test.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkracks_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRacks_Create_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Create_MaximumSet_Gen.json func ExampleNetworkRacksClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,15 +29,15 @@ func ExampleNetworkRacksClient_BeginCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkRacksClient().BeginCreate(ctx, "resourceGroupName", "networkRackName", armmanagednetworkfabric.NetworkRack{ - Location: to.Ptr("eastus"), + poller, err := clientFactory.NewNetworkRacksClient().BeginCreate(ctx, "example-rg", "example-rack", armmanagednetworkfabric.NetworkRack{ + Location: to.Ptr("eastuseuap"), Tags: map[string]*string{ "keyID": to.Ptr("keyValue"), }, Properties: &armmanagednetworkfabric.NetworkRackProperties{ - Annotation: to.Ptr("null"), - NetworkFabricID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/networkFabricName"), - NetworkRackSKU: to.Ptr("RackSKU"), + Annotation: to.Ptr("annotation"), + NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), + NetworkRackType: to.Ptr(armmanagednetworkfabric.NetworkRackTypeAggregate), }, }, nil) if err != nil { @@ -51,33 +51,33 @@ func ExampleNetworkRacksClient_BeginCreate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkRack = armmanagednetworkfabric.NetworkRack{ - // Name: to.Ptr("networkRackName"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkracks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // Name: to.Ptr("example-rack"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkRacks"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T06:09:38.603Z"); return t}()), - // CreatedBy: to.Ptr("d1bd24c7-b27f-477e-86dd-939e107873d7"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T06:19:40.603Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), + // LastModifiedBy: to.Ptr("user@email.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("eastus"), + // Location: to.Ptr("eastuseuap"), // Tags: map[string]*string{ // "keyID": to.Ptr("keyValue"), // }, // Properties: &armmanagednetworkfabric.NetworkRackProperties{ - // Annotation: to.Ptr("null"), + // Annotation: to.Ptr("annotation"), // NetworkDevices: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName")}, - // NetworkFabricID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/networkFabricName"), - // NetworkRackSKU: to.Ptr("RackSKU"), + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), + // NetworkRackType: to.Ptr(armmanagednetworkfabric.NetworkRackTypeAggregate), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRacks_Get_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Get_MaximumSet_Gen.json func ExampleNetworkRacksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -88,7 +88,7 @@ func ExampleNetworkRacksClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewNetworkRacksClient().Get(ctx, "resourceGroupName", "networkRackName", nil) + res, err := clientFactory.NewNetworkRacksClient().Get(ctx, "example-rg", "example-rack", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -96,33 +96,33 @@ func ExampleNetworkRacksClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkRack = armmanagednetworkfabric.NetworkRack{ - // Name: to.Ptr("networkRackName"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkracks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // Name: to.Ptr("example-rack"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkRacks"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T06:09:38.603Z"); return t}()), - // CreatedBy: to.Ptr("d1bd24c7-b27f-477e-86dd-939e107873d7"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T06:19:40.603Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), + // LastModifiedBy: to.Ptr("user@email.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("eastus"), + // Location: to.Ptr("eastuseuap"), // Tags: map[string]*string{ // "keyID": to.Ptr("keyValue"), // }, // Properties: &armmanagednetworkfabric.NetworkRackProperties{ - // Annotation: to.Ptr("null"), + // Annotation: to.Ptr("annotation"), // NetworkDevices: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName")}, - // NetworkFabricID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/networkFabricName"), - // NetworkRackSKU: to.Ptr("RackSKU"), + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), + // NetworkRackType: to.Ptr(armmanagednetworkfabric.NetworkRackTypeAggregate), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRacks_Update_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Update_MaximumSet_Gen.json func ExampleNetworkRacksClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -133,8 +133,7 @@ func ExampleNetworkRacksClient_BeginUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkRacksClient().BeginUpdate(ctx, "resourceGroupName", "networkRackName", armmanagednetworkfabric.NetworkRackPatch{ - Properties: map[string]any{}, + poller, err := clientFactory.NewNetworkRacksClient().BeginUpdate(ctx, "example-rg", "example-rack", armmanagednetworkfabric.TagsUpdate{ Tags: map[string]*string{ "keyID": to.Ptr("keyValue"), }, @@ -150,33 +149,33 @@ func ExampleNetworkRacksClient_BeginUpdate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkRack = armmanagednetworkfabric.NetworkRack{ - // Name: to.Ptr("networkRackName"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkracks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // Name: to.Ptr("example-rack"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkRacks"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T06:09:38.603Z"); return t}()), - // CreatedBy: to.Ptr("d1bd24c7-b27f-477e-86dd-939e107873d7"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T06:19:40.603Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), + // LastModifiedBy: to.Ptr("user@email.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("eastus"), + // Location: to.Ptr("eastuseuap"), // Tags: map[string]*string{ // "keyID": to.Ptr("keyValue"), // }, // Properties: &armmanagednetworkfabric.NetworkRackProperties{ - // Annotation: to.Ptr("null"), + // Annotation: to.Ptr("annotation"), // NetworkDevices: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName")}, - // NetworkFabricID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/networkFabricName"), - // NetworkRackSKU: to.Ptr("RackSKU"), + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), + // NetworkRackType: to.Ptr(armmanagednetworkfabric.NetworkRackTypeAggregate), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRacks_Delete_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Delete_MaximumSet_Gen.json func ExampleNetworkRacksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -187,7 +186,7 @@ func ExampleNetworkRacksClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkRacksClient().BeginDelete(ctx, "resourceGroupName", "networkRackName", nil) + poller, err := clientFactory.NewNetworkRacksClient().BeginDelete(ctx, "example-rg", "example-rack", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -197,7 +196,7 @@ func ExampleNetworkRacksClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRacks_ListByResourceGroup_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_ListByResourceGroup_MaximumSet_Gen.json func ExampleNetworkRacksClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -208,7 +207,7 @@ func ExampleNetworkRacksClient_NewListByResourceGroupPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewNetworkRacksClient().NewListByResourceGroupPager("resourceGroupName", nil) + pager := clientFactory.NewNetworkRacksClient().NewListByResourceGroupPager("example-rg", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -222,27 +221,27 @@ func ExampleNetworkRacksClient_NewListByResourceGroupPager() { // page.NetworkRacksListResult = armmanagednetworkfabric.NetworkRacksListResult{ // Value: []*armmanagednetworkfabric.NetworkRack{ // { - // Name: to.Ptr("networkRackName"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkracks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // Name: to.Ptr("example-rack"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkRacks"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T06:09:38.603Z"); return t}()), - // CreatedBy: to.Ptr("d1bd24c7-b27f-477e-86dd-939e107873d7"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T06:19:40.603Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), + // LastModifiedBy: to.Ptr("user@email.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("eastus"), + // Location: to.Ptr("eastuseuap"), // Tags: map[string]*string{ // "keyID": to.Ptr("keyValue"), // }, // Properties: &armmanagednetworkfabric.NetworkRackProperties{ - // Annotation: to.Ptr("null"), + // Annotation: to.Ptr("annotation"), // NetworkDevices: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName")}, - // NetworkFabricID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/networkFabricName"), - // NetworkRackSKU: to.Ptr("RackSKU"), + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), + // NetworkRackType: to.Ptr(armmanagednetworkfabric.NetworkRackTypeAggregate), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // }}, @@ -250,7 +249,7 @@ func ExampleNetworkRacksClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRacks_ListBySubscription_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_ListBySubscription_MaximumSet_Gen.json func ExampleNetworkRacksClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -275,27 +274,27 @@ func ExampleNetworkRacksClient_NewListBySubscriptionPager() { // page.NetworkRacksListResult = armmanagednetworkfabric.NetworkRacksListResult{ // Value: []*armmanagednetworkfabric.NetworkRack{ // { - // Name: to.Ptr("networkRackName"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkracks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // Name: to.Ptr("example-rack"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkRacks"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T06:09:38.603Z"); return t}()), - // CreatedBy: to.Ptr("d1bd24c7-b27f-477e-86dd-939e107873d7"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T06:19:40.603Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), + // LastModifiedBy: to.Ptr("user@email.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("eastus"), + // Location: to.Ptr("eastuseuap"), // Tags: map[string]*string{ // "keyID": to.Ptr("keyValue"), // }, // Properties: &armmanagednetworkfabric.NetworkRackProperties{ - // Annotation: to.Ptr("null"), + // Annotation: to.Ptr("annotation"), // NetworkDevices: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName")}, - // NetworkFabricID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/networkFabricName"), - // NetworkRackSKU: to.Ptr("RackSKU"), + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), + // NetworkRackType: to.Ptr(armmanagednetworkfabric.NetworkRackTypeAggregate), // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // }}, diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkrackskus_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkrackskus_client.go deleted file mode 100644 index 48d6ab6a29b0..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkrackskus_client.go +++ /dev/null @@ -1,157 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmanagednetworkfabric - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// NetworkRackSKUsClient contains the methods for the NetworkRackSKUs group. -// Don't use this type directly, use NewNetworkRackSKUsClient() instead. -type NetworkRackSKUsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewNetworkRackSKUsClient creates a new instance of NetworkRackSKUsClient with the specified values. -// - subscriptionID - The ID of the target subscription. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewNetworkRackSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkRackSKUsClient, error) { - cl, err := arm.NewClient(moduleName+".NetworkRackSKUsClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &NetworkRackSKUsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Get Network Rack SKU resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -// - networkRackSKUName - Name of the Network Rack Sku -// - options - NetworkRackSKUsClientGetOptions contains the optional parameters for the NetworkRackSKUsClient.Get method. -func (client *NetworkRackSKUsClient) Get(ctx context.Context, networkRackSKUName string, options *NetworkRackSKUsClientGetOptions) (NetworkRackSKUsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, networkRackSKUName, options) - if err != nil { - return NetworkRackSKUsClientGetResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return NetworkRackSKUsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkRackSKUsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *NetworkRackSKUsClient) getCreateRequest(ctx context.Context, networkRackSKUName string, options *NetworkRackSKUsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkRackSkus/{networkRackSkuName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if networkRackSKUName == "" { - return nil, errors.New("parameter networkRackSKUName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkRackSkuName}", url.PathEscape(networkRackSKUName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *NetworkRackSKUsClient) getHandleResponse(resp *http.Response) (NetworkRackSKUsClientGetResponse, error) { - result := NetworkRackSKUsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.NetworkRackSKU); err != nil { - return NetworkRackSKUsClientGetResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - List all Network Rack SKUs in the given subscription. -// -// Generated from API version 2023-02-01-preview -// - options - NetworkRackSKUsClientListBySubscriptionOptions contains the optional parameters for the NetworkRackSKUsClient.NewListBySubscriptionPager -// method. -func (client *NetworkRackSKUsClient) NewListBySubscriptionPager(options *NetworkRackSKUsClientListBySubscriptionOptions) *runtime.Pager[NetworkRackSKUsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[NetworkRackSKUsClientListBySubscriptionResponse]{ - More: func(page NetworkRackSKUsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *NetworkRackSKUsClientListBySubscriptionResponse) (NetworkRackSKUsClientListBySubscriptionResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listBySubscriptionCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return NetworkRackSKUsClientListBySubscriptionResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return NetworkRackSKUsClientListBySubscriptionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkRackSKUsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) - } - return client.listBySubscriptionHandleResponse(resp) - }, - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *NetworkRackSKUsClient) listBySubscriptionCreateRequest(ctx context.Context, options *NetworkRackSKUsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkRackSkus" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *NetworkRackSKUsClient) listBySubscriptionHandleResponse(resp *http.Response) (NetworkRackSKUsClientListBySubscriptionResponse, error) { - result := NetworkRackSKUsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.NetworkRackSKUsListResult); err != nil { - return NetworkRackSKUsClientListBySubscriptionResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkrackskus_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkrackskus_client_example_test.go deleted file mode 100644 index 585b04b27185..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkrackskus_client_example_test.go +++ /dev/null @@ -1,116 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmanagednetworkfabric_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRackSkus_Get_MaximumSet_Gen.json -func ExampleNetworkRackSKUsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNetworkRackSKUsClient().Get(ctx, "networkRackSkuName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NetworkRackSKU = armmanagednetworkfabric.NetworkRackSKU{ - // Name: to.Ptr("networkRackSkuName"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkrackskus"), - // ID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.ManagedNetworkFabric/networkRackSkus/networkRackSkuName"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T06:09:38.603Z"); return t}()), - // CreatedBy: to.Ptr("d1bd24c7-b27f-477e-86dd-939e107873d7"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T06:19:40.603Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.NetworkRackSKUProperties{ - // MaximumServerCount: to.Ptr[int32](19), - // MaximumStorageCount: to.Ptr[int32](18), - // MaximumUplinks: to.Ptr[int32](12), - // NetworkDevices: []*armmanagednetworkfabric.NetworkDeviceRoleProperties{ - // { - // NetworkDeviceSKUName: to.Ptr("DefaultSku"), - // RackSlot: to.Ptr[int32](8), - // RoleType: to.Ptr(armmanagednetworkfabric.NetworkDeviceRackRoleTypeCE), - // }}, - // RoleName: to.Ptr(armmanagednetworkfabric.NetworkRackRoleNameComputeRack), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRackSkus_ListBySubscription_MaximumSet_Gen.json -func ExampleNetworkRackSKUsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkRackSKUsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NetworkRackSKUsListResult = armmanagednetworkfabric.NetworkRackSKUsListResult{ - // Value: []*armmanagednetworkfabric.NetworkRackSKU{ - // { - // Name: to.Ptr("networkRackSkuName"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkrackskus"), - // ID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.ManagedNetworkFabric/networkRackSkus/networkRackSkuName"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T06:09:38.603Z"); return t}()), - // CreatedBy: to.Ptr("d1bd24c7-b27f-477e-86dd-939e107873d7"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-16T06:19:40.603Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.NetworkRackSKUProperties{ - // MaximumServerCount: to.Ptr[int32](19), - // MaximumStorageCount: to.Ptr[int32](18), - // MaximumUplinks: to.Ptr[int32](12), - // NetworkDevices: []*armmanagednetworkfabric.NetworkDeviceRoleProperties{ - // { - // NetworkDeviceSKUName: to.Ptr("DefaultSku"), - // RackSlot: to.Ptr[int32](8), - // RoleType: to.Ptr(armmanagednetworkfabric.NetworkDeviceRackRoleTypeCE), - // }}, - // RoleName: to.Ptr(armmanagednetworkfabric.NetworkRackRoleNameComputeRack), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaprules_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaprules_client.go new file mode 100644 index 000000000000..df2f91064257 --- /dev/null +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaprules_client.go @@ -0,0 +1,605 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armmanagednetworkfabric + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// NetworkTapRulesClient contains the methods for the NetworkTapRules group. +// Don't use this type directly, use NewNetworkTapRulesClient() instead. +type NetworkTapRulesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNetworkTapRulesClient creates a new instance of NetworkTapRulesClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewNetworkTapRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkTapRulesClient, error) { + cl, err := arm.NewClient(moduleName+".NetworkTapRulesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NetworkTapRulesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Create Network Tap Rule resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkTapRuleName - Name of the Network Tap Rule. +// - body - Request payload. +// - options - NetworkTapRulesClientBeginCreateOptions contains the optional parameters for the NetworkTapRulesClient.BeginCreate +// method. +func (client *NetworkTapRulesClient) BeginCreate(ctx context.Context, resourceGroupName string, networkTapRuleName string, body NetworkTapRule, options *NetworkTapRulesClientBeginCreateOptions) (*runtime.Poller[NetworkTapRulesClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, networkTapRuleName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapRulesClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkTapRulesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Create - Create Network Tap Rule resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkTapRulesClient) create(ctx context.Context, resourceGroupName string, networkTapRuleName string, body NetworkTapRule, options *NetworkTapRulesClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, networkTapRuleName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createCreateRequest creates the Create request. +func (client *NetworkTapRulesClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkTapRuleName string, body NetworkTapRule, options *NetworkTapRulesClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkTapRuleName == "" { + return nil, errors.New("parameter networkTapRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkTapRuleName}", url.PathEscape(networkTapRuleName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginDelete - Delete Network Tap Rule resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkTapRuleName - Name of the Network Tap Rule. +// - options - NetworkTapRulesClientBeginDeleteOptions contains the optional parameters for the NetworkTapRulesClient.BeginDelete +// method. +func (client *NetworkTapRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkTapRuleName string, options *NetworkTapRulesClientBeginDeleteOptions) (*runtime.Poller[NetworkTapRulesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkTapRuleName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapRulesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkTapRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete Network Tap Rule resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkTapRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkTapRuleName string, options *NetworkTapRulesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkTapRuleName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *NetworkTapRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkTapRuleName string, options *NetworkTapRulesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkTapRuleName == "" { + return nil, errors.New("parameter networkTapRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkTapRuleName}", url.PathEscape(networkTapRuleName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get Network Tap Rule resource details. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkTapRuleName - Name of the Network Tap Rule. +// - options - NetworkTapRulesClientGetOptions contains the optional parameters for the NetworkTapRulesClient.Get method. +func (client *NetworkTapRulesClient) Get(ctx context.Context, resourceGroupName string, networkTapRuleName string, options *NetworkTapRulesClientGetOptions) (NetworkTapRulesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkTapRuleName, options) + if err != nil { + return NetworkTapRulesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkTapRulesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NetworkTapRulesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *NetworkTapRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkTapRuleName string, options *NetworkTapRulesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkTapRuleName == "" { + return nil, errors.New("parameter networkTapRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkTapRuleName}", url.PathEscape(networkTapRuleName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *NetworkTapRulesClient) getHandleResponse(resp *http.Response) (NetworkTapRulesClientGetResponse, error) { + result := NetworkTapRulesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkTapRule); err != nil { + return NetworkTapRulesClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - List all the Network Tap Rule resources in the given resource group. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - NetworkTapRulesClientListByResourceGroupOptions contains the optional parameters for the NetworkTapRulesClient.NewListByResourceGroupPager +// method. +func (client *NetworkTapRulesClient) NewListByResourceGroupPager(resourceGroupName string, options *NetworkTapRulesClientListByResourceGroupOptions) *runtime.Pager[NetworkTapRulesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkTapRulesClientListByResourceGroupResponse]{ + More: func(page NetworkTapRulesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NetworkTapRulesClientListByResourceGroupResponse) (NetworkTapRulesClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NetworkTapRulesClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkTapRulesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NetworkTapRulesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *NetworkTapRulesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *NetworkTapRulesClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *NetworkTapRulesClient) listByResourceGroupHandleResponse(resp *http.Response) (NetworkTapRulesClientListByResourceGroupResponse, error) { + result := NetworkTapRulesClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkTapRulesListResult); err != nil { + return NetworkTapRulesClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List all the Network Tap Rule resources in the given subscription. +// +// Generated from API version 2023-06-15 +// - options - NetworkTapRulesClientListBySubscriptionOptions contains the optional parameters for the NetworkTapRulesClient.NewListBySubscriptionPager +// method. +func (client *NetworkTapRulesClient) NewListBySubscriptionPager(options *NetworkTapRulesClientListBySubscriptionOptions) *runtime.Pager[NetworkTapRulesClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkTapRulesClientListBySubscriptionResponse]{ + More: func(page NetworkTapRulesClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NetworkTapRulesClientListBySubscriptionResponse) (NetworkTapRulesClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NetworkTapRulesClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkTapRulesClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NetworkTapRulesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *NetworkTapRulesClient) listBySubscriptionCreateRequest(ctx context.Context, options *NetworkTapRulesClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkTapRules" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *NetworkTapRulesClient) listBySubscriptionHandleResponse(resp *http.Response) (NetworkTapRulesClientListBySubscriptionResponse, error) { + result := NetworkTapRulesClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkTapRulesListResult); err != nil { + return NetworkTapRulesClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// BeginResync - Implements the operation to the underlying resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkTapRuleName - Name of the Network Tap Rule. +// - options - NetworkTapRulesClientBeginResyncOptions contains the optional parameters for the NetworkTapRulesClient.BeginResync +// method. +func (client *NetworkTapRulesClient) BeginResync(ctx context.Context, resourceGroupName string, networkTapRuleName string, options *NetworkTapRulesClientBeginResyncOptions) (*runtime.Poller[NetworkTapRulesClientResyncResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.resync(ctx, resourceGroupName, networkTapRuleName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapRulesClientResyncResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkTapRulesClientResyncResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Resync - Implements the operation to the underlying resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkTapRulesClient) resync(ctx context.Context, resourceGroupName string, networkTapRuleName string, options *NetworkTapRulesClientBeginResyncOptions) (*http.Response, error) { + req, err := client.resyncCreateRequest(ctx, resourceGroupName, networkTapRuleName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// resyncCreateRequest creates the Resync request. +func (client *NetworkTapRulesClient) resyncCreateRequest(ctx context.Context, resourceGroupName string, networkTapRuleName string, options *NetworkTapRulesClientBeginResyncOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/resync" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkTapRuleName == "" { + return nil, errors.New("parameter networkTapRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkTapRuleName}", url.PathEscape(networkTapRuleName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginUpdate - Update certain properties of the Network Tap Rule resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkTapRuleName - Name of the Network Tap Rule. +// - body - Network Tap Rule properties to update. +// - options - NetworkTapRulesClientBeginUpdateOptions contains the optional parameters for the NetworkTapRulesClient.BeginUpdate +// method. +func (client *NetworkTapRulesClient) BeginUpdate(ctx context.Context, resourceGroupName string, networkTapRuleName string, body NetworkTapRulePatch, options *NetworkTapRulesClientBeginUpdateOptions) (*runtime.Poller[NetworkTapRulesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, networkTapRuleName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapRulesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkTapRulesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Update certain properties of the Network Tap Rule resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkTapRulesClient) update(ctx context.Context, resourceGroupName string, networkTapRuleName string, body NetworkTapRulePatch, options *NetworkTapRulesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, networkTapRuleName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *NetworkTapRulesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, networkTapRuleName string, body NetworkTapRulePatch, options *NetworkTapRulesClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkTapRuleName == "" { + return nil, errors.New("parameter networkTapRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkTapRuleName}", url.PathEscape(networkTapRuleName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginUpdateAdministrativeState - Implements the operation to the underlying resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkTapRuleName - Name of the Network Tap Rule. +// - body - Request payload. +// - options - NetworkTapRulesClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkTapRulesClient.BeginUpdateAdministrativeState +// method. +func (client *NetworkTapRulesClient) BeginUpdateAdministrativeState(ctx context.Context, resourceGroupName string, networkTapRuleName string, body UpdateAdministrativeState, options *NetworkTapRulesClientBeginUpdateAdministrativeStateOptions) (*runtime.Poller[NetworkTapRulesClientUpdateAdministrativeStateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateAdministrativeState(ctx, resourceGroupName, networkTapRuleName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapRulesClientUpdateAdministrativeStateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkTapRulesClientUpdateAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateAdministrativeState - Implements the operation to the underlying resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkTapRulesClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, networkTapRuleName string, body UpdateAdministrativeState, options *NetworkTapRulesClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { + req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, networkTapRuleName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. +func (client *NetworkTapRulesClient) updateAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, networkTapRuleName string, body UpdateAdministrativeState, options *NetworkTapRulesClientBeginUpdateAdministrativeStateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/updateAdministrativeState" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkTapRuleName == "" { + return nil, errors.New("parameter networkTapRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkTapRuleName}", url.PathEscape(networkTapRuleName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginValidateConfiguration - Implements the operation to the underlying resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkTapRuleName - Name of the Network Tap Rule. +// - options - NetworkTapRulesClientBeginValidateConfigurationOptions contains the optional parameters for the NetworkTapRulesClient.BeginValidateConfiguration +// method. +func (client *NetworkTapRulesClient) BeginValidateConfiguration(ctx context.Context, resourceGroupName string, networkTapRuleName string, options *NetworkTapRulesClientBeginValidateConfigurationOptions) (*runtime.Poller[NetworkTapRulesClientValidateConfigurationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.validateConfiguration(ctx, resourceGroupName, networkTapRuleName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapRulesClientValidateConfigurationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkTapRulesClientValidateConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ValidateConfiguration - Implements the operation to the underlying resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkTapRulesClient) validateConfiguration(ctx context.Context, resourceGroupName string, networkTapRuleName string, options *NetworkTapRulesClientBeginValidateConfigurationOptions) (*http.Response, error) { + req, err := client.validateConfigurationCreateRequest(ctx, resourceGroupName, networkTapRuleName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// validateConfigurationCreateRequest creates the ValidateConfiguration request. +func (client *NetworkTapRulesClient) validateConfigurationCreateRequest(ctx context.Context, resourceGroupName string, networkTapRuleName string, options *NetworkTapRulesClientBeginValidateConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/validateConfiguration" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkTapRuleName == "" { + return nil, errors.New("parameter networkTapRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkTapRuleName}", url.PathEscape(networkTapRuleName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaprules_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaprules_client_example_test.go new file mode 100644 index 000000000000..ba59eb40474c --- /dev/null +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaprules_client_example_test.go @@ -0,0 +1,953 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armmanagednetworkfabric_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Create_MaximumSet_Gen.json +func ExampleNetworkTapRulesClient_BeginCreate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkTapRulesClient().BeginCreate(ctx, "example-rg", "example-tapRule", armmanagednetworkfabric.NetworkTapRule{ + Location: to.Ptr("eastus"), + Tags: map[string]*string{ + "keyID": to.Ptr("keyValue"), + }, + Properties: &armmanagednetworkfabric.NetworkTapRuleProperties{ + Annotation: to.Ptr("annotation"), + ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), + DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ + { + IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ + { + Name: to.Ptr("example-ipGroup1"), + IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + IPPrefixes: []*string{ + to.Ptr("10.10.10.10/30")}, + }}, + PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ + { + Name: to.Ptr("example-portGroup1"), + Ports: []*string{ + to.Ptr("100-200")}, + }, + { + Name: to.Ptr("example-portGroup2"), + Ports: []*string{ + to.Ptr("900"), + to.Ptr("1000-2000")}, + }}, + VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ + { + Name: to.Ptr("exmaple-vlanGroup"), + Vlans: []*string{ + to.Ptr("10"), + to.Ptr("100-200")}, + }}, + }}, + MatchConfigurations: []*armmanagednetworkfabric.NetworkTapRuleMatchConfiguration{ + { + Actions: []*armmanagednetworkfabric.NetworkTapRuleAction{ + { + Type: to.Ptr(armmanagednetworkfabric.TapRuleActionTypeDrop), + DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), + IsTimestampEnabled: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), + MatchConfigurationName: to.Ptr("match1"), + Truncate: to.Ptr("100"), + }}, + IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + MatchConditions: []*armmanagednetworkfabric.NetworkTapRuleMatchCondition{ + { + IPCondition: &armmanagednetworkfabric.IPMatchCondition{ + Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), + IPGroupNames: []*string{ + to.Ptr("example-ipGroup")}, + IPPrefixValues: []*string{ + to.Ptr("10.10.10.10/20")}, + PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), + }, + ProtocolTypes: []*string{ + to.Ptr("TCP")}, + VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ + InnerVlans: []*string{ + to.Ptr("11-20")}, + VlanGroupNames: []*string{ + to.Ptr("exmaple-vlanGroup")}, + Vlans: []*string{ + to.Ptr("10")}, + }, + EncapsulationType: to.Ptr(armmanagednetworkfabric.EncapsulationTypeNone), + PortCondition: &armmanagednetworkfabric.PortCondition{ + Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), + PortGroupNames: []*string{ + to.Ptr("example-portGroup1")}, + PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), + Ports: []*string{ + to.Ptr("100")}, + }, + }}, + MatchConfigurationName: to.Ptr("config1"), + SequenceNumber: to.Ptr[int64](10), + }}, + TapRulesURL: to.Ptr("https://microsoft.com/a"), + PollingIntervalInSeconds: to.Ptr(armmanagednetworkfabric.PollingIntervalInSeconds(30)), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.NetworkTapRule = armmanagednetworkfabric.NetworkTapRule{ + // Name: to.Ptr("example-tapRule"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkTapRules"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-tapRule"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastuseuap"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("keyValue"), + // }, + // Properties: &armmanagednetworkfabric.NetworkTapRuleProperties{ + // Annotation: to.Ptr("annotation"), + // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), + // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ + // { + // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ + // { + // Name: to.Ptr("example-ipGroup1"), + // IPPrefixes: []*string{ + // to.Ptr("10.10.10.10/30")}, + // }}, + // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ + // { + // Name: to.Ptr("example-portGroup1"), + // Ports: []*string{ + // to.Ptr("100-200")}, + // }, + // { + // Name: to.Ptr("example-portGroup2"), + // Ports: []*string{ + // to.Ptr("900"), + // to.Ptr("1000-2000")}, + // }}, + // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ + // { + // Name: to.Ptr("exmaple-vlanGroup"), + // Vlans: []*string{ + // to.Ptr("10"), + // to.Ptr("100-200")}, + // }}, + // }}, + // MatchConfigurations: []*armmanagednetworkfabric.NetworkTapRuleMatchConfiguration{ + // { + // Actions: []*armmanagednetworkfabric.NetworkTapRuleAction{ + // { + // Type: to.Ptr(armmanagednetworkfabric.TapRuleActionTypeDrop), + // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), + // IsTimestampEnabled: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), + // MatchConfigurationName: to.Ptr("match1"), + // Truncate: to.Ptr("100"), + // }}, + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // MatchConditions: []*armmanagednetworkfabric.NetworkTapRuleMatchCondition{ + // { + // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ + // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), + // IPGroupNames: []*string{ + // to.Ptr("example-ipGroup")}, + // IPPrefixValues: []*string{ + // to.Ptr("10.10.10.10/20")}, + // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), + // }, + // ProtocolTypes: []*string{ + // to.Ptr("TCP")}, + // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ + // InnerVlans: []*string{ + // to.Ptr("11-20")}, + // VlanGroupNames: []*string{ + // to.Ptr("exmaple-vlanGroup")}, + // Vlans: []*string{ + // to.Ptr("10")}, + // }, + // EncapsulationType: to.Ptr(armmanagednetworkfabric.EncapsulationTypeNone), + // PortCondition: &armmanagednetworkfabric.PortCondition{ + // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), + // PortGroupNames: []*string{ + // to.Ptr("example-portGroup1")}, + // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), + // Ports: []*string{ + // to.Ptr("100")}, + // }, + // }}, + // MatchConfigurationName: to.Ptr("config1"), + // SequenceNumber: to.Ptr[int64](10), + // }}, + // TapRulesURL: to.Ptr("https://microsoft.com/a"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.485Z"); return t}()), + // NetworkTapID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-tap"), + // PollingIntervalInSeconds: to.Ptr(armmanagednetworkfabric.PollingIntervalInSeconds(30)), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Get_MaximumSet_Gen.json +func ExampleNetworkTapRulesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewNetworkTapRulesClient().Get(ctx, "example-rg", "example-tapRule", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.NetworkTapRule = armmanagednetworkfabric.NetworkTapRule{ + // Name: to.Ptr("example-tapRule"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkTapRules"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-tapRule"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastuseuap"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("keyValue"), + // }, + // Properties: &armmanagednetworkfabric.NetworkTapRuleProperties{ + // Annotation: to.Ptr("annotation"), + // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), + // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ + // { + // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ + // { + // Name: to.Ptr("example-ipGroup1"), + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // IPPrefixes: []*string{ + // to.Ptr("10.10.10.10/30")}, + // }}, + // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ + // { + // Name: to.Ptr("example-portGroup1"), + // Ports: []*string{ + // to.Ptr("100-200")}, + // }, + // { + // Name: to.Ptr("example-portGroup2"), + // Ports: []*string{ + // to.Ptr("900"), + // to.Ptr("1000-2000")}, + // }}, + // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ + // { + // Name: to.Ptr("exmaple-vlanGroup"), + // Vlans: []*string{ + // to.Ptr("10"), + // to.Ptr("100-200")}, + // }}, + // }}, + // MatchConfigurations: []*armmanagednetworkfabric.NetworkTapRuleMatchConfiguration{ + // { + // Actions: []*armmanagednetworkfabric.NetworkTapRuleAction{ + // { + // Type: to.Ptr(armmanagednetworkfabric.TapRuleActionTypeDrop), + // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), + // IsTimestampEnabled: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), + // MatchConfigurationName: to.Ptr("match1"), + // Truncate: to.Ptr("100"), + // }}, + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // MatchConditions: []*armmanagednetworkfabric.NetworkTapRuleMatchCondition{ + // { + // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ + // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), + // IPGroupNames: []*string{ + // to.Ptr("example-ipGroup")}, + // IPPrefixValues: []*string{ + // to.Ptr("10.10.10.10/20")}, + // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), + // }, + // ProtocolTypes: []*string{ + // to.Ptr("TCP")}, + // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ + // InnerVlans: []*string{ + // to.Ptr("11-20")}, + // VlanGroupNames: []*string{ + // to.Ptr("exmaple-vlanGroup")}, + // Vlans: []*string{ + // to.Ptr("10")}, + // }, + // EncapsulationType: to.Ptr(armmanagednetworkfabric.EncapsulationTypeNone), + // PortCondition: &armmanagednetworkfabric.PortCondition{ + // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), + // PortGroupNames: []*string{ + // to.Ptr("example-portGroup1")}, + // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), + // Ports: []*string{ + // to.Ptr("100")}, + // }, + // }}, + // MatchConfigurationName: to.Ptr("config1"), + // SequenceNumber: to.Ptr[int64](10), + // }}, + // TapRulesURL: to.Ptr("https://microsoft.com/a"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.485Z"); return t}()), + // NetworkTapID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-tap"), + // PollingIntervalInSeconds: to.Ptr(armmanagednetworkfabric.PollingIntervalInSeconds(30)), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Update_MaximumSet_Gen.json +func ExampleNetworkTapRulesClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkTapRulesClient().BeginUpdate(ctx, "example-rg", "example-tapRule", armmanagednetworkfabric.NetworkTapRulePatch{ + Tags: map[string]*string{ + "keyID": to.Ptr("keyValue"), + }, + Properties: &armmanagednetworkfabric.NetworkTapRulePatchProperties{ + Annotation: to.Ptr("annotation"), + ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), + DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ + { + IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ + { + Name: to.Ptr("example-ipGroup1"), + IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + IPPrefixes: []*string{ + to.Ptr("10.10.10.10/30")}, + }}, + PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ + { + Name: to.Ptr("example-portGroup1"), + Ports: []*string{ + to.Ptr("100-200")}, + }}, + VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ + { + Name: to.Ptr("exmaple-vlanGroup"), + Vlans: []*string{ + to.Ptr("10"), + to.Ptr("100-200")}, + }}, + }}, + MatchConfigurations: []*armmanagednetworkfabric.NetworkTapRuleMatchConfiguration{ + { + Actions: []*armmanagednetworkfabric.NetworkTapRuleAction{ + { + Type: to.Ptr(armmanagednetworkfabric.TapRuleActionTypeGoto), + DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), + IsTimestampEnabled: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), + MatchConfigurationName: to.Ptr("match1"), + Truncate: to.Ptr("100"), + }}, + IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + MatchConditions: []*armmanagednetworkfabric.NetworkTapRuleMatchCondition{ + { + IPCondition: &armmanagednetworkfabric.IPMatchCondition{ + Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), + IPGroupNames: []*string{ + to.Ptr("example-ipGroup")}, + IPPrefixValues: []*string{ + to.Ptr("10.10.10.10/20")}, + PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), + }, + ProtocolTypes: []*string{ + to.Ptr("TCP")}, + VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ + InnerVlans: []*string{ + to.Ptr("11-20")}, + VlanGroupNames: []*string{ + to.Ptr("exmaple-vlanGroup")}, + Vlans: []*string{ + to.Ptr("10")}, + }, + EncapsulationType: to.Ptr(armmanagednetworkfabric.EncapsulationTypeNone), + PortCondition: &armmanagednetworkfabric.PortCondition{ + Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), + PortGroupNames: []*string{ + to.Ptr("example-portGroup1")}, + PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), + Ports: []*string{ + to.Ptr("100")}, + }, + }}, + MatchConfigurationName: to.Ptr("config1"), + SequenceNumber: to.Ptr[int64](10), + }}, + TapRulesURL: to.Ptr("https://microsoft.com/amdsdx"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.NetworkTapRule = armmanagednetworkfabric.NetworkTapRule{ + // Name: to.Ptr("example-tapRule"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkTapRules"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-tapRule"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastuseuap"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("keyValue"), + // }, + // Properties: &armmanagednetworkfabric.NetworkTapRuleProperties{ + // Annotation: to.Ptr("annotation"), + // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), + // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ + // { + // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ + // { + // Name: to.Ptr("example-ipGroup1"), + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // IPPrefixes: []*string{ + // to.Ptr("10.10.10.10/30")}, + // }}, + // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ + // { + // Name: to.Ptr("example-portGroup1"), + // Ports: []*string{ + // to.Ptr("100-200")}, + // }, + // { + // Name: to.Ptr("example-portGroup2"), + // Ports: []*string{ + // to.Ptr("900"), + // to.Ptr("1000-2000")}, + // }}, + // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ + // { + // Name: to.Ptr("exmaple-vlanGroup"), + // Vlans: []*string{ + // to.Ptr("10"), + // to.Ptr("100-200")}, + // }}, + // }}, + // MatchConfigurations: []*armmanagednetworkfabric.NetworkTapRuleMatchConfiguration{ + // { + // Actions: []*armmanagednetworkfabric.NetworkTapRuleAction{ + // { + // Type: to.Ptr(armmanagednetworkfabric.TapRuleActionTypeGoto), + // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), + // IsTimestampEnabled: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), + // MatchConfigurationName: to.Ptr("match1"), + // Truncate: to.Ptr("100"), + // }}, + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // MatchConditions: []*armmanagednetworkfabric.NetworkTapRuleMatchCondition{ + // { + // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ + // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), + // IPGroupNames: []*string{ + // to.Ptr("example-ipGroup")}, + // IPPrefixValues: []*string{ + // to.Ptr("10.10.10.10/20")}, + // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), + // }, + // ProtocolTypes: []*string{ + // to.Ptr("TCP")}, + // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ + // InnerVlans: []*string{ + // to.Ptr("11-20")}, + // VlanGroupNames: []*string{ + // to.Ptr("exmaple-vlanGroup")}, + // Vlans: []*string{ + // to.Ptr("10")}, + // }, + // EncapsulationType: to.Ptr(armmanagednetworkfabric.EncapsulationTypeNone), + // PortCondition: &armmanagednetworkfabric.PortCondition{ + // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), + // PortGroupNames: []*string{ + // to.Ptr("example-portGroup1")}, + // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), + // Ports: []*string{ + // to.Ptr("100")}, + // }, + // }}, + // MatchConfigurationName: to.Ptr("config1"), + // SequenceNumber: to.Ptr[int64](10), + // }}, + // TapRulesURL: to.Ptr("https://microsoft.com/a"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.485Z"); return t}()), + // NetworkTapID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-tap"), + // PollingIntervalInSeconds: to.Ptr(armmanagednetworkfabric.PollingIntervalInSeconds(30)), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Delete_MaximumSet_Gen.json +func ExampleNetworkTapRulesClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkTapRulesClient().BeginDelete(ctx, "example-rg", "example-tapRule", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_ListByResourceGroup_MaximumSet_Gen.json +func ExampleNetworkTapRulesClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewNetworkTapRulesClient().NewListByResourceGroupPager("example-rg", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.NetworkTapRulesListResult = armmanagednetworkfabric.NetworkTapRulesListResult{ + // Value: []*armmanagednetworkfabric.NetworkTapRule{ + // { + // Name: to.Ptr("example-tapRule"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkTapRules"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-tapRule"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastuseuap"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("keyValue"), + // }, + // Properties: &armmanagednetworkfabric.NetworkTapRuleProperties{ + // Annotation: to.Ptr("annotation"), + // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), + // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ + // { + // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ + // { + // Name: to.Ptr("example-ipGroup1"), + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // IPPrefixes: []*string{ + // to.Ptr("10.10.10.10/30")}, + // }}, + // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ + // { + // Name: to.Ptr("example-portGroup1"), + // Ports: []*string{ + // to.Ptr("100-200")}, + // }, + // { + // Name: to.Ptr("example-portGroup2"), + // Ports: []*string{ + // to.Ptr("900"), + // to.Ptr("1000-2000")}, + // }}, + // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ + // { + // Name: to.Ptr("exmaple-vlanGroup"), + // Vlans: []*string{ + // to.Ptr("10"), + // to.Ptr("100-200")}, + // }}, + // }}, + // MatchConfigurations: []*armmanagednetworkfabric.NetworkTapRuleMatchConfiguration{ + // { + // Actions: []*armmanagednetworkfabric.NetworkTapRuleAction{ + // { + // Type: to.Ptr(armmanagednetworkfabric.TapRuleActionTypeDrop), + // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), + // IsTimestampEnabled: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), + // MatchConfigurationName: to.Ptr("match1"), + // Truncate: to.Ptr("100"), + // }}, + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // MatchConditions: []*armmanagednetworkfabric.NetworkTapRuleMatchCondition{ + // { + // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ + // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), + // IPGroupNames: []*string{ + // to.Ptr("example-ipGroup")}, + // IPPrefixValues: []*string{ + // to.Ptr("10.10.10.10/20")}, + // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), + // }, + // ProtocolTypes: []*string{ + // to.Ptr("TCP")}, + // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ + // InnerVlans: []*string{ + // to.Ptr("11-20")}, + // VlanGroupNames: []*string{ + // to.Ptr("exmaple-vlanGroup")}, + // Vlans: []*string{ + // to.Ptr("10")}, + // }, + // EncapsulationType: to.Ptr(armmanagednetworkfabric.EncapsulationTypeNone), + // PortCondition: &armmanagednetworkfabric.PortCondition{ + // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), + // PortGroupNames: []*string{ + // to.Ptr("example-portGroup1")}, + // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), + // Ports: []*string{ + // to.Ptr("100")}, + // }, + // }}, + // MatchConfigurationName: to.Ptr("yvtpdqhqc"), + // SequenceNumber: to.Ptr[int64](3649377483), + // }}, + // TapRulesURL: to.Ptr("https://microsoft.com/a"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.485Z"); return t}()), + // NetworkTapID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-tap"), + // PollingIntervalInSeconds: to.Ptr(armmanagednetworkfabric.PollingIntervalInSeconds(30)), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_ListBySubscription_MaximumSet_Gen.json +func ExampleNetworkTapRulesClient_NewListBySubscriptionPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewNetworkTapRulesClient().NewListBySubscriptionPager(nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.NetworkTapRulesListResult = armmanagednetworkfabric.NetworkTapRulesListResult{ + // Value: []*armmanagednetworkfabric.NetworkTapRule{ + // { + // Name: to.Ptr("example-tapRule"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkTapRules"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-tapRule"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastuseuap"), + // Tags: map[string]*string{ + // "keyID": to.Ptr("keyValue"), + // }, + // Properties: &armmanagednetworkfabric.NetworkTapRuleProperties{ + // Annotation: to.Ptr("annotation"), + // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), + // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ + // { + // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ + // { + // Name: to.Ptr("example-ipGroup1"), + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // IPPrefixes: []*string{ + // to.Ptr("10.10.10.10/30")}, + // }}, + // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ + // { + // Name: to.Ptr("example-portGroup1"), + // Ports: []*string{ + // to.Ptr("100-200")}, + // }, + // { + // Name: to.Ptr("example-portGroup2"), + // Ports: []*string{ + // to.Ptr("900"), + // to.Ptr("1000-2000")}, + // }}, + // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ + // { + // Name: to.Ptr("exmaple-vlanGroup"), + // Vlans: []*string{ + // to.Ptr("10"), + // to.Ptr("100-200")}, + // }}, + // }}, + // MatchConfigurations: []*armmanagednetworkfabric.NetworkTapRuleMatchConfiguration{ + // { + // Actions: []*armmanagednetworkfabric.NetworkTapRuleAction{ + // { + // Type: to.Ptr(armmanagednetworkfabric.TapRuleActionTypeDrop), + // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), + // IsTimestampEnabled: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), + // MatchConfigurationName: to.Ptr("match1"), + // Truncate: to.Ptr("100"), + // }}, + // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), + // MatchConditions: []*armmanagednetworkfabric.NetworkTapRuleMatchCondition{ + // { + // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ + // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), + // IPGroupNames: []*string{ + // to.Ptr("example-ipGroup")}, + // IPPrefixValues: []*string{ + // to.Ptr("10.10.10.10/20")}, + // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), + // }, + // ProtocolTypes: []*string{ + // to.Ptr("TCP")}, + // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ + // InnerVlans: []*string{ + // to.Ptr("11-20")}, + // VlanGroupNames: []*string{ + // to.Ptr("exmaple-vlanGroup")}, + // Vlans: []*string{ + // to.Ptr("10")}, + // }, + // EncapsulationType: to.Ptr(armmanagednetworkfabric.EncapsulationTypeNone), + // PortCondition: &armmanagednetworkfabric.PortCondition{ + // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), + // PortGroupNames: []*string{ + // to.Ptr("example-portGroup1")}, + // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), + // Ports: []*string{ + // to.Ptr("100")}, + // }, + // }}, + // MatchConfigurationName: to.Ptr("config1"), + // SequenceNumber: to.Ptr[int64](10), + // }}, + // TapRulesURL: to.Ptr("https://microsoft.com/a"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.485Z"); return t}()), + // NetworkTapID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-tap"), + // PollingIntervalInSeconds: to.Ptr(armmanagednetworkfabric.PollingIntervalInSeconds(30)), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_UpdateAdministrativeState_MaximumSet_Gen.json +func ExampleNetworkTapRulesClient_BeginUpdateAdministrativeState() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkTapRulesClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-tapRule", armmanagednetworkfabric.UpdateAdministrativeState{ + ResourceIDs: []*string{ + to.Ptr("")}, + State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Resync_MaximumSet_Gen.json +func ExampleNetworkTapRulesClient_BeginResync() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkTapRulesClient().BeginResync(ctx, "example-rg", "example-tapRule", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_ValidateConfiguration_MaximumSet_Gen.json +func ExampleNetworkTapRulesClient_BeginValidateConfiguration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkTapRulesClient().BeginValidateConfiguration(ctx, "example-rg", "example-tapRule", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ValidateConfigurationResponse = armmanagednetworkfabric.ValidateConfigurationResponse{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // URL: to.Ptr("https://ActionDetails"), + // } +} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaps_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaps_client.go new file mode 100644 index 000000000000..a80cd642be17 --- /dev/null +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaps_client.go @@ -0,0 +1,537 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armmanagednetworkfabric + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// NetworkTapsClient contains the methods for the NetworkTaps group. +// Don't use this type directly, use NewNetworkTapsClient() instead. +type NetworkTapsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNetworkTapsClient creates a new instance of NetworkTapsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewNetworkTapsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkTapsClient, error) { + cl, err := arm.NewClient(moduleName+".NetworkTapsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NetworkTapsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Creates a Network Tap. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkTapName - Name of the Network Tap. +// - body - Request payload. +// - options - NetworkTapsClientBeginCreateOptions contains the optional parameters for the NetworkTapsClient.BeginCreate method. +func (client *NetworkTapsClient) BeginCreate(ctx context.Context, resourceGroupName string, networkTapName string, body NetworkTap, options *NetworkTapsClientBeginCreateOptions) (*runtime.Poller[NetworkTapsClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, networkTapName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapsClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkTapsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Create - Creates a Network Tap. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkTapsClient) create(ctx context.Context, resourceGroupName string, networkTapName string, body NetworkTap, options *NetworkTapsClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, networkTapName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createCreateRequest creates the Create request. +func (client *NetworkTapsClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkTapName string, body NetworkTap, options *NetworkTapsClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkTapName == "" { + return nil, errors.New("parameter networkTapName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkTapName}", url.PathEscape(networkTapName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginDelete - Deletes Network Tap. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkTapName - Name of the Network Tap. +// - options - NetworkTapsClientBeginDeleteOptions contains the optional parameters for the NetworkTapsClient.BeginDelete method. +func (client *NetworkTapsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkTapName string, options *NetworkTapsClientBeginDeleteOptions) (*runtime.Poller[NetworkTapsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkTapName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkTapsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes Network Tap. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkTapsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkTapName string, options *NetworkTapsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkTapName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *NetworkTapsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkTapName string, options *NetworkTapsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkTapName == "" { + return nil, errors.New("parameter networkTapName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkTapName}", url.PathEscape(networkTapName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves details of this Network Tap. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkTapName - Name of the Network Tap. +// - options - NetworkTapsClientGetOptions contains the optional parameters for the NetworkTapsClient.Get method. +func (client *NetworkTapsClient) Get(ctx context.Context, resourceGroupName string, networkTapName string, options *NetworkTapsClientGetOptions) (NetworkTapsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, networkTapName, options) + if err != nil { + return NetworkTapsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkTapsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NetworkTapsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *NetworkTapsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkTapName string, options *NetworkTapsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkTapName == "" { + return nil, errors.New("parameter networkTapName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkTapName}", url.PathEscape(networkTapName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *NetworkTapsClient) getHandleResponse(resp *http.Response) (NetworkTapsClientGetResponse, error) { + result := NetworkTapsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkTap); err != nil { + return NetworkTapsClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Displays Network Taps list by resource group GET method. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - NetworkTapsClientListByResourceGroupOptions contains the optional parameters for the NetworkTapsClient.NewListByResourceGroupPager +// method. +func (client *NetworkTapsClient) NewListByResourceGroupPager(resourceGroupName string, options *NetworkTapsClientListByResourceGroupOptions) *runtime.Pager[NetworkTapsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkTapsClientListByResourceGroupResponse]{ + More: func(page NetworkTapsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NetworkTapsClientListByResourceGroupResponse) (NetworkTapsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NetworkTapsClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkTapsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NetworkTapsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *NetworkTapsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *NetworkTapsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *NetworkTapsClient) listByResourceGroupHandleResponse(resp *http.Response) (NetworkTapsClientListByResourceGroupResponse, error) { + result := NetworkTapsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkTapsListResult); err != nil { + return NetworkTapsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Displays Network Taps list by subscription GET method. +// +// Generated from API version 2023-06-15 +// - options - NetworkTapsClientListBySubscriptionOptions contains the optional parameters for the NetworkTapsClient.NewListBySubscriptionPager +// method. +func (client *NetworkTapsClient) NewListBySubscriptionPager(options *NetworkTapsClientListBySubscriptionOptions) *runtime.Pager[NetworkTapsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkTapsClientListBySubscriptionResponse]{ + More: func(page NetworkTapsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NetworkTapsClientListBySubscriptionResponse) (NetworkTapsClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NetworkTapsClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkTapsClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NetworkTapsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *NetworkTapsClient) listBySubscriptionCreateRequest(ctx context.Context, options *NetworkTapsClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkTaps" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *NetworkTapsClient) listBySubscriptionHandleResponse(resp *http.Response) (NetworkTapsClientListBySubscriptionResponse, error) { + result := NetworkTapsClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkTapsListResult); err != nil { + return NetworkTapsClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// BeginResync - Implements the operation to the underlying resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkTapName - Name of the Network Tap. +// - options - NetworkTapsClientBeginResyncOptions contains the optional parameters for the NetworkTapsClient.BeginResync method. +func (client *NetworkTapsClient) BeginResync(ctx context.Context, resourceGroupName string, networkTapName string, options *NetworkTapsClientBeginResyncOptions) (*runtime.Poller[NetworkTapsClientResyncResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.resync(ctx, resourceGroupName, networkTapName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapsClientResyncResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkTapsClientResyncResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Resync - Implements the operation to the underlying resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkTapsClient) resync(ctx context.Context, resourceGroupName string, networkTapName string, options *NetworkTapsClientBeginResyncOptions) (*http.Response, error) { + req, err := client.resyncCreateRequest(ctx, resourceGroupName, networkTapName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// resyncCreateRequest creates the Resync request. +func (client *NetworkTapsClient) resyncCreateRequest(ctx context.Context, resourceGroupName string, networkTapName string, options *NetworkTapsClientBeginResyncOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/resync" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkTapName == "" { + return nil, errors.New("parameter networkTapName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkTapName}", url.PathEscape(networkTapName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginUpdate - API to update certain properties of the Network Tap resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkTapName - Name of the Network Tap. +// - body - Network Tap properties to update. +// - options - NetworkTapsClientBeginUpdateOptions contains the optional parameters for the NetworkTapsClient.BeginUpdate method. +func (client *NetworkTapsClient) BeginUpdate(ctx context.Context, resourceGroupName string, networkTapName string, body NetworkTapPatch, options *NetworkTapsClientBeginUpdateOptions) (*runtime.Poller[NetworkTapsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, networkTapName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkTapsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - API to update certain properties of the Network Tap resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkTapsClient) update(ctx context.Context, resourceGroupName string, networkTapName string, body NetworkTapPatch, options *NetworkTapsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, networkTapName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *NetworkTapsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, networkTapName string, body NetworkTapPatch, options *NetworkTapsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkTapName == "" { + return nil, errors.New("parameter networkTapName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkTapName}", url.PathEscape(networkTapName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginUpdateAdministrativeState - Implements the operation to the underlying resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkTapName - Name of the Network Tap. +// - body - Request payload. +// - options - NetworkTapsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkTapsClient.BeginUpdateAdministrativeState +// method. +func (client *NetworkTapsClient) BeginUpdateAdministrativeState(ctx context.Context, resourceGroupName string, networkTapName string, body UpdateAdministrativeState, options *NetworkTapsClientBeginUpdateAdministrativeStateOptions) (*runtime.Poller[NetworkTapsClientUpdateAdministrativeStateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateAdministrativeState(ctx, resourceGroupName, networkTapName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapsClientUpdateAdministrativeStateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkTapsClientUpdateAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateAdministrativeState - Implements the operation to the underlying resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkTapsClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, networkTapName string, body UpdateAdministrativeState, options *NetworkTapsClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { + req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, networkTapName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. +func (client *NetworkTapsClient) updateAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, networkTapName string, body UpdateAdministrativeState, options *NetworkTapsClientBeginUpdateAdministrativeStateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/updateAdministrativeState" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkTapName == "" { + return nil, errors.New("parameter networkTapName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkTapName}", url.PathEscape(networkTapName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaps_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaps_client_example_test.go new file mode 100644 index 000000000000..0d913bdb663e --- /dev/null +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaps_client_example_test.go @@ -0,0 +1,484 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armmanagednetworkfabric_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Create_MaximumSet_Gen.json +func ExampleNetworkTapsClient_BeginCreate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkTapsClient().BeginCreate(ctx, "example-rg", "example-networkTap", armmanagednetworkfabric.NetworkTap{ + Location: to.Ptr("eastuseuap"), + Tags: map[string]*string{ + "key6024": to.Ptr("1234"), + }, + Properties: &armmanagednetworkfabric.NetworkTapProperties{ + Annotation: to.Ptr("annotation"), + Destinations: []*armmanagednetworkfabric.NetworkTapPropertiesDestinationsItem{ + { + Name: to.Ptr("example-destinaionName"), + DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsloationDomains/example-l3Domain/internalNetworks/example-internalNetwork"), + DestinationTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-destinationTapRule"), + DestinationType: to.Ptr(armmanagednetworkfabric.DestinationTypeIsolationDomain), + IsolationDomainProperties: &armmanagednetworkfabric.IsolationDomainProperties{ + Encapsulation: to.Ptr(armmanagednetworkfabric.EncapsulationNone), + NeighborGroupIDs: []*string{ + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, + }, + }}, + NetworkPacketBrokerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), + PollingType: to.Ptr(armmanagednetworkfabric.PollingTypePull), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.NetworkTap = armmanagednetworkfabric.NetworkTap{ + // Name: to.Ptr("example-networkTap"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkTaps"), + // ID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.578Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.579Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastuseuap"), + // Tags: map[string]*string{ + // "key6024": to.Ptr("1234"), + // }, + // Properties: &armmanagednetworkfabric.NetworkTapProperties{ + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // Destinations: []*armmanagednetworkfabric.NetworkTapPropertiesDestinationsItem{ + // { + // Name: to.Ptr("example-destinaionName"), + // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsloationDomains/example-l3Domain/internalNetworks/example-internalNetwork"), + // DestinationTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-destinationTapRule"), + // DestinationType: to.Ptr(armmanagednetworkfabric.DestinationTypeIsolationDomain), + // IsolationDomainProperties: &armmanagednetworkfabric.IsolationDomainProperties{ + // Encapsulation: to.Ptr(armmanagednetworkfabric.EncapsulationNone), + // NeighborGroupIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, + // }, + // }}, + // NetworkPacketBrokerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), + // PollingType: to.Ptr(armmanagednetworkfabric.PollingTypePull), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // SourceTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-sourceTapRule"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Get_MaximumSet_Gen.json +func ExampleNetworkTapsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewNetworkTapsClient().Get(ctx, "example-rg", "example-networkTap", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.NetworkTap = armmanagednetworkfabric.NetworkTap{ + // Name: to.Ptr("example-networkTap"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkTaps"), + // ID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.578Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.579Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastuseuap"), + // Tags: map[string]*string{ + // "key6024": to.Ptr("1234"), + // }, + // Properties: &armmanagednetworkfabric.NetworkTapProperties{ + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // Destinations: []*armmanagednetworkfabric.NetworkTapPropertiesDestinationsItem{ + // { + // Name: to.Ptr("example-destinaionName"), + // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsloationDomains/example-l3Domain/internalNetworks/example-internalNetwork"), + // DestinationTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-destinationTapRule"), + // DestinationType: to.Ptr(armmanagednetworkfabric.DestinationTypeIsolationDomain), + // IsolationDomainProperties: &armmanagednetworkfabric.IsolationDomainProperties{ + // Encapsulation: to.Ptr(armmanagednetworkfabric.EncapsulationNone), + // NeighborGroupIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, + // }, + // }}, + // NetworkPacketBrokerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), + // PollingType: to.Ptr(armmanagednetworkfabric.PollingTypePull), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // SourceTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-sourceTapRule"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Update_MaximumSet_Gen.json +func ExampleNetworkTapsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkTapsClient().BeginUpdate(ctx, "example-rg", "example-networkTap", armmanagednetworkfabric.NetworkTapPatch{ + Tags: map[string]*string{ + "key6024": to.Ptr("1234"), + }, + Properties: &armmanagednetworkfabric.NetworkTapPatchableParameters{ + Annotation: to.Ptr("annotation1"), + Destinations: []*armmanagednetworkfabric.NetworkTapPatchableParametersDestinationsItem{ + { + Name: to.Ptr("example-destinaionName"), + DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsloationDomains/example-l3Domain/internalNetworks/example-internalNetwork"), + DestinationTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-destinationTapRule"), + DestinationType: to.Ptr(armmanagednetworkfabric.DestinationTypeIsolationDomain), + IsolationDomainProperties: &armmanagednetworkfabric.IsolationDomainProperties{ + Encapsulation: to.Ptr(armmanagednetworkfabric.EncapsulationNone), + NeighborGroupIDs: []*string{ + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, + }, + }}, + PollingType: to.Ptr(armmanagednetworkfabric.PollingTypePull), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.NetworkTap = armmanagednetworkfabric.NetworkTap{ + // Name: to.Ptr("example-networkTap"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkTaps"), + // ID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.578Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.579Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastuseuap"), + // Tags: map[string]*string{ + // "key6024": to.Ptr("1234"), + // }, + // Properties: &armmanagednetworkfabric.NetworkTapProperties{ + // Annotation: to.Ptr("annotation1"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // Destinations: []*armmanagednetworkfabric.NetworkTapPropertiesDestinationsItem{ + // { + // Name: to.Ptr("example-destinaionName"), + // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsloationDomains/example-l3Domain/internalNetworks/example-internalNetwork"), + // DestinationTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-destinationTapRule"), + // DestinationType: to.Ptr(armmanagednetworkfabric.DestinationTypeIsolationDomain), + // IsolationDomainProperties: &armmanagednetworkfabric.IsolationDomainProperties{ + // Encapsulation: to.Ptr(armmanagednetworkfabric.EncapsulationNone), + // NeighborGroupIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, + // }, + // }}, + // NetworkPacketBrokerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), + // PollingType: to.Ptr(armmanagednetworkfabric.PollingTypePull), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // SourceTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-sourceTapRule"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Delete_MaximumSet_Gen.json +func ExampleNetworkTapsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkTapsClient().BeginDelete(ctx, "example-rg", "example-networkTap", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_ListByResourceGroup_MaximumSet_Gen.json +func ExampleNetworkTapsClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewNetworkTapsClient().NewListByResourceGroupPager("example-rg", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.NetworkTapsListResult = armmanagednetworkfabric.NetworkTapsListResult{ + // Value: []*armmanagednetworkfabric.NetworkTap{ + // { + // Name: to.Ptr("example-networkTap"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkTaps"), + // ID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.578Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.579Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastuseuap"), + // Tags: map[string]*string{ + // "key6024": to.Ptr("1234"), + // }, + // Properties: &armmanagednetworkfabric.NetworkTapProperties{ + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // Destinations: []*armmanagednetworkfabric.NetworkTapPropertiesDestinationsItem{ + // { + // Name: to.Ptr("example-destinaionName"), + // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsloationDomains/example-l3Domain/internalNetworks/example-internalNetwork"), + // DestinationTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-destinationTapRule"), + // DestinationType: to.Ptr(armmanagednetworkfabric.DestinationTypeIsolationDomain), + // IsolationDomainProperties: &armmanagednetworkfabric.IsolationDomainProperties{ + // Encapsulation: to.Ptr(armmanagednetworkfabric.EncapsulationNone), + // NeighborGroupIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, + // }, + // }}, + // NetworkPacketBrokerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), + // PollingType: to.Ptr(armmanagednetworkfabric.PollingTypePull), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // SourceTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-sourceTapRule"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_ListBySubscription_MaximumSet_Gen.json +func ExampleNetworkTapsClient_NewListBySubscriptionPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewNetworkTapsClient().NewListBySubscriptionPager(nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.NetworkTapsListResult = armmanagednetworkfabric.NetworkTapsListResult{ + // Value: []*armmanagednetworkfabric.NetworkTap{ + // { + // Name: to.Ptr("example-networkTap"), + // Type: to.Ptr("microsoft.managednetworkfabric/networkTaps"), + // ID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.578Z"); return t}()), + // CreatedBy: to.Ptr("email@address.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.579Z"); return t}()), + // LastModifiedBy: to.Ptr("email@address.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Location: to.Ptr("eastuseuap"), + // Tags: map[string]*string{ + // "key6024": to.Ptr("1234"), + // }, + // Properties: &armmanagednetworkfabric.NetworkTapProperties{ + // Annotation: to.Ptr("annotation"), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // Destinations: []*armmanagednetworkfabric.NetworkTapPropertiesDestinationsItem{ + // { + // Name: to.Ptr("example-destinaionName"), + // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsloationDomains/example-l3Domain/internalNetworks/example-internalNetwork"), + // DestinationTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-destinationTapRule"), + // DestinationType: to.Ptr(armmanagednetworkfabric.DestinationTypeIsolationDomain), + // IsolationDomainProperties: &armmanagednetworkfabric.IsolationDomainProperties{ + // Encapsulation: to.Ptr(armmanagednetworkfabric.EncapsulationNone), + // NeighborGroupIDs: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, + // }, + // }}, + // NetworkPacketBrokerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), + // PollingType: to.Ptr(armmanagednetworkfabric.PollingTypePull), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // SourceTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-sourceTapRule"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_UpdateAdministrativeState_MaximumSet_Gen.json +func ExampleNetworkTapsClient_BeginUpdateAdministrativeState() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkTapsClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-networkTap", armmanagednetworkfabric.UpdateAdministrativeState{ + ResourceIDs: []*string{ + to.Ptr("")}, + State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForDeviceUpdate = armmanagednetworkfabric.CommonPostActionResponseForDeviceUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // FailedDevices: []*string{ + // to.Ptr("")}, + // SuccessfulDevices: []*string{ + // to.Ptr("")}, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Resync_MaximumSet_Gen.json +func ExampleNetworkTapsClient_BeginResync() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkTapsClient().BeginResync(ctx, "example-rg", "example-networkTap", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } +} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktonetworkinterconnects_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktonetworkinterconnects_client.go index bc5ce8bb536b..bf44b4a9ec43 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktonetworkinterconnects_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktonetworkinterconnects_client.go @@ -29,7 +29,7 @@ type NetworkToNetworkInterconnectsClient struct { } // NewNetworkToNetworkInterconnectsClient creates a new instance of NetworkToNetworkInterconnectsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewNetworkToNetworkInterconnectsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkToNetworkInterconnectsClient, error) { @@ -47,10 +47,10 @@ func NewNetworkToNetworkInterconnectsClient(subscriptionID string, credential az // BeginCreate - Configuration used to setup CE-PE connectivity PUT Method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkFabricName - Name of the NetworkFabric. -// - networkToNetworkInterconnectName - Name of the NetworkToNetworkInterconnectName +// - networkFabricName - Name of the Network Fabric. +// - networkToNetworkInterconnectName - Name of the Network to Network Interconnect. // - body - Request payload. // - options - NetworkToNetworkInterconnectsClientBeginCreateOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.BeginCreate // method. @@ -71,7 +71,7 @@ func (client *NetworkToNetworkInterconnectsClient) BeginCreate(ctx context.Conte // Create - Configuration used to setup CE-PE connectivity PUT Method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *NetworkToNetworkInterconnectsClient) create(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, body NetworkToNetworkInterconnect, options *NetworkToNetworkInterconnectsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body, options) if err != nil { @@ -90,9 +90,6 @@ func (client *NetworkToNetworkInterconnectsClient) create(ctx context.Context, r // createCreateRequest creates the Create request. func (client *NetworkToNetworkInterconnectsClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, body NetworkToNetworkInterconnect, options *NetworkToNetworkInterconnectsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -111,7 +108,7 @@ func (client *NetworkToNetworkInterconnectsClient) createCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -120,10 +117,10 @@ func (client *NetworkToNetworkInterconnectsClient) createCreateRequest(ctx conte // BeginDelete - Implements NetworkToNetworkInterconnects DELETE method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkFabricName - Name of the NetworkFabric. -// - networkToNetworkInterconnectName - Name of the NetworkToNetworkInterconnectName +// - networkFabricName - Name of the Network Fabric. +// - networkToNetworkInterconnectName - Name of the Network to Network Interconnect. // - options - NetworkToNetworkInterconnectsClientBeginDeleteOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.BeginDelete // method. func (client *NetworkToNetworkInterconnectsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, options *NetworkToNetworkInterconnectsClientBeginDeleteOptions) (*runtime.Poller[NetworkToNetworkInterconnectsClientDeleteResponse], error) { @@ -143,7 +140,7 @@ func (client *NetworkToNetworkInterconnectsClient) BeginDelete(ctx context.Conte // Delete - Implements NetworkToNetworkInterconnects DELETE method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *NetworkToNetworkInterconnectsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, options *NetworkToNetworkInterconnectsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, options) if err != nil { @@ -153,7 +150,7 @@ func (client *NetworkToNetworkInterconnectsClient) deleteOperation(ctx context.C if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -162,9 +159,6 @@ func (client *NetworkToNetworkInterconnectsClient) deleteOperation(ctx context.C // deleteCreateRequest creates the Delete request. func (client *NetworkToNetworkInterconnectsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, options *NetworkToNetworkInterconnectsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -183,7 +177,7 @@ func (client *NetworkToNetworkInterconnectsClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,10 +186,10 @@ func (client *NetworkToNetworkInterconnectsClient) deleteCreateRequest(ctx conte // Get - Implements NetworkToNetworkInterconnects GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkFabricName - Name of the NetworkFabric. -// - networkToNetworkInterconnectName - Name of the NetworkToNetworkInterconnect +// - networkFabricName - Name of the Network Fabric. +// - networkToNetworkInterconnectName - Name of the Network to Network Interconnect. // - options - NetworkToNetworkInterconnectsClientGetOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.Get // method. func (client *NetworkToNetworkInterconnectsClient) Get(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, options *NetworkToNetworkInterconnectsClientGetOptions) (NetworkToNetworkInterconnectsClientGetResponse, error) { @@ -216,9 +210,6 @@ func (client *NetworkToNetworkInterconnectsClient) Get(ctx context.Context, reso // getCreateRequest creates the Get request. func (client *NetworkToNetworkInterconnectsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, options *NetworkToNetworkInterconnectsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -237,7 +228,7 @@ func (client *NetworkToNetworkInterconnectsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,47 +243,44 @@ func (client *NetworkToNetworkInterconnectsClient) getHandleResponse(resp *http. return result, nil } -// NewListPager - Implements Network To Network Interconnects list by Network Fabric GET method. +// NewListByNetworkFabricPager - Implements Network To Network Interconnects list by Network Fabric GET method. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - networkFabricName - Name of the NetworkFabric. -// - options - NetworkToNetworkInterconnectsClientListOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.NewListPager +// - networkFabricName - Name of the Network Fabric. +// - options - NetworkToNetworkInterconnectsClientListByNetworkFabricOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.NewListByNetworkFabricPager // method. -func (client *NetworkToNetworkInterconnectsClient) NewListPager(resourceGroupName string, networkFabricName string, options *NetworkToNetworkInterconnectsClientListOptions) *runtime.Pager[NetworkToNetworkInterconnectsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[NetworkToNetworkInterconnectsClientListResponse]{ - More: func(page NetworkToNetworkInterconnectsClientListResponse) bool { +func (client *NetworkToNetworkInterconnectsClient) NewListByNetworkFabricPager(resourceGroupName string, networkFabricName string, options *NetworkToNetworkInterconnectsClientListByNetworkFabricOptions) *runtime.Pager[NetworkToNetworkInterconnectsClientListByNetworkFabricResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkToNetworkInterconnectsClientListByNetworkFabricResponse]{ + More: func(page NetworkToNetworkInterconnectsClientListByNetworkFabricResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *NetworkToNetworkInterconnectsClientListResponse) (NetworkToNetworkInterconnectsClientListResponse, error) { + Fetcher: func(ctx context.Context, page *NetworkToNetworkInterconnectsClientListByNetworkFabricResponse) (NetworkToNetworkInterconnectsClientListByNetworkFabricResponse, error) { var req *policy.Request var err error if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, networkFabricName, options) + req, err = client.listByNetworkFabricCreateRequest(ctx, resourceGroupName, networkFabricName, options) } else { req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return NetworkToNetworkInterconnectsClientListResponse{}, err + return NetworkToNetworkInterconnectsClientListByNetworkFabricResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return NetworkToNetworkInterconnectsClientListResponse{}, err + return NetworkToNetworkInterconnectsClientListByNetworkFabricResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkToNetworkInterconnectsClientListResponse{}, runtime.NewResponseError(resp) + return NetworkToNetworkInterconnectsClientListByNetworkFabricResponse{}, runtime.NewResponseError(resp) } - return client.listHandleResponse(resp) + return client.listByNetworkFabricHandleResponse(resp) }, }) } -// listCreateRequest creates the List request. -func (client *NetworkToNetworkInterconnectsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkToNetworkInterconnectsClientListOptions) (*policy.Request, error) { +// listByNetworkFabricCreateRequest creates the ListByNetworkFabric request. +func (client *NetworkToNetworkInterconnectsClient) listByNetworkFabricCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkToNetworkInterconnectsClientListByNetworkFabricOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -307,17 +295,227 @@ func (client *NetworkToNetworkInterconnectsClient) listCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// listHandleResponse handles the List response. -func (client *NetworkToNetworkInterconnectsClient) listHandleResponse(resp *http.Response) (NetworkToNetworkInterconnectsClientListResponse, error) { - result := NetworkToNetworkInterconnectsClientListResponse{} +// listByNetworkFabricHandleResponse handles the ListByNetworkFabric response. +func (client *NetworkToNetworkInterconnectsClient) listByNetworkFabricHandleResponse(resp *http.Response) (NetworkToNetworkInterconnectsClientListByNetworkFabricResponse, error) { + result := NetworkToNetworkInterconnectsClientListByNetworkFabricResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.NetworkToNetworkInterconnectsList); err != nil { - return NetworkToNetworkInterconnectsClientListResponse{}, err + return NetworkToNetworkInterconnectsClientListByNetworkFabricResponse{}, err } return result, nil } + +// BeginUpdate - Update certain properties of the Network To NetworkInterconnects resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkFabricName - Name of the Network Fabric. +// - networkToNetworkInterconnectName - Name of the Network to Network Interconnect. +// - body - Network to Network Interconnect properties to update. +// - options - NetworkToNetworkInterconnectsClientBeginUpdateOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.BeginUpdate +// method. +func (client *NetworkToNetworkInterconnectsClient) BeginUpdate(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, body NetworkToNetworkInterconnectPatch, options *NetworkToNetworkInterconnectsClientBeginUpdateOptions) (*runtime.Poller[NetworkToNetworkInterconnectsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkToNetworkInterconnectsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkToNetworkInterconnectsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Update certain properties of the Network To NetworkInterconnects resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkToNetworkInterconnectsClient) update(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, body NetworkToNetworkInterconnectPatch, options *NetworkToNetworkInterconnectsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *NetworkToNetworkInterconnectsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, body NetworkToNetworkInterconnectPatch, options *NetworkToNetworkInterconnectsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkFabricName == "" { + return nil, errors.New("parameter networkFabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFabricName}", url.PathEscape(networkFabricName)) + if networkToNetworkInterconnectName == "" { + return nil, errors.New("parameter networkToNetworkInterconnectName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkToNetworkInterconnectName}", url.PathEscape(networkToNetworkInterconnectName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginUpdateAdministrativeState - Updates the Admin State. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkFabricName - Name of the Network Fabric. +// - networkToNetworkInterconnectName - Name of the Network to Network Interconnect. +// - body - Request payload. +// - options - NetworkToNetworkInterconnectsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for +// the NetworkToNetworkInterconnectsClient.BeginUpdateAdministrativeState method. +func (client *NetworkToNetworkInterconnectsClient) BeginUpdateAdministrativeState(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, body UpdateAdministrativeState, options *NetworkToNetworkInterconnectsClientBeginUpdateAdministrativeStateOptions) (*runtime.Poller[NetworkToNetworkInterconnectsClientUpdateAdministrativeStateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateAdministrativeState(ctx, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkToNetworkInterconnectsClientUpdateAdministrativeStateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkToNetworkInterconnectsClientUpdateAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateAdministrativeState - Updates the Admin State. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkToNetworkInterconnectsClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, body UpdateAdministrativeState, options *NetworkToNetworkInterconnectsClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { + req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. +func (client *NetworkToNetworkInterconnectsClient) updateAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, body UpdateAdministrativeState, options *NetworkToNetworkInterconnectsClientBeginUpdateAdministrativeStateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateAdministrativeState" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkFabricName == "" { + return nil, errors.New("parameter networkFabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFabricName}", url.PathEscape(networkFabricName)) + if networkToNetworkInterconnectName == "" { + return nil, errors.New("parameter networkToNetworkInterconnectName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkToNetworkInterconnectName}", url.PathEscape(networkToNetworkInterconnectName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginUpdateNpbStaticRouteBfdAdministrativeState - Updates the NPB Static Route BFD Administrative State. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - networkFabricName - Name of the Network Fabric. +// - networkToNetworkInterconnectName - Name of the Network to Network Interconnect. +// - body - Request payload. +// - options - NetworkToNetworkInterconnectsClientBeginUpdateNpbStaticRouteBfdAdministrativeStateOptions contains the optional +// parameters for the NetworkToNetworkInterconnectsClient.BeginUpdateNpbStaticRouteBfdAdministrativeState method. +func (client *NetworkToNetworkInterconnectsClient) BeginUpdateNpbStaticRouteBfdAdministrativeState(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, body UpdateAdministrativeState, options *NetworkToNetworkInterconnectsClientBeginUpdateNpbStaticRouteBfdAdministrativeStateOptions) (*runtime.Poller[NetworkToNetworkInterconnectsClientUpdateNpbStaticRouteBfdAdministrativeStateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateNpbStaticRouteBfdAdministrativeState(ctx, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkToNetworkInterconnectsClientUpdateNpbStaticRouteBfdAdministrativeStateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkToNetworkInterconnectsClientUpdateNpbStaticRouteBfdAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateNpbStaticRouteBfdAdministrativeState - Updates the NPB Static Route BFD Administrative State. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *NetworkToNetworkInterconnectsClient) updateNpbStaticRouteBfdAdministrativeState(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, body UpdateAdministrativeState, options *NetworkToNetworkInterconnectsClientBeginUpdateNpbStaticRouteBfdAdministrativeStateOptions) (*http.Response, error) { + req, err := client.updateNpbStaticRouteBfdAdministrativeStateCreateRequest(ctx, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateNpbStaticRouteBfdAdministrativeStateCreateRequest creates the UpdateNpbStaticRouteBfdAdministrativeState request. +func (client *NetworkToNetworkInterconnectsClient) updateNpbStaticRouteBfdAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, body UpdateAdministrativeState, options *NetworkToNetworkInterconnectsClientBeginUpdateNpbStaticRouteBfdAdministrativeStateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateNpbStaticRouteBfdAdministrativeState" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkFabricName == "" { + return nil, errors.New("parameter networkFabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFabricName}", url.PathEscape(networkFabricName)) + if networkToNetworkInterconnectName == "" { + return nil, errors.New("parameter networkToNetworkInterconnectName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkToNetworkInterconnectName}", url.PathEscape(networkToNetworkInterconnectName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktonetworkinterconnects_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktonetworkinterconnects_client_example_test.go index b0a2be08b797..1fda7c65b30d 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktonetworkinterconnects_client_example_test.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktonetworkinterconnects_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkToNetworkInterconnects_Create_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Create_MaximumSet_Gen.json func ExampleNetworkToNetworkInterconnectsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,25 +29,52 @@ func ExampleNetworkToNetworkInterconnectsClient_BeginCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkToNetworkInterconnectsClient().BeginCreate(ctx, "resourceGroupName", "FabricName", "DefaultNNI", armmanagednetworkfabric.NetworkToNetworkInterconnect{ + poller, err := clientFactory.NewNetworkToNetworkInterconnectsClient().BeginCreate(ctx, "example-rg", "example-fabric", "example-nni", armmanagednetworkfabric.NetworkToNetworkInterconnect{ Properties: &armmanagednetworkfabric.NetworkToNetworkInterconnectProperties{ - IsManagementType: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), + EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicyInformation{ + ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + }, + ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicyInformation{ + ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + }, + IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + IsManagementType: to.Ptr(armmanagednetworkfabric.IsManagementTypeTrue), Layer2Configuration: &armmanagednetworkfabric.Layer2Configuration{ - Mtu: to.Ptr[int32](1500), - PortCount: to.Ptr[int32](10), + Interfaces: []*string{ + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, + Mtu: to.Ptr[int32](1500), }, - Layer3Configuration: &armmanagednetworkfabric.Layer3Configuration{ - PrimaryIPv4Prefix: to.Ptr("172.31.0.0/31"), - PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), - SecondaryIPv4Prefix: to.Ptr("172.31.0.20/31"), - SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), - ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2"), - ImportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName1"), - PeerASN: to.Ptr[int32](50272), - VlanID: to.Ptr[int32](2064), + NniType: to.Ptr(armmanagednetworkfabric.NniTypeCE), + NpbStaticRouteConfiguration: &armmanagednetworkfabric.NpbStaticRouteConfiguration{ + BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + IntervalInMilliSeconds: to.Ptr[int32](300), + Multiplier: to.Ptr[int32](25), + }, + IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ + { + NextHop: []*string{ + to.Ptr("21.20.20.20")}, + Prefix: to.Ptr("20.0.0.12/30"), + }}, + IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ + { + NextHop: []*string{ + to.Ptr("4FFE:FFFF:0:CD30::ac")}, + Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/127"), + }}, }, - NniType: to.Ptr(armmanagednetworkfabric.NniTypeCE), - UseOptionB: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyFalse), + OptionBLayer3Configuration: &armmanagednetworkfabric.NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration{ + PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), + SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), + SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + PeerASN: to.Ptr[int64](61234), + VlanID: to.Ptr[int32](1234), + }, + UseOptionB: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), }, }, nil) if err != nil { @@ -61,45 +88,72 @@ func ExampleNetworkToNetworkInterconnectsClient_BeginCreate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkToNetworkInterconnect = armmanagednetworkfabric.NetworkToNetworkInterconnect{ - // Name: to.Ptr("DefaultNNI"), - // Type: to.Ptr("Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnect/DefaultNNI"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnect/DefaultNNI"), + // Name: to.Ptr("example-nni"), + // Type: to.Ptr("microsoft.managedNetworkFabric/networkFabrics/networkToNetworkInterconnects"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-11T04:17:22.639Z"); return t}()), - // CreatedBy: to.Ptr("User@email.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-11T04:17:22.639Z"); return t}()), - // LastModifiedBy: to.Ptr("User"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Properties: &armmanagednetworkfabric.NetworkToNetworkInterconnectProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // IsManagementType: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicyInformation{ + // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // }, + // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicyInformation{ + // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // }, + // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // IsManagementType: to.Ptr(armmanagednetworkfabric.IsManagementTypeTrue), // Layer2Configuration: &armmanagednetworkfabric.Layer2Configuration{ // Interfaces: []*string{ - // to.Ptr("defaultInterface")}, - // Mtu: to.Ptr[int32](2516), - // PortCount: to.Ptr[int32](3), - // }, - // Layer3Configuration: &armmanagednetworkfabric.Layer3Configuration{ - // PrimaryIPv4Prefix: to.Ptr("172.31.0.0/31"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), - // SecondaryIPv4Prefix: to.Ptr("172.31.0.20/31"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), - // ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2"), - // FabricASN: to.Ptr[int32](1253), - // ImportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName1"), - // PeerASN: to.Ptr[int32](50272), - // VlanID: to.Ptr[int32](2064), + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, + // Mtu: to.Ptr[int32](1500), // }, // NniType: to.Ptr(armmanagednetworkfabric.NniTypeCE), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // UseOptionB: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // }, - // } + // NpbStaticRouteConfiguration: &armmanagednetworkfabric.NpbStaticRouteConfiguration{ + // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](25), + // }, + // IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ + // { + // NextHop: []*string{ + // to.Ptr("21.20.20.20")}, + // Prefix: to.Ptr("20.0.0.12/30"), + // }}, + // IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ + // { + // NextHop: []*string{ + // to.Ptr("4FFE:FFFF:0:CD30::ac")}, + // Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/127"), + // }}, + // }, + // OptionBLayer3Configuration: &armmanagednetworkfabric.NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), + // SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), + // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + // FabricASN: to.Ptr[int64](17), + // PeerASN: to.Ptr[int64](61234), + // VlanID: to.Ptr[int32](1234), + // }, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // UseOptionB: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkToNetworkInterconnects_Get_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Get_MaximumSet_Gen.json func ExampleNetworkToNetworkInterconnectsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -110,7 +164,7 @@ func ExampleNetworkToNetworkInterconnectsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewNetworkToNetworkInterconnectsClient().Get(ctx, "resourceGroupName", "FabricName", "DefaultNNI", nil) + res, err := clientFactory.NewNetworkToNetworkInterconnectsClient().Get(ctx, "example-rg", "example-fabric", "example-nni", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -118,45 +172,204 @@ func ExampleNetworkToNetworkInterconnectsClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NetworkToNetworkInterconnect = armmanagednetworkfabric.NetworkToNetworkInterconnect{ - // Name: to.Ptr("DefaultNNI"), - // Type: to.Ptr("Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnects/DefaultNNI"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnects/DefaultNNI"), + // Name: to.Ptr("example-nni"), + // Type: to.Ptr("microsoft.managedNetworkFabric/networkFabrics/networkToNetworkInterconnects"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-11T04:17:22.639Z"); return t}()), - // CreatedBy: to.Ptr("User@email.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-11T04:17:22.639Z"); return t}()), - // LastModifiedBy: to.Ptr("tcycax"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Properties: &armmanagednetworkfabric.NetworkToNetworkInterconnectProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // IsManagementType: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicyInformation{ + // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // }, + // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicyInformation{ + // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // }, + // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // IsManagementType: to.Ptr(armmanagednetworkfabric.IsManagementTypeTrue), // Layer2Configuration: &armmanagednetworkfabric.Layer2Configuration{ // Interfaces: []*string{ - // to.Ptr("defaultInterface")}, - // Mtu: to.Ptr[int32](2516), - // PortCount: to.Ptr[int32](3), - // }, - // Layer3Configuration: &armmanagednetworkfabric.Layer3Configuration{ - // PrimaryIPv4Prefix: to.Ptr("172.31.0.0/31"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), - // SecondaryIPv4Prefix: to.Ptr("172.31.0.20/31"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), - // ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2"), - // FabricASN: to.Ptr[int32](1253), - // ImportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName1"), - // PeerASN: to.Ptr[int32](50272), - // VlanID: to.Ptr[int32](2064), + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, + // Mtu: to.Ptr[int32](1500), // }, // NniType: to.Ptr(armmanagednetworkfabric.NniTypeCE), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // UseOptionB: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), + // NpbStaticRouteConfiguration: &armmanagednetworkfabric.NpbStaticRouteConfiguration{ + // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](25), + // }, + // IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ + // { + // NextHop: []*string{ + // to.Ptr("21.20.20.20")}, + // Prefix: to.Ptr("20.0.0.12/30"), + // }}, + // IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ + // { + // NextHop: []*string{ + // to.Ptr("4FFE:FFFF:0:CD30::ac")}, + // Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/127"), + // }}, + // }, + // OptionBLayer3Configuration: &armmanagednetworkfabric.NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), + // SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), + // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + // FabricASN: to.Ptr[int64](17), + // PeerASN: to.Ptr[int64](61234), + // VlanID: to.Ptr[int32](1234), + // }, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // UseOptionB: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Update_MaximumSet_Gen.json +func ExampleNetworkToNetworkInterconnectsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkToNetworkInterconnectsClient().BeginUpdate(ctx, "example-rg", "example-fabric", "example-nni", armmanagednetworkfabric.NetworkToNetworkInterconnectPatch{ + Properties: &armmanagednetworkfabric.NetworkToNetworkInterconnectPatchableProperties{ + EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicyInformation{ + ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), + ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), + }, + ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicyInformation{ + ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), + ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), + }, + IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + Layer2Configuration: &armmanagednetworkfabric.Layer2Configuration{ + Interfaces: []*string{ + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, + Mtu: to.Ptr[int32](1500), + }, + NpbStaticRouteConfiguration: &armmanagednetworkfabric.NpbStaticRouteConfiguration{ + BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + IntervalInMilliSeconds: to.Ptr[int32](310), + Multiplier: to.Ptr[int32](15), + }, + IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ + { + NextHop: []*string{ + to.Ptr("21.20.20.10")}, + Prefix: to.Ptr("20.0.0.11/30"), + }}, + IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ + { + NextHop: []*string{ + to.Ptr("5FFE:FFFF:0:CD30::ac")}, + Prefix: to.Ptr("4FFE:FFFF:0:CD30::ac/127"), + }}, + }, + OptionBLayer3Configuration: &armmanagednetworkfabric.OptionBLayer3Configuration{ + PrimaryIPv4Prefix: to.Ptr("20.0.0.12/29"), + PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), + SecondaryIPv4Prefix: to.Ptr("20.0.0.14/29"), + SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + PeerASN: to.Ptr[int64](2345), + VlanID: to.Ptr[int32](1235), + }, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.NetworkToNetworkInterconnect = armmanagednetworkfabric.NetworkToNetworkInterconnect{ + // Name: to.Ptr("example-nni"), + // Type: to.Ptr("microsoft.managedNetworkFabric/networkFabrics/networkToNetworkInterconnects"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), + // SystemData: &armmanagednetworkfabric.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), + // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // }, + // Properties: &armmanagednetworkfabric.NetworkToNetworkInterconnectProperties{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicyInformation{ + // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), // }, - // } + // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicyInformation{ + // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // }, + // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // IsManagementType: to.Ptr(armmanagednetworkfabric.IsManagementTypeTrue), + // Layer2Configuration: &armmanagednetworkfabric.Layer2Configuration{ + // Interfaces: []*string{ + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, + // Mtu: to.Ptr[int32](1500), + // }, + // NniType: to.Ptr(armmanagednetworkfabric.NniTypeCE), + // NpbStaticRouteConfiguration: &armmanagednetworkfabric.NpbStaticRouteConfiguration{ + // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](25), + // }, + // IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ + // { + // NextHop: []*string{ + // to.Ptr("21.20.20.20")}, + // Prefix: to.Ptr("20.0.0.12/30"), + // }}, + // IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ + // { + // NextHop: []*string{ + // to.Ptr("4FFE:FFFF:0:CD30::ac")}, + // Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/127"), + // }}, + // }, + // OptionBLayer3Configuration: &armmanagednetworkfabric.NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), + // SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), + // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + // FabricASN: to.Ptr[int64](17), + // PeerASN: to.Ptr[int64](61234), + // VlanID: to.Ptr[int32](1234), + // }, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // UseOptionB: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkToNetworkInterconnects_Delete_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Delete_MaximumSet_Gen.json func ExampleNetworkToNetworkInterconnectsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -167,7 +380,7 @@ func ExampleNetworkToNetworkInterconnectsClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNetworkToNetworkInterconnectsClient().BeginDelete(ctx, "resourceGroupName", "FabricName", "DefaultNNI", nil) + poller, err := clientFactory.NewNetworkToNetworkInterconnectsClient().BeginDelete(ctx, "example-rg", "example-fabric", "example-nni", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -177,8 +390,8 @@ func ExampleNetworkToNetworkInterconnectsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkToNetworkInterconnects_List_MaximumSet_Gen.json -func ExampleNetworkToNetworkInterconnectsClient_NewListPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_ListByNetworkFabric_MaximumSet_Gen.json +func ExampleNetworkToNetworkInterconnectsClient_NewListByNetworkFabricPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -188,7 +401,7 @@ func ExampleNetworkToNetworkInterconnectsClient_NewListPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewNetworkToNetworkInterconnectsClient().NewListPager("resourceGroupName", "FabricName", nil) + pager := clientFactory.NewNetworkToNetworkInterconnectsClient().NewListByNetworkFabricPager("example-rg", "example-fabric", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -202,42 +415,157 @@ func ExampleNetworkToNetworkInterconnectsClient_NewListPager() { // page.NetworkToNetworkInterconnectsList = armmanagednetworkfabric.NetworkToNetworkInterconnectsList{ // Value: []*armmanagednetworkfabric.NetworkToNetworkInterconnect{ // { - // Name: to.Ptr("DefaultNNI"), - // Type: to.Ptr("Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnects/DefaultNNI"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName/networkToNetworkInterconnects/DefaultNNI"), + // Name: to.Ptr("example-nni"), + // Type: to.Ptr("microsoft.managedNetworkFabric/networkFabrics/networkToNetworkInterconnects"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-11T04:17:22.639Z"); return t}()), - // CreatedBy: to.Ptr("User@email.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-11T04:17:22.639Z"); return t}()), - // LastModifiedBy: to.Ptr("tcycax"), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, // Properties: &armmanagednetworkfabric.NetworkToNetworkInterconnectProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.EnabledDisabledStateEnabled), - // IsManagementType: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicyInformation{ + // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // }, + // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicyInformation{ + // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), + // }, + // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), + // IsManagementType: to.Ptr(armmanagednetworkfabric.IsManagementTypeTrue), // Layer2Configuration: &armmanagednetworkfabric.Layer2Configuration{ // Interfaces: []*string{ - // to.Ptr("defaultInterface")}, - // Mtu: to.Ptr[int32](2516), - // PortCount: to.Ptr[int32](3), - // }, - // Layer3Configuration: &armmanagednetworkfabric.Layer3Configuration{ - // PrimaryIPv4Prefix: to.Ptr("172.31.0.0/31"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), - // SecondaryIPv4Prefix: to.Ptr("172.31.0.20/31"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), - // ExportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2"), - // FabricASN: to.Ptr[int32](1253), - // ImportRoutePolicyID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName1"), - // PeerASN: to.Ptr[int32](50272), - // VlanID: to.Ptr[int32](2064), + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, + // Mtu: to.Ptr[int32](1500), // }, // NniType: to.Ptr(armmanagednetworkfabric.NniTypeCE), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // UseOptionB: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // }, - // }}, - // } + // NpbStaticRouteConfiguration: &armmanagednetworkfabric.NpbStaticRouteConfiguration{ + // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ + // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), + // IntervalInMilliSeconds: to.Ptr[int32](300), + // Multiplier: to.Ptr[int32](25), + // }, + // IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ + // { + // NextHop: []*string{ + // to.Ptr("21.20.20.20")}, + // Prefix: to.Ptr("20.0.0.12/30"), + // }}, + // IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ + // { + // NextHop: []*string{ + // to.Ptr("4FFE:FFFF:0:CD30::ac")}, + // Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/127"), + // }}, + // }, + // OptionBLayer3Configuration: &armmanagednetworkfabric.NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration{ + // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), + // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), + // SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), + // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), + // FabricASN: to.Ptr[int64](17), + // PeerASN: to.Ptr[int64](61234), + // VlanID: to.Ptr[int32](1234), + // }, + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // UseOptionB: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_updateNpbStaticRouteBfdAdministrativeState_MaximumSet_Gen.json +func ExampleNetworkToNetworkInterconnectsClient_BeginUpdateNpbStaticRouteBfdAdministrativeState() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) } + poller, err := clientFactory.NewNetworkToNetworkInterconnectsClient().BeginUpdateNpbStaticRouteBfdAdministrativeState(ctx, "example-rg", "example-fabric", "example-nni", armmanagednetworkfabric.UpdateAdministrativeState{ + ResourceIDs: []*string{ + to.Ptr("")}, + State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_updateAdministrativeState_MaximumSet_Gen.json +func ExampleNetworkToNetworkInterconnectsClient_BeginUpdateAdministrativeState() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkToNetworkInterconnectsClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-fabric", "example-nni", armmanagednetworkfabric.UpdateAdministrativeState{ + ResourceIDs: []*string{ + to.Ptr("")}, + State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/operations_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/operations_client.go index 73680809b5ae..e025f85366fb 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/operations_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/operations_client.go @@ -40,7 +40,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Returns list of all operations. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -78,7 +78,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/operations_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/operations_client_example_test.go index 44f134c21d2e..6f40a9472cd7 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/operations_client_example_test.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/operations_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ListOperations.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ListOperations.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/response_types.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/response_types.go index 08a29cc885b1..42276005dd00 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/response_types.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/response_types.go @@ -9,14 +9,12 @@ package armmanagednetworkfabric -import "encoding/json" - -// AccessControlListsClientCreateResponse contains the response from method AccessControlListsClient.Create. +// AccessControlListsClientCreateResponse contains the response from method AccessControlListsClient.BeginCreate. type AccessControlListsClientCreateResponse struct { AccessControlList } -// AccessControlListsClientDeleteResponse contains the response from method AccessControlListsClient.Delete. +// AccessControlListsClientDeleteResponse contains the response from method AccessControlListsClient.BeginDelete. type AccessControlListsClientDeleteResponse struct { // placeholder for future response values } @@ -36,19 +34,24 @@ type AccessControlListsClientListBySubscriptionResponse struct { AccessControlListsListResult } -// AccessControlListsClientUpdateResponse contains the response from method AccessControlListsClient.Update. -type AccessControlListsClientUpdateResponse struct { - AccessControlList +// AccessControlListsClientResyncResponse contains the response from method AccessControlListsClient.BeginResync. +type AccessControlListsClientResyncResponse struct { + CommonPostActionResponseForStateUpdate } -// ExternalNetworksClientClearArpEntriesResponse contains the response from method ExternalNetworksClient.BeginClearArpEntries. -type ExternalNetworksClientClearArpEntriesResponse struct { - // placeholder for future response values +// AccessControlListsClientUpdateAdministrativeStateResponse contains the response from method AccessControlListsClient.BeginUpdateAdministrativeState. +type AccessControlListsClientUpdateAdministrativeStateResponse struct { + CommonPostActionResponseForStateUpdate } -// ExternalNetworksClientClearIPv6NeighborsResponse contains the response from method ExternalNetworksClient.BeginClearIPv6Neighbors. -type ExternalNetworksClientClearIPv6NeighborsResponse struct { - // placeholder for future response values +// AccessControlListsClientUpdateResponse contains the response from method AccessControlListsClient.BeginUpdate. +type AccessControlListsClientUpdateResponse struct { + AccessControlList +} + +// AccessControlListsClientValidateConfigurationResponse contains the response from method AccessControlListsClient.BeginValidateConfiguration. +type AccessControlListsClientValidateConfigurationResponse struct { + ValidateConfigurationResponse } // ExternalNetworksClientCreateResponse contains the response from method ExternalNetworksClient.BeginCreate. @@ -66,24 +69,14 @@ type ExternalNetworksClientGetResponse struct { ExternalNetwork } -// ExternalNetworksClientListResponse contains the response from method ExternalNetworksClient.NewListPager. -type ExternalNetworksClientListResponse struct { +// ExternalNetworksClientListByL3IsolationDomainResponse contains the response from method ExternalNetworksClient.NewListByL3IsolationDomainPager. +type ExternalNetworksClientListByL3IsolationDomainResponse struct { ExternalNetworksList } // ExternalNetworksClientUpdateAdministrativeStateResponse contains the response from method ExternalNetworksClient.BeginUpdateAdministrativeState. type ExternalNetworksClientUpdateAdministrativeStateResponse struct { - // placeholder for future response values -} - -// ExternalNetworksClientUpdateBfdForBgpAdministrativeStateResponse contains the response from method ExternalNetworksClient.BeginUpdateBfdForBgpAdministrativeState. -type ExternalNetworksClientUpdateBfdForBgpAdministrativeStateResponse struct { - // placeholder for future response values -} - -// ExternalNetworksClientUpdateBgpAdministrativeStateResponse contains the response from method ExternalNetworksClient.BeginUpdateBgpAdministrativeState. -type ExternalNetworksClientUpdateBgpAdministrativeStateResponse struct { - // placeholder for future response values + CommonPostActionResponseForStateUpdate } // ExternalNetworksClientUpdateResponse contains the response from method ExternalNetworksClient.BeginUpdate. @@ -91,6 +84,11 @@ type ExternalNetworksClientUpdateResponse struct { ExternalNetwork } +// ExternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse contains the response from method ExternalNetworksClient.BeginUpdateStaticRouteBfdAdministrativeState. +type ExternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse struct { + CommonPostActionResponseForStateUpdate +} + // IPCommunitiesClientCreateResponse contains the response from method IPCommunitiesClient.BeginCreate. type IPCommunitiesClientCreateResponse struct { IPCommunity @@ -181,16 +179,6 @@ type IPPrefixesClientUpdateResponse struct { IPPrefix } -// InternalNetworksClientClearArpEntriesResponse contains the response from method InternalNetworksClient.BeginClearArpEntries. -type InternalNetworksClientClearArpEntriesResponse struct { - // placeholder for future response values -} - -// InternalNetworksClientClearIPv6NeighborsResponse contains the response from method InternalNetworksClient.BeginClearIPv6Neighbors. -type InternalNetworksClientClearIPv6NeighborsResponse struct { - // placeholder for future response values -} - // InternalNetworksClientCreateResponse contains the response from method InternalNetworksClient.BeginCreate. type InternalNetworksClientCreateResponse struct { InternalNetwork @@ -206,29 +194,19 @@ type InternalNetworksClientGetResponse struct { InternalNetwork } -// InternalNetworksClientListResponse contains the response from method InternalNetworksClient.NewListPager. -type InternalNetworksClientListResponse struct { +// InternalNetworksClientListByL3IsolationDomainResponse contains the response from method InternalNetworksClient.NewListByL3IsolationDomainPager. +type InternalNetworksClientListByL3IsolationDomainResponse struct { InternalNetworksList } // InternalNetworksClientUpdateAdministrativeStateResponse contains the response from method InternalNetworksClient.BeginUpdateAdministrativeState. type InternalNetworksClientUpdateAdministrativeStateResponse struct { - // placeholder for future response values -} - -// InternalNetworksClientUpdateBfdForBgpAdministrativeStateResponse contains the response from method InternalNetworksClient.BeginUpdateBfdForBgpAdministrativeState. -type InternalNetworksClientUpdateBfdForBgpAdministrativeStateResponse struct { - // placeholder for future response values -} - -// InternalNetworksClientUpdateBfdForStaticRouteAdministrativeStateResponse contains the response from method InternalNetworksClient.BeginUpdateBfdForStaticRouteAdministrativeState. -type InternalNetworksClientUpdateBfdForStaticRouteAdministrativeStateResponse struct { - // placeholder for future response values + CommonPostActionResponseForStateUpdate } // InternalNetworksClientUpdateBgpAdministrativeStateResponse contains the response from method InternalNetworksClient.BeginUpdateBgpAdministrativeState. type InternalNetworksClientUpdateBgpAdministrativeStateResponse struct { - // placeholder for future response values + CommonPostActionResponseForStateUpdate } // InternalNetworksClientUpdateResponse contains the response from method InternalNetworksClient.BeginUpdate. @@ -236,16 +214,76 @@ type InternalNetworksClientUpdateResponse struct { InternalNetwork } -// L2IsolationDomainsClientClearArpTableResponse contains the response from method L2IsolationDomainsClient.BeginClearArpTable. -type L2IsolationDomainsClientClearArpTableResponse struct { +// InternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse contains the response from method InternalNetworksClient.BeginUpdateStaticRouteBfdAdministrativeState. +type InternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse struct { + CommonPostActionResponseForStateUpdate +} + +// InternetGatewayRulesClientCreateResponse contains the response from method InternetGatewayRulesClient.BeginCreate. +type InternetGatewayRulesClientCreateResponse struct { + InternetGatewayRule +} + +// InternetGatewayRulesClientDeleteResponse contains the response from method InternetGatewayRulesClient.BeginDelete. +type InternetGatewayRulesClientDeleteResponse struct { // placeholder for future response values } -// L2IsolationDomainsClientClearNeighborTableResponse contains the response from method L2IsolationDomainsClient.BeginClearNeighborTable. -type L2IsolationDomainsClientClearNeighborTableResponse struct { +// InternetGatewayRulesClientGetResponse contains the response from method InternetGatewayRulesClient.Get. +type InternetGatewayRulesClientGetResponse struct { + InternetGatewayRule +} + +// InternetGatewayRulesClientListByResourceGroupResponse contains the response from method InternetGatewayRulesClient.NewListByResourceGroupPager. +type InternetGatewayRulesClientListByResourceGroupResponse struct { + InternetGatewayRulesListResult +} + +// InternetGatewayRulesClientListBySubscriptionResponse contains the response from method InternetGatewayRulesClient.NewListBySubscriptionPager. +type InternetGatewayRulesClientListBySubscriptionResponse struct { + InternetGatewayRulesListResult +} + +// InternetGatewayRulesClientUpdateResponse contains the response from method InternetGatewayRulesClient.BeginUpdate. +type InternetGatewayRulesClientUpdateResponse struct { + InternetGatewayRule +} + +// InternetGatewaysClientCreateResponse contains the response from method InternetGatewaysClient.BeginCreate. +type InternetGatewaysClientCreateResponse struct { + InternetGateway +} + +// InternetGatewaysClientDeleteResponse contains the response from method InternetGatewaysClient.BeginDelete. +type InternetGatewaysClientDeleteResponse struct { // placeholder for future response values } +// InternetGatewaysClientGetResponse contains the response from method InternetGatewaysClient.Get. +type InternetGatewaysClientGetResponse struct { + InternetGateway +} + +// InternetGatewaysClientListByResourceGroupResponse contains the response from method InternetGatewaysClient.NewListByResourceGroupPager. +type InternetGatewaysClientListByResourceGroupResponse struct { + InternetGatewaysListResult +} + +// InternetGatewaysClientListBySubscriptionResponse contains the response from method InternetGatewaysClient.NewListBySubscriptionPager. +type InternetGatewaysClientListBySubscriptionResponse struct { + InternetGatewaysListResult +} + +// InternetGatewaysClientUpdateResponse contains the response from method InternetGatewaysClient.BeginUpdate. +type InternetGatewaysClientUpdateResponse struct { + InternetGateway +} + +// L2IsolationDomainsClientCommitConfigurationResponse contains the response from method L2IsolationDomainsClient.BeginCommitConfiguration. +type L2IsolationDomainsClientCommitConfigurationResponse struct { + CommonPostActionResponseForStateUpdate +} + // L2IsolationDomainsClientCreateResponse contains the response from method L2IsolationDomainsClient.BeginCreate. type L2IsolationDomainsClientCreateResponse struct { L2IsolationDomain @@ -256,17 +294,6 @@ type L2IsolationDomainsClientDeleteResponse struct { // placeholder for future response values } -// L2IsolationDomainsClientGetArpEntriesResponse contains the response from method L2IsolationDomainsClient.BeginGetArpEntries. -type L2IsolationDomainsClientGetArpEntriesResponse struct { - // Show ARP entries response per network device - Value map[string]*ARPProperties -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type L2IsolationDomainsClientGetArpEntriesResponse. -func (l *L2IsolationDomainsClientGetArpEntriesResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &l.Value) -} - // L2IsolationDomainsClientGetResponse contains the response from method L2IsolationDomainsClient.Get. type L2IsolationDomainsClientGetResponse struct { L2IsolationDomain @@ -284,7 +311,7 @@ type L2IsolationDomainsClientListBySubscriptionResponse struct { // L2IsolationDomainsClientUpdateAdministrativeStateResponse contains the response from method L2IsolationDomainsClient.BeginUpdateAdministrativeState. type L2IsolationDomainsClientUpdateAdministrativeStateResponse struct { - // placeholder for future response values + CommonPostActionResponseForDeviceUpdate } // L2IsolationDomainsClientUpdateResponse contains the response from method L2IsolationDomainsClient.BeginUpdate. @@ -292,14 +319,14 @@ type L2IsolationDomainsClientUpdateResponse struct { L2IsolationDomain } -// L3IsolationDomainsClientClearArpTableResponse contains the response from method L3IsolationDomainsClient.BeginClearArpTable. -type L3IsolationDomainsClientClearArpTableResponse struct { - // placeholder for future response values +// L2IsolationDomainsClientValidateConfigurationResponse contains the response from method L2IsolationDomainsClient.BeginValidateConfiguration. +type L2IsolationDomainsClientValidateConfigurationResponse struct { + ValidateConfigurationResponse } -// L3IsolationDomainsClientClearNeighborTableResponse contains the response from method L3IsolationDomainsClient.BeginClearNeighborTable. -type L3IsolationDomainsClientClearNeighborTableResponse struct { - // placeholder for future response values +// L3IsolationDomainsClientCommitConfigurationResponse contains the response from method L3IsolationDomainsClient.BeginCommitConfiguration. +type L3IsolationDomainsClientCommitConfigurationResponse struct { + CommonPostActionResponseForStateUpdate } // L3IsolationDomainsClientCreateResponse contains the response from method L3IsolationDomainsClient.BeginCreate. @@ -329,12 +356,7 @@ type L3IsolationDomainsClientListBySubscriptionResponse struct { // L3IsolationDomainsClientUpdateAdministrativeStateResponse contains the response from method L3IsolationDomainsClient.BeginUpdateAdministrativeState. type L3IsolationDomainsClientUpdateAdministrativeStateResponse struct { - // placeholder for future response values -} - -// L3IsolationDomainsClientUpdateOptionBAdministrativeStateResponse contains the response from method L3IsolationDomainsClient.BeginUpdateOptionBAdministrativeState. -type L3IsolationDomainsClientUpdateOptionBAdministrativeStateResponse struct { - // placeholder for future response values + CommonPostActionResponseForDeviceUpdate } // L3IsolationDomainsClientUpdateResponse contains the response from method L3IsolationDomainsClient.BeginUpdate. @@ -342,6 +364,41 @@ type L3IsolationDomainsClientUpdateResponse struct { L3IsolationDomain } +// L3IsolationDomainsClientValidateConfigurationResponse contains the response from method L3IsolationDomainsClient.BeginValidateConfiguration. +type L3IsolationDomainsClientValidateConfigurationResponse struct { + ValidateConfigurationResponse +} + +// NeighborGroupsClientCreateResponse contains the response from method NeighborGroupsClient.BeginCreate. +type NeighborGroupsClientCreateResponse struct { + NeighborGroup +} + +// NeighborGroupsClientDeleteResponse contains the response from method NeighborGroupsClient.BeginDelete. +type NeighborGroupsClientDeleteResponse struct { + // placeholder for future response values +} + +// NeighborGroupsClientGetResponse contains the response from method NeighborGroupsClient.Get. +type NeighborGroupsClientGetResponse struct { + NeighborGroup +} + +// NeighborGroupsClientListByResourceGroupResponse contains the response from method NeighborGroupsClient.NewListByResourceGroupPager. +type NeighborGroupsClientListByResourceGroupResponse struct { + NeighborGroupsListResult +} + +// NeighborGroupsClientListBySubscriptionResponse contains the response from method NeighborGroupsClient.NewListBySubscriptionPager. +type NeighborGroupsClientListBySubscriptionResponse struct { + NeighborGroupsListResult +} + +// NeighborGroupsClientUpdateResponse contains the response from method NeighborGroupsClient.BeginUpdate. +type NeighborGroupsClientUpdateResponse struct { + NeighborGroup +} + // NetworkDeviceSKUsClientGetResponse contains the response from method NetworkDeviceSKUsClient.Get. type NetworkDeviceSKUsClientGetResponse struct { NetworkDeviceSKU @@ -362,43 +419,11 @@ type NetworkDevicesClientDeleteResponse struct { // placeholder for future response values } -// NetworkDevicesClientGenerateSupportPackageResponse contains the response from method NetworkDevicesClient.BeginGenerateSupportPackage. -type NetworkDevicesClientGenerateSupportPackageResponse struct { - SupportPackageProperties -} - -// NetworkDevicesClientGetDynamicInterfaceMapsResponse contains the response from method NetworkDevicesClient.BeginGetDynamicInterfaceMaps. -type NetworkDevicesClientGetDynamicInterfaceMapsResponse struct { - // Layer 2 Network interfaces status - GetDynamicInterfaceMapsPropertiesItemArray []*GetDynamicInterfaceMapsPropertiesItem -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDevicesClientGetDynamicInterfaceMapsResponse. -func (n *NetworkDevicesClientGetDynamicInterfaceMapsResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &n.GetDynamicInterfaceMapsPropertiesItemArray) -} - // NetworkDevicesClientGetResponse contains the response from method NetworkDevicesClient.Get. type NetworkDevicesClientGetResponse struct { NetworkDevice } -// NetworkDevicesClientGetStaticInterfaceMapsResponse contains the response from method NetworkDevicesClient.BeginGetStaticInterfaceMaps. -type NetworkDevicesClientGetStaticInterfaceMapsResponse struct { - // Layer 2 Network interfaces status - GetStaticInterfaceMapsPropertiesItemArray []*GetStaticInterfaceMapsPropertiesItem -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkDevicesClientGetStaticInterfaceMapsResponse. -func (n *NetworkDevicesClientGetStaticInterfaceMapsResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &n.GetStaticInterfaceMapsPropertiesItemArray) -} - -// NetworkDevicesClientGetStatusResponse contains the response from method NetworkDevicesClient.BeginGetStatus. -type NetworkDevicesClientGetStatusResponse struct { - GetDeviceStatusProperties -} - // NetworkDevicesClientListByResourceGroupResponse contains the response from method NetworkDevicesClient.NewListByResourceGroupPager. type NetworkDevicesClientListByResourceGroupResponse struct { NetworkDevicesListResult @@ -411,17 +436,17 @@ type NetworkDevicesClientListBySubscriptionResponse struct { // NetworkDevicesClientRebootResponse contains the response from method NetworkDevicesClient.BeginReboot. type NetworkDevicesClientRebootResponse struct { - // placeholder for future response values + CommonPostActionResponseForStateUpdate } -// NetworkDevicesClientRestoreConfigResponse contains the response from method NetworkDevicesClient.BeginRestoreConfig. -type NetworkDevicesClientRestoreConfigResponse struct { - // placeholder for future response values +// NetworkDevicesClientRefreshConfigurationResponse contains the response from method NetworkDevicesClient.BeginRefreshConfiguration. +type NetworkDevicesClientRefreshConfigurationResponse struct { + CommonPostActionResponseForStateUpdate } -// NetworkDevicesClientUpdatePowerCycleResponse contains the response from method NetworkDevicesClient.BeginUpdatePowerCycle. -type NetworkDevicesClientUpdatePowerCycleResponse struct { - // placeholder for future response values +// NetworkDevicesClientUpdateAdministrativeStateResponse contains the response from method NetworkDevicesClient.BeginUpdateAdministrativeState. +type NetworkDevicesClientUpdateAdministrativeStateResponse struct { + CommonPostActionResponseForStateUpdate } // NetworkDevicesClientUpdateResponse contains the response from method NetworkDevicesClient.BeginUpdate. @@ -429,9 +454,9 @@ type NetworkDevicesClientUpdateResponse struct { NetworkDevice } -// NetworkDevicesClientUpdateVersionResponse contains the response from method NetworkDevicesClient.BeginUpdateVersion. -type NetworkDevicesClientUpdateVersionResponse struct { - // placeholder for future response values +// NetworkDevicesClientUpgradeResponse contains the response from method NetworkDevicesClient.BeginUpgrade. +type NetworkDevicesClientUpgradeResponse struct { + CommonPostActionResponseForStateUpdate } // NetworkFabricControllersClientCreateResponse contains the response from method NetworkFabricControllersClient.BeginCreate. @@ -444,16 +469,6 @@ type NetworkFabricControllersClientDeleteResponse struct { // placeholder for future response values } -// NetworkFabricControllersClientDisableWorkloadManagementNetworkResponse contains the response from method NetworkFabricControllersClient.BeginDisableWorkloadManagementNetwork. -type NetworkFabricControllersClientDisableWorkloadManagementNetworkResponse struct { - // placeholder for future response values -} - -// NetworkFabricControllersClientEnableWorkloadManagementNetworkResponse contains the response from method NetworkFabricControllersClient.BeginEnableWorkloadManagementNetwork. -type NetworkFabricControllersClientEnableWorkloadManagementNetworkResponse struct { - // placeholder for future response values -} - // NetworkFabricControllersClientGetResponse contains the response from method NetworkFabricControllersClient.Get. type NetworkFabricControllersClientGetResponse struct { NetworkFabricController @@ -484,6 +499,11 @@ type NetworkFabricSKUsClientListBySubscriptionResponse struct { NetworkFabricSKUsListResult } +// NetworkFabricsClientCommitConfigurationResponse contains the response from method NetworkFabricsClient.BeginCommitConfiguration. +type NetworkFabricsClientCommitConfigurationResponse struct { + CommonPostActionResponseForStateUpdate +} + // NetworkFabricsClientCreateResponse contains the response from method NetworkFabricsClient.BeginCreate. type NetworkFabricsClientCreateResponse struct { NetworkFabric @@ -496,7 +516,7 @@ type NetworkFabricsClientDeleteResponse struct { // NetworkFabricsClientDeprovisionResponse contains the response from method NetworkFabricsClient.BeginDeprovision. type NetworkFabricsClientDeprovisionResponse struct { - // placeholder for future response values + CommonPostActionResponseForDeviceUpdate } // NetworkFabricsClientGetResponse contains the response from method NetworkFabricsClient.Get. @@ -504,6 +524,11 @@ type NetworkFabricsClientGetResponse struct { NetworkFabric } +// NetworkFabricsClientGetTopologyResponse contains the response from method NetworkFabricsClient.BeginGetTopology. +type NetworkFabricsClientGetTopologyResponse struct { + ValidateConfigurationResponse +} + // NetworkFabricsClientListByResourceGroupResponse contains the response from method NetworkFabricsClient.NewListByResourceGroupPager. type NetworkFabricsClientListByResourceGroupResponse struct { NetworkFabricsListResult @@ -516,7 +541,17 @@ type NetworkFabricsClientListBySubscriptionResponse struct { // NetworkFabricsClientProvisionResponse contains the response from method NetworkFabricsClient.BeginProvision. type NetworkFabricsClientProvisionResponse struct { - // placeholder for future response values + CommonPostActionResponseForDeviceUpdate +} + +// NetworkFabricsClientRefreshConfigurationResponse contains the response from method NetworkFabricsClient.BeginRefreshConfiguration. +type NetworkFabricsClientRefreshConfigurationResponse struct { + CommonPostActionResponseForStateUpdate +} + +// NetworkFabricsClientUpdateInfraManagementBfdConfigurationResponse contains the response from method NetworkFabricsClient.BeginUpdateInfraManagementBfdConfiguration. +type NetworkFabricsClientUpdateInfraManagementBfdConfigurationResponse struct { + CommonPostActionResponseForStateUpdate } // NetworkFabricsClientUpdateResponse contains the response from method NetworkFabricsClient.BeginUpdate. @@ -524,6 +559,21 @@ type NetworkFabricsClientUpdateResponse struct { NetworkFabric } +// NetworkFabricsClientUpdateWorkloadManagementBfdConfigurationResponse contains the response from method NetworkFabricsClient.BeginUpdateWorkloadManagementBfdConfiguration. +type NetworkFabricsClientUpdateWorkloadManagementBfdConfigurationResponse struct { + CommonPostActionResponseForStateUpdate +} + +// NetworkFabricsClientUpgradeResponse contains the response from method NetworkFabricsClient.BeginUpgrade. +type NetworkFabricsClientUpgradeResponse struct { + CommonPostActionResponseForStateUpdate +} + +// NetworkFabricsClientValidateConfigurationResponse contains the response from method NetworkFabricsClient.BeginValidateConfiguration. +type NetworkFabricsClientValidateConfigurationResponse struct { + ValidateConfigurationResponse +} + // NetworkInterfacesClientCreateResponse contains the response from method NetworkInterfacesClient.BeginCreate. type NetworkInterfacesClientCreateResponse struct { NetworkInterface @@ -539,19 +589,14 @@ type NetworkInterfacesClientGetResponse struct { NetworkInterface } -// NetworkInterfacesClientGetStatusResponse contains the response from method NetworkInterfacesClient.BeginGetStatus. -type NetworkInterfacesClientGetStatusResponse struct { - InterfaceStatus -} - -// NetworkInterfacesClientListResponse contains the response from method NetworkInterfacesClient.NewListPager. -type NetworkInterfacesClientListResponse struct { +// NetworkInterfacesClientListByNetworkDeviceResponse contains the response from method NetworkInterfacesClient.NewListByNetworkDevicePager. +type NetworkInterfacesClientListByNetworkDeviceResponse struct { NetworkInterfacesList } // NetworkInterfacesClientUpdateAdministrativeStateResponse contains the response from method NetworkInterfacesClient.BeginUpdateAdministrativeState. type NetworkInterfacesClientUpdateAdministrativeStateResponse struct { - // placeholder for future response values + CommonPostActionResponseForStateUpdate } // NetworkInterfacesClientUpdateResponse contains the response from method NetworkInterfacesClient.BeginUpdate. @@ -559,14 +604,34 @@ type NetworkInterfacesClientUpdateResponse struct { NetworkInterface } -// NetworkRackSKUsClientGetResponse contains the response from method NetworkRackSKUsClient.Get. -type NetworkRackSKUsClientGetResponse struct { - NetworkRackSKU +// NetworkPacketBrokersClientCreateResponse contains the response from method NetworkPacketBrokersClient.BeginCreate. +type NetworkPacketBrokersClientCreateResponse struct { + NetworkPacketBroker +} + +// NetworkPacketBrokersClientDeleteResponse contains the response from method NetworkPacketBrokersClient.BeginDelete. +type NetworkPacketBrokersClientDeleteResponse struct { + // placeholder for future response values +} + +// NetworkPacketBrokersClientGetResponse contains the response from method NetworkPacketBrokersClient.Get. +type NetworkPacketBrokersClientGetResponse struct { + NetworkPacketBroker } -// NetworkRackSKUsClientListBySubscriptionResponse contains the response from method NetworkRackSKUsClient.NewListBySubscriptionPager. -type NetworkRackSKUsClientListBySubscriptionResponse struct { - NetworkRackSKUsListResult +// NetworkPacketBrokersClientListByResourceGroupResponse contains the response from method NetworkPacketBrokersClient.NewListByResourceGroupPager. +type NetworkPacketBrokersClientListByResourceGroupResponse struct { + NetworkPacketBrokersListResult +} + +// NetworkPacketBrokersClientListBySubscriptionResponse contains the response from method NetworkPacketBrokersClient.NewListBySubscriptionPager. +type NetworkPacketBrokersClientListBySubscriptionResponse struct { + NetworkPacketBrokersListResult +} + +// NetworkPacketBrokersClientUpdateResponse contains the response from method NetworkPacketBrokersClient.BeginUpdate. +type NetworkPacketBrokersClientUpdateResponse struct { + NetworkPacketBroker } // NetworkRacksClientCreateResponse contains the response from method NetworkRacksClient.BeginCreate. @@ -599,6 +664,91 @@ type NetworkRacksClientUpdateResponse struct { NetworkRack } +// NetworkTapRulesClientCreateResponse contains the response from method NetworkTapRulesClient.BeginCreate. +type NetworkTapRulesClientCreateResponse struct { + NetworkTapRule +} + +// NetworkTapRulesClientDeleteResponse contains the response from method NetworkTapRulesClient.BeginDelete. +type NetworkTapRulesClientDeleteResponse struct { + // placeholder for future response values +} + +// NetworkTapRulesClientGetResponse contains the response from method NetworkTapRulesClient.Get. +type NetworkTapRulesClientGetResponse struct { + NetworkTapRule +} + +// NetworkTapRulesClientListByResourceGroupResponse contains the response from method NetworkTapRulesClient.NewListByResourceGroupPager. +type NetworkTapRulesClientListByResourceGroupResponse struct { + NetworkTapRulesListResult +} + +// NetworkTapRulesClientListBySubscriptionResponse contains the response from method NetworkTapRulesClient.NewListBySubscriptionPager. +type NetworkTapRulesClientListBySubscriptionResponse struct { + NetworkTapRulesListResult +} + +// NetworkTapRulesClientResyncResponse contains the response from method NetworkTapRulesClient.BeginResync. +type NetworkTapRulesClientResyncResponse struct { + CommonPostActionResponseForStateUpdate +} + +// NetworkTapRulesClientUpdateAdministrativeStateResponse contains the response from method NetworkTapRulesClient.BeginUpdateAdministrativeState. +type NetworkTapRulesClientUpdateAdministrativeStateResponse struct { + CommonPostActionResponseForStateUpdate +} + +// NetworkTapRulesClientUpdateResponse contains the response from method NetworkTapRulesClient.BeginUpdate. +type NetworkTapRulesClientUpdateResponse struct { + NetworkTapRule +} + +// NetworkTapRulesClientValidateConfigurationResponse contains the response from method NetworkTapRulesClient.BeginValidateConfiguration. +type NetworkTapRulesClientValidateConfigurationResponse struct { + ValidateConfigurationResponse +} + +// NetworkTapsClientCreateResponse contains the response from method NetworkTapsClient.BeginCreate. +type NetworkTapsClientCreateResponse struct { + NetworkTap +} + +// NetworkTapsClientDeleteResponse contains the response from method NetworkTapsClient.BeginDelete. +type NetworkTapsClientDeleteResponse struct { + // placeholder for future response values +} + +// NetworkTapsClientGetResponse contains the response from method NetworkTapsClient.Get. +type NetworkTapsClientGetResponse struct { + NetworkTap +} + +// NetworkTapsClientListByResourceGroupResponse contains the response from method NetworkTapsClient.NewListByResourceGroupPager. +type NetworkTapsClientListByResourceGroupResponse struct { + NetworkTapsListResult +} + +// NetworkTapsClientListBySubscriptionResponse contains the response from method NetworkTapsClient.NewListBySubscriptionPager. +type NetworkTapsClientListBySubscriptionResponse struct { + NetworkTapsListResult +} + +// NetworkTapsClientResyncResponse contains the response from method NetworkTapsClient.BeginResync. +type NetworkTapsClientResyncResponse struct { + CommonPostActionResponseForStateUpdate +} + +// NetworkTapsClientUpdateAdministrativeStateResponse contains the response from method NetworkTapsClient.BeginUpdateAdministrativeState. +type NetworkTapsClientUpdateAdministrativeStateResponse struct { + CommonPostActionResponseForDeviceUpdate +} + +// NetworkTapsClientUpdateResponse contains the response from method NetworkTapsClient.BeginUpdate. +type NetworkTapsClientUpdateResponse struct { + NetworkTap +} + // NetworkToNetworkInterconnectsClientCreateResponse contains the response from method NetworkToNetworkInterconnectsClient.BeginCreate. type NetworkToNetworkInterconnectsClientCreateResponse struct { NetworkToNetworkInterconnect @@ -614,16 +764,37 @@ type NetworkToNetworkInterconnectsClientGetResponse struct { NetworkToNetworkInterconnect } -// NetworkToNetworkInterconnectsClientListResponse contains the response from method NetworkToNetworkInterconnectsClient.NewListPager. -type NetworkToNetworkInterconnectsClientListResponse struct { +// NetworkToNetworkInterconnectsClientListByNetworkFabricResponse contains the response from method NetworkToNetworkInterconnectsClient.NewListByNetworkFabricPager. +type NetworkToNetworkInterconnectsClientListByNetworkFabricResponse struct { NetworkToNetworkInterconnectsList } +// NetworkToNetworkInterconnectsClientUpdateAdministrativeStateResponse contains the response from method NetworkToNetworkInterconnectsClient.BeginUpdateAdministrativeState. +type NetworkToNetworkInterconnectsClientUpdateAdministrativeStateResponse struct { + CommonPostActionResponseForStateUpdate +} + +// NetworkToNetworkInterconnectsClientUpdateNpbStaticRouteBfdAdministrativeStateResponse contains the response from method +// NetworkToNetworkInterconnectsClient.BeginUpdateNpbStaticRouteBfdAdministrativeState. +type NetworkToNetworkInterconnectsClientUpdateNpbStaticRouteBfdAdministrativeStateResponse struct { + CommonPostActionResponseForStateUpdate +} + +// NetworkToNetworkInterconnectsClientUpdateResponse contains the response from method NetworkToNetworkInterconnectsClient.BeginUpdate. +type NetworkToNetworkInterconnectsClientUpdateResponse struct { + NetworkToNetworkInterconnect +} + // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationListResult } +// RoutePoliciesClientCommitConfigurationResponse contains the response from method RoutePoliciesClient.BeginCommitConfiguration. +type RoutePoliciesClientCommitConfigurationResponse struct { + CommonPostActionResponseForStateUpdate +} + // RoutePoliciesClientCreateResponse contains the response from method RoutePoliciesClient.BeginCreate. type RoutePoliciesClientCreateResponse struct { RoutePolicy @@ -649,7 +820,17 @@ type RoutePoliciesClientListBySubscriptionResponse struct { RoutePoliciesListResult } +// RoutePoliciesClientUpdateAdministrativeStateResponse contains the response from method RoutePoliciesClient.BeginUpdateAdministrativeState. +type RoutePoliciesClientUpdateAdministrativeStateResponse struct { + CommonPostActionResponseForDeviceUpdate +} + // RoutePoliciesClientUpdateResponse contains the response from method RoutePoliciesClient.BeginUpdate. type RoutePoliciesClientUpdateResponse struct { RoutePolicy } + +// RoutePoliciesClientValidateConfigurationResponse contains the response from method RoutePoliciesClient.BeginValidateConfiguration. +type RoutePoliciesClientValidateConfigurationResponse struct { + ValidateConfigurationResponse +} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/routepolicies_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/routepolicies_client.go index c884f263c4fb..04266067b4c3 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/routepolicies_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/routepolicies_client.go @@ -29,7 +29,7 @@ type RoutePoliciesClient struct { } // NewRoutePoliciesClient creates a new instance of RoutePoliciesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewRoutePoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RoutePoliciesClient, error) { @@ -44,12 +44,76 @@ func NewRoutePoliciesClient(subscriptionID string, credential azcore.TokenCreden return client, nil } +// BeginCommitConfiguration - Commits the configuration of the given resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - routePolicyName - Name of the Route Policy. +// - options - RoutePoliciesClientBeginCommitConfigurationOptions contains the optional parameters for the RoutePoliciesClient.BeginCommitConfiguration +// method. +func (client *RoutePoliciesClient) BeginCommitConfiguration(ctx context.Context, resourceGroupName string, routePolicyName string, options *RoutePoliciesClientBeginCommitConfigurationOptions) (*runtime.Poller[RoutePoliciesClientCommitConfigurationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.commitConfiguration(ctx, resourceGroupName, routePolicyName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutePoliciesClientCommitConfigurationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[RoutePoliciesClientCommitConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CommitConfiguration - Commits the configuration of the given resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *RoutePoliciesClient) commitConfiguration(ctx context.Context, resourceGroupName string, routePolicyName string, options *RoutePoliciesClientBeginCommitConfigurationOptions) (*http.Response, error) { + req, err := client.commitConfigurationCreateRequest(ctx, resourceGroupName, routePolicyName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// commitConfigurationCreateRequest creates the CommitConfiguration request. +func (client *RoutePoliciesClient) commitConfigurationCreateRequest(ctx context.Context, resourceGroupName string, routePolicyName string, options *RoutePoliciesClientBeginCommitConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/commitConfiguration" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routePolicyName == "" { + return nil, errors.New("parameter routePolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routePolicyName}", url.PathEscape(routePolicyName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // BeginCreate - Implements Route Policy PUT method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - routePolicyName - Name of the Route Policy +// - routePolicyName - Name of the Route Policy. // - body - Request payload. // - options - RoutePoliciesClientBeginCreateOptions contains the optional parameters for the RoutePoliciesClient.BeginCreate // method. @@ -70,7 +134,7 @@ func (client *RoutePoliciesClient) BeginCreate(ctx context.Context, resourceGrou // Create - Implements Route Policy PUT method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *RoutePoliciesClient) create(ctx context.Context, resourceGroupName string, routePolicyName string, body RoutePolicy, options *RoutePoliciesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, routePolicyName, body, options) if err != nil { @@ -89,9 +153,6 @@ func (client *RoutePoliciesClient) create(ctx context.Context, resourceGroupName // createCreateRequest creates the Create request. func (client *RoutePoliciesClient) createCreateRequest(ctx context.Context, resourceGroupName string, routePolicyName string, body RoutePolicy, options *RoutePoliciesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -106,7 +167,7 @@ func (client *RoutePoliciesClient) createCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -115,9 +176,9 @@ func (client *RoutePoliciesClient) createCreateRequest(ctx context.Context, reso // BeginDelete - Implements Route Policy DELETE method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - routePolicyName - Name of the Route Policy +// - routePolicyName - Name of the Route Policy. // - options - RoutePoliciesClientBeginDeleteOptions contains the optional parameters for the RoutePoliciesClient.BeginDelete // method. func (client *RoutePoliciesClient) BeginDelete(ctx context.Context, resourceGroupName string, routePolicyName string, options *RoutePoliciesClientBeginDeleteOptions) (*runtime.Poller[RoutePoliciesClientDeleteResponse], error) { @@ -137,7 +198,7 @@ func (client *RoutePoliciesClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Implements Route Policy DELETE method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *RoutePoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, routePolicyName string, options *RoutePoliciesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, routePolicyName, options) if err != nil { @@ -147,7 +208,7 @@ func (client *RoutePoliciesClient) deleteOperation(ctx context.Context, resource if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -156,9 +217,6 @@ func (client *RoutePoliciesClient) deleteOperation(ctx context.Context, resource // deleteCreateRequest creates the Delete request. func (client *RoutePoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, routePolicyName string, options *RoutePoliciesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -173,7 +231,7 @@ func (client *RoutePoliciesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,9 +240,9 @@ func (client *RoutePoliciesClient) deleteCreateRequest(ctx context.Context, reso // Get - Implements Route Policy GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - routePolicyName - Name of the Route Policy +// - routePolicyName - Name of the Route Policy. // - options - RoutePoliciesClientGetOptions contains the optional parameters for the RoutePoliciesClient.Get method. func (client *RoutePoliciesClient) Get(ctx context.Context, resourceGroupName string, routePolicyName string, options *RoutePoliciesClientGetOptions) (RoutePoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, routePolicyName, options) @@ -204,9 +262,6 @@ func (client *RoutePoliciesClient) Get(ctx context.Context, resourceGroupName st // getCreateRequest creates the Get request. func (client *RoutePoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, routePolicyName string, options *RoutePoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -221,7 +276,7 @@ func (client *RoutePoliciesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,7 +293,7 @@ func (client *RoutePoliciesClient) getHandleResponse(resp *http.Response) (Route // NewListByResourceGroupPager - Implements RoutePolicies list by resource group GET method. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - RoutePoliciesClientListByResourceGroupOptions contains the optional parameters for the RoutePoliciesClient.NewListByResourceGroupPager // method. @@ -273,9 +328,6 @@ func (client *RoutePoliciesClient) NewListByResourceGroupPager(resourceGroupName // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *RoutePoliciesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *RoutePoliciesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -286,7 +338,7 @@ func (client *RoutePoliciesClient) listByResourceGroupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,7 +355,7 @@ func (client *RoutePoliciesClient) listByResourceGroupHandleResponse(resp *http. // NewListBySubscriptionPager - Implements RoutePolicies list by subscription GET method. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - options - RoutePoliciesClientListBySubscriptionOptions contains the optional parameters for the RoutePoliciesClient.NewListBySubscriptionPager // method. func (client *RoutePoliciesClient) NewListBySubscriptionPager(options *RoutePoliciesClientListBySubscriptionOptions) *runtime.Pager[RoutePoliciesClientListBySubscriptionResponse] { @@ -337,16 +389,13 @@ func (client *RoutePoliciesClient) NewListBySubscriptionPager(options *RoutePoli // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *RoutePoliciesClient) listBySubscriptionCreateRequest(ctx context.Context, options *RoutePoliciesClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/routePolicies" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -364,9 +413,9 @@ func (client *RoutePoliciesClient) listBySubscriptionHandleResponse(resp *http.R // BeginUpdate - API to update certain properties of the Route Policy resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - routePolicyName - Name of the Route Policy +// - routePolicyName - Name of the Route Policy. // - body - Route Policy properties to update. // - options - RoutePoliciesClientBeginUpdateOptions contains the optional parameters for the RoutePoliciesClient.BeginUpdate // method. @@ -387,7 +436,7 @@ func (client *RoutePoliciesClient) BeginUpdate(ctx context.Context, resourceGrou // Update - API to update certain properties of the Route Policy resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-06-15 func (client *RoutePoliciesClient) update(ctx context.Context, resourceGroupName string, routePolicyName string, body RoutePolicyPatch, options *RoutePoliciesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, routePolicyName, body, options) if err != nil { @@ -406,9 +455,6 @@ func (client *RoutePoliciesClient) update(ctx context.Context, resourceGroupName // updateCreateRequest creates the Update request. func (client *RoutePoliciesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, routePolicyName string, body RoutePolicyPatch, options *RoutePoliciesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -423,8 +469,137 @@ func (client *RoutePoliciesClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, body) +} + +// BeginUpdateAdministrativeState - Updated the admin state for this Route Policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - routePolicyName - Name of the Route Policy. +// - body - Request payload. +// - options - RoutePoliciesClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the RoutePoliciesClient.BeginUpdateAdministrativeState +// method. +func (client *RoutePoliciesClient) BeginUpdateAdministrativeState(ctx context.Context, resourceGroupName string, routePolicyName string, body UpdateAdministrativeState, options *RoutePoliciesClientBeginUpdateAdministrativeStateOptions) (*runtime.Poller[RoutePoliciesClientUpdateAdministrativeStateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateAdministrativeState(ctx, resourceGroupName, routePolicyName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutePoliciesClientUpdateAdministrativeStateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[RoutePoliciesClientUpdateAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateAdministrativeState - Updated the admin state for this Route Policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *RoutePoliciesClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, routePolicyName string, body UpdateAdministrativeState, options *RoutePoliciesClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { + req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, routePolicyName, body, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. +func (client *RoutePoliciesClient) updateAdministrativeStateCreateRequest(ctx context.Context, resourceGroupName string, routePolicyName string, body UpdateAdministrativeState, options *RoutePoliciesClientBeginUpdateAdministrativeStateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/updateAdministrativeState" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routePolicyName == "" { + return nil, errors.New("parameter routePolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routePolicyName}", url.PathEscape(routePolicyName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) } + +// BeginValidateConfiguration - Validates the configuration of the resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - routePolicyName - Name of the Route Policy. +// - options - RoutePoliciesClientBeginValidateConfigurationOptions contains the optional parameters for the RoutePoliciesClient.BeginValidateConfiguration +// method. +func (client *RoutePoliciesClient) BeginValidateConfiguration(ctx context.Context, resourceGroupName string, routePolicyName string, options *RoutePoliciesClientBeginValidateConfigurationOptions) (*runtime.Poller[RoutePoliciesClientValidateConfigurationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.validateConfiguration(ctx, resourceGroupName, routePolicyName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutePoliciesClientValidateConfigurationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[RoutePoliciesClientValidateConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ValidateConfiguration - Validates the configuration of the resources. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-15 +func (client *RoutePoliciesClient) validateConfiguration(ctx context.Context, resourceGroupName string, routePolicyName string, options *RoutePoliciesClientBeginValidateConfigurationOptions) (*http.Response, error) { + req, err := client.validateConfigurationCreateRequest(ctx, resourceGroupName, routePolicyName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// validateConfigurationCreateRequest creates the ValidateConfiguration request. +func (client *RoutePoliciesClient) validateConfigurationCreateRequest(ctx context.Context, resourceGroupName string, routePolicyName string, options *RoutePoliciesClientBeginValidateConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/validateConfiguration" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if routePolicyName == "" { + return nil, errors.New("parameter routePolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routePolicyName}", url.PathEscape(routePolicyName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/routepolicies_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/routepolicies_client_example_test.go index bc30d22ed92f..8199c3854143 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/routepolicies_client_example_test.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/routepolicies_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/RoutePolicies_Create_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Create_MaximumSet_Gen.json func ExampleRoutePoliciesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,57 +29,60 @@ func ExampleRoutePoliciesClient_BeginCreate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewRoutePoliciesClient().BeginCreate(ctx, "rgRoutePolicies", "routePolicyName", armmanagednetworkfabric.RoutePolicy{ - Location: to.Ptr("EastUS"), + poller, err := clientFactory.NewRoutePoliciesClient().BeginCreate(ctx, "example-rg", "example-routePolicy", armmanagednetworkfabric.RoutePolicy{ + Location: to.Ptr("eastus"), Tags: map[string]*string{ - "key8254": to.Ptr(""), + "keyID": to.Ptr("keyValue"), }, Properties: &armmanagednetworkfabric.RoutePolicyProperties{ - Annotation: to.Ptr("annotationValue"), + Annotation: to.Ptr("annotation"), Statements: []*armmanagednetworkfabric.RoutePolicyStatementProperties{ { - Annotation: to.Ptr("annotationValue"), + Annotation: to.Ptr("annotation"), Action: &armmanagednetworkfabric.StatementActionProperties{ - ActionType: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + ActionType: to.Ptr(armmanagednetworkfabric.RoutePolicyActionTypePermit), IPCommunityProperties: &armmanagednetworkfabric.ActionIPCommunityProperties{ Add: &armmanagednetworkfabric.IPCommunityIDList{ IPCommunityIDs: []*string{ - to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, }, Delete: &armmanagednetworkfabric.IPCommunityIDList{ IPCommunityIDs: []*string{ - to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, }, Set: &armmanagednetworkfabric.IPCommunityIDList{ IPCommunityIDs: []*string{ - to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, }, }, IPExtendedCommunityProperties: &armmanagednetworkfabric.ActionIPExtendedCommunityProperties{ Add: &armmanagednetworkfabric.IPExtendedCommunityIDList{ IPExtendedCommunityIDs: []*string{ - to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, }, Delete: &armmanagednetworkfabric.IPExtendedCommunityIDList{ IPExtendedCommunityIDs: []*string{ - to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, }, Set: &armmanagednetworkfabric.IPExtendedCommunityIDList{ IPExtendedCommunityIDs: []*string{ - to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, }, }, LocalPreference: to.Ptr[int64](20), }, Condition: &armmanagednetworkfabric.StatementConditionProperties{ IPCommunityIDs: []*string{ - to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, IPExtendedCommunityIDs: []*string{ - to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, - IPPrefixID: to.Ptr("subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, + Type: to.Ptr(armmanagednetworkfabric.RoutePolicyConditionTypeOr), + IPPrefixID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), }, SequenceNumber: to.Ptr[int64](7), }}, + AddressFamilyType: to.Ptr(armmanagednetworkfabric.AddressFamilyTypeIPv4), + NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), }, }, nil) if err != nil { @@ -93,73 +96,78 @@ func ExampleRoutePoliciesClient_BeginCreate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RoutePolicy = armmanagednetworkfabric.RoutePolicy{ - // Name: to.Ptr("routePolicyName"), + // Name: to.Ptr("example-routePolicy"), // Type: to.Ptr("microsoft.managednetworkfabric/routePolicies"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T12:42:03.945Z"); return t}()), - // CreatedBy: to.Ptr("User"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T12:42:03.946Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUS"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key8254": to.Ptr(""), + // "keyID": to.Ptr("keyValue"), // }, // Properties: &armmanagednetworkfabric.RoutePolicyProperties{ - // Annotation: to.Ptr("annotationValue"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // Annotation: to.Ptr("annotation"), // Statements: []*armmanagednetworkfabric.RoutePolicyStatementProperties{ // { - // Annotation: to.Ptr("annotationValue"), + // Annotation: to.Ptr("annotation"), // Action: &armmanagednetworkfabric.StatementActionProperties{ - // ActionType: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + // ActionType: to.Ptr(armmanagednetworkfabric.RoutePolicyActionTypePermit), // IPCommunityProperties: &armmanagednetworkfabric.ActionIPCommunityProperties{ // Add: &armmanagednetworkfabric.IPCommunityIDList{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // }, // Delete: &armmanagednetworkfabric.IPCommunityIDList{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // }, // Set: &armmanagednetworkfabric.IPCommunityIDList{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // }, // }, // IPExtendedCommunityProperties: &armmanagednetworkfabric.ActionIPExtendedCommunityProperties{ // Add: &armmanagednetworkfabric.IPExtendedCommunityIDList{ // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, // }, // Delete: &armmanagednetworkfabric.IPExtendedCommunityIDList{ // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, // }, // Set: &armmanagednetworkfabric.IPExtendedCommunityIDList{ // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, // }, // }, // LocalPreference: to.Ptr[int64](20), // }, // Condition: &armmanagednetworkfabric.StatementConditionProperties{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, - // IPPrefixID: to.Ptr("subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, + // Type: to.Ptr(armmanagednetworkfabric.RoutePolicyConditionTypeOr), + // IPPrefixID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), // }, // SequenceNumber: to.Ptr[int64](7), // }}, + // AddressFamilyType: to.Ptr(armmanagednetworkfabric.AddressFamilyTypeIPv4), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/RoutePolicies_Get_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Get_MaximumSet_Gen.json func ExampleRoutePoliciesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -170,7 +178,7 @@ func ExampleRoutePoliciesClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRoutePoliciesClient().Get(ctx, "rgRoutePolicies", "routePolicyName", nil) + res, err := clientFactory.NewRoutePoliciesClient().Get(ctx, "example-rg", "example-routePolicy", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -178,73 +186,78 @@ func ExampleRoutePoliciesClient_Get() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RoutePolicy = armmanagednetworkfabric.RoutePolicy{ - // Name: to.Ptr("routePolicyName"), + // Name: to.Ptr("example-routePolicy"), // Type: to.Ptr("microsoft.managednetworkfabric/routePolicies"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/rgRoutePolicies/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T12:42:03.945Z"); return t}()), - // CreatedBy: to.Ptr("User"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T12:42:03.946Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUS"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key8254": to.Ptr(""), + // "keyID": to.Ptr("keyValue"), // }, // Properties: &armmanagednetworkfabric.RoutePolicyProperties{ - // Annotation: to.Ptr("annotationValue"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // Annotation: to.Ptr("annotation"), // Statements: []*armmanagednetworkfabric.RoutePolicyStatementProperties{ // { - // Annotation: to.Ptr("annotationValue"), + // Annotation: to.Ptr("annotation"), // Action: &armmanagednetworkfabric.StatementActionProperties{ - // ActionType: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + // ActionType: to.Ptr(armmanagednetworkfabric.RoutePolicyActionTypePermit), // IPCommunityProperties: &armmanagednetworkfabric.ActionIPCommunityProperties{ // Add: &armmanagednetworkfabric.IPCommunityIDList{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // }, // Delete: &armmanagednetworkfabric.IPCommunityIDList{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // }, // Set: &armmanagednetworkfabric.IPCommunityIDList{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // }, // }, // IPExtendedCommunityProperties: &armmanagednetworkfabric.ActionIPExtendedCommunityProperties{ // Add: &armmanagednetworkfabric.IPExtendedCommunityIDList{ // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, // }, // Delete: &armmanagednetworkfabric.IPExtendedCommunityIDList{ // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, // }, // Set: &armmanagednetworkfabric.IPExtendedCommunityIDList{ // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, // }, // }, // LocalPreference: to.Ptr[int64](20), // }, // Condition: &armmanagednetworkfabric.StatementConditionProperties{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, - // IPPrefixID: to.Ptr("subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, + // Type: to.Ptr(armmanagednetworkfabric.RoutePolicyConditionTypeOr), + // IPPrefixID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), // }, // SequenceNumber: to.Ptr[int64](7), // }}, + // AddressFamilyType: to.Ptr(armmanagednetworkfabric.AddressFamilyTypeIPv4), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/RoutePolicies_Update_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Update_MaximumSet_Gen.json func ExampleRoutePoliciesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -255,9 +268,56 @@ func ExampleRoutePoliciesClient_BeginUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewRoutePoliciesClient().BeginUpdate(ctx, "resourceGroupName", "routePolicyName", armmanagednetworkfabric.RoutePolicyPatch{ + poller, err := clientFactory.NewRoutePoliciesClient().BeginUpdate(ctx, "example-rg", "example-routePolicy", armmanagednetworkfabric.RoutePolicyPatch{ Tags: map[string]*string{ - "key8254": to.Ptr(""), + "keyID": to.Ptr("keyValue"), + }, + Properties: &armmanagednetworkfabric.RoutePolicyPatchableProperties{ + Statements: []*armmanagednetworkfabric.RoutePolicyStatementProperties{ + { + Annotation: to.Ptr("annotation"), + Action: &armmanagednetworkfabric.StatementActionProperties{ + ActionType: to.Ptr(armmanagednetworkfabric.RoutePolicyActionTypePermit), + IPCommunityProperties: &armmanagednetworkfabric.ActionIPCommunityProperties{ + Add: &armmanagednetworkfabric.IPCommunityIDList{ + IPCommunityIDs: []*string{ + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, + }, + Delete: &armmanagednetworkfabric.IPCommunityIDList{ + IPCommunityIDs: []*string{ + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, + }, + Set: &armmanagednetworkfabric.IPCommunityIDList{ + IPCommunityIDs: []*string{ + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, + }, + }, + IPExtendedCommunityProperties: &armmanagednetworkfabric.ActionIPExtendedCommunityProperties{ + Add: &armmanagednetworkfabric.IPExtendedCommunityIDList{ + IPExtendedCommunityIDs: []*string{ + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, + }, + Delete: &armmanagednetworkfabric.IPExtendedCommunityIDList{ + IPExtendedCommunityIDs: []*string{ + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, + }, + Set: &armmanagednetworkfabric.IPExtendedCommunityIDList{ + IPExtendedCommunityIDs: []*string{ + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, + }, + }, + LocalPreference: to.Ptr[int64](20), + }, + Condition: &armmanagednetworkfabric.StatementConditionProperties{ + IPCommunityIDs: []*string{ + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, + IPExtendedCommunityIDs: []*string{ + to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, + Type: to.Ptr(armmanagednetworkfabric.RoutePolicyConditionTypeOr), + IPPrefixID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), + }, + SequenceNumber: to.Ptr[int64](7), + }}, }, }, nil) if err != nil { @@ -271,73 +331,78 @@ func ExampleRoutePoliciesClient_BeginUpdate() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RoutePolicy = armmanagednetworkfabric.RoutePolicy{ - // Name: to.Ptr("routePolicyName"), + // Name: to.Ptr("example-routePolicy"), // Type: to.Ptr("microsoft.managednetworkfabric/routePolicies"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T12:42:03.945Z"); return t}()), - // CreatedBy: to.Ptr("User"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T12:42:03.946Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUS"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key8254": to.Ptr(""), + // "keyID": to.Ptr("keyValue"), // }, // Properties: &armmanagednetworkfabric.RoutePolicyProperties{ - // Annotation: to.Ptr("annotationValue"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // Annotation: to.Ptr("annotation"), // Statements: []*armmanagednetworkfabric.RoutePolicyStatementProperties{ // { - // Annotation: to.Ptr("annotationValue"), + // Annotation: to.Ptr("annotation"), // Action: &armmanagednetworkfabric.StatementActionProperties{ - // ActionType: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + // ActionType: to.Ptr(armmanagednetworkfabric.RoutePolicyActionTypePermit), // IPCommunityProperties: &armmanagednetworkfabric.ActionIPCommunityProperties{ // Add: &armmanagednetworkfabric.IPCommunityIDList{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // }, // Delete: &armmanagednetworkfabric.IPCommunityIDList{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // }, // Set: &armmanagednetworkfabric.IPCommunityIDList{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // }, // }, // IPExtendedCommunityProperties: &armmanagednetworkfabric.ActionIPExtendedCommunityProperties{ // Add: &armmanagednetworkfabric.IPExtendedCommunityIDList{ // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, // }, // Delete: &armmanagednetworkfabric.IPExtendedCommunityIDList{ // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, // }, // Set: &armmanagednetworkfabric.IPExtendedCommunityIDList{ // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, // }, // }, // LocalPreference: to.Ptr[int64](20), // }, // Condition: &armmanagednetworkfabric.StatementConditionProperties{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, - // IPPrefixID: to.Ptr("subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, + // Type: to.Ptr(armmanagednetworkfabric.RoutePolicyConditionTypeOr), + // IPPrefixID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), // }, // SequenceNumber: to.Ptr[int64](7), // }}, + // AddressFamilyType: to.Ptr(armmanagednetworkfabric.AddressFamilyTypeIPv4), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/RoutePolicies_Delete_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Delete_MaximumSet_Gen.json func ExampleRoutePoliciesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -348,7 +413,7 @@ func ExampleRoutePoliciesClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewRoutePoliciesClient().BeginDelete(ctx, "rgRoutePolicies", "routePolicyName", nil) + poller, err := clientFactory.NewRoutePoliciesClient().BeginDelete(ctx, "example-rg", "example-routePolicy", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -358,7 +423,7 @@ func ExampleRoutePoliciesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/RoutePolicies_ListByResourceGroup_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_ListByResourceGroup_MaximumSet_Gen.json func ExampleRoutePoliciesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -369,7 +434,7 @@ func ExampleRoutePoliciesClient_NewListByResourceGroupPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewRoutePoliciesClient().NewListByResourceGroupPager("rgRoutePolicies", nil) + pager := clientFactory.NewRoutePoliciesClient().NewListByResourceGroupPager("example-rg", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -383,75 +448,80 @@ func ExampleRoutePoliciesClient_NewListByResourceGroupPager() { // page.RoutePoliciesListResult = armmanagednetworkfabric.RoutePoliciesListResult{ // Value: []*armmanagednetworkfabric.RoutePolicy{ // { - // Name: to.Ptr("routePolicyName"), + // Name: to.Ptr("example-routePolicy"), // Type: to.Ptr("microsoft.managednetworkfabric/routePolicies"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T12:42:03.945Z"); return t}()), - // CreatedBy: to.Ptr("User"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T12:42:03.946Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUS"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key8254": to.Ptr(""), + // "keyID": to.Ptr("keyValue"), // }, // Properties: &armmanagednetworkfabric.RoutePolicyProperties{ - // Annotation: to.Ptr("annotationValue"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // Annotation: to.Ptr("annotation"), // Statements: []*armmanagednetworkfabric.RoutePolicyStatementProperties{ // { - // Annotation: to.Ptr("annotationValue"), + // Annotation: to.Ptr("annotation"), // Action: &armmanagednetworkfabric.StatementActionProperties{ - // ActionType: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + // ActionType: to.Ptr(armmanagednetworkfabric.RoutePolicyActionTypePermit), // IPCommunityProperties: &armmanagednetworkfabric.ActionIPCommunityProperties{ // Add: &armmanagednetworkfabric.IPCommunityIDList{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // }, // Delete: &armmanagednetworkfabric.IPCommunityIDList{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // }, // Set: &armmanagednetworkfabric.IPCommunityIDList{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // }, // }, // IPExtendedCommunityProperties: &armmanagednetworkfabric.ActionIPExtendedCommunityProperties{ // Add: &armmanagednetworkfabric.IPExtendedCommunityIDList{ // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, // }, // Delete: &armmanagednetworkfabric.IPExtendedCommunityIDList{ // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, // }, // Set: &armmanagednetworkfabric.IPExtendedCommunityIDList{ // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, // }, // }, // LocalPreference: to.Ptr[int64](20), // }, // Condition: &armmanagednetworkfabric.StatementConditionProperties{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, - // IPPrefixID: to.Ptr("subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, + // Type: to.Ptr(armmanagednetworkfabric.RoutePolicyConditionTypeOr), + // IPPrefixID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), // }, // SequenceNumber: to.Ptr[int64](7), // }}, + // AddressFamilyType: to.Ptr(armmanagednetworkfabric.AddressFamilyTypeIPv4), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d03c1964cb76ffd6884d10a1871bbe779a2f68ef/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/RoutePolicies_ListBySubscription_MaximumSet_Gen.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_ListBySubscription_MaximumSet_Gen.json func ExampleRoutePoliciesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -476,70 +546,204 @@ func ExampleRoutePoliciesClient_NewListBySubscriptionPager() { // page.RoutePoliciesListResult = armmanagednetworkfabric.RoutePoliciesListResult{ // Value: []*armmanagednetworkfabric.RoutePolicy{ // { - // Name: to.Ptr("routePolicyName"), + // Name: to.Ptr("example-routePolicy"), // Type: to.Ptr("microsoft.managednetworkfabric/routePolicies"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), + // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T12:42:03.945Z"); return t}()), - // CreatedBy: to.Ptr("User"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-16T12:42:03.946Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), + // CreatedBy: to.Ptr("user@mail.com"), + // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), + // LastModifiedBy: to.Ptr("user@mail.com"), // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), // }, - // Location: to.Ptr("EastUS"), + // Location: to.Ptr("eastus"), // Tags: map[string]*string{ - // "key8254": to.Ptr(""), + // "keyID": to.Ptr("keyValue"), // }, // Properties: &armmanagednetworkfabric.RoutePolicyProperties{ - // Annotation: to.Ptr("annotationValue"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), + // Annotation: to.Ptr("annotation"), // Statements: []*armmanagednetworkfabric.RoutePolicyStatementProperties{ // { - // Annotation: to.Ptr("annotationValue"), + // Annotation: to.Ptr("annotation"), // Action: &armmanagednetworkfabric.StatementActionProperties{ - // ActionType: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), + // ActionType: to.Ptr(armmanagednetworkfabric.RoutePolicyActionTypePermit), // IPCommunityProperties: &armmanagednetworkfabric.ActionIPCommunityProperties{ // Add: &armmanagednetworkfabric.IPCommunityIDList{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // }, // Delete: &armmanagednetworkfabric.IPCommunityIDList{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // }, // Set: &armmanagednetworkfabric.IPCommunityIDList{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // }, // }, // IPExtendedCommunityProperties: &armmanagednetworkfabric.ActionIPExtendedCommunityProperties{ // Add: &armmanagednetworkfabric.IPExtendedCommunityIDList{ // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, // }, // Delete: &armmanagednetworkfabric.IPExtendedCommunityIDList{ // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, // }, // Set: &armmanagednetworkfabric.IPExtendedCommunityIDList{ // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, // }, // }, // LocalPreference: to.Ptr[int64](20), // }, // Condition: &armmanagednetworkfabric.StatementConditionProperties{ // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")}, + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName")}, - // IPPrefixID: to.Ptr("subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), + // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, + // Type: to.Ptr(armmanagednetworkfabric.RoutePolicyConditionTypeOr), + // IPPrefixID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), // }, // SequenceNumber: to.Ptr[int64](7), // }}, + // AddressFamilyType: to.Ptr(armmanagednetworkfabric.AddressFamilyTypeIPv4), + // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), + // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), // }, // }}, // } } } + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_UpdateAdministrativeState_MaximumSet_Gen.json +func ExampleRoutePoliciesClient_BeginUpdateAdministrativeState() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewRoutePoliciesClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-routePolicy", armmanagednetworkfabric.UpdateAdministrativeState{ + ResourceIDs: []*string{ + to.Ptr("")}, + State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForDeviceUpdate = armmanagednetworkfabric.CommonPostActionResponseForDeviceUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // FailedDevices: []*string{ + // to.Ptr("")}, + // SuccessfulDevices: []*string{ + // to.Ptr("")}, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_ValidateConfiguration_MaximumSet_Gen.json +func ExampleRoutePoliciesClient_BeginValidateConfiguration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewRoutePoliciesClient().BeginValidateConfiguration(ctx, "example-rg", "example-routePolicy", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ValidateConfigurationResponse = armmanagednetworkfabric.ValidateConfigurationResponse{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // URL: to.Ptr("https://ValidateResultsUrl"), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_CommitConfiguration_MaximumSet_Gen.json +func ExampleRoutePoliciesClient_BeginCommitConfiguration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewRoutePoliciesClient().BeginCommitConfiguration(ctx, "example-rg", "example-routePolicy", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ + // Error: &armmanagednetworkfabric.ErrorDetail{ + // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ + // { + // Info: map[string]any{ + // }, + // Type: to.Ptr(""), + // }}, + // Code: to.Ptr(""), + // Message: to.Ptr(""), + // Target: to.Ptr(""), + // Details: []*armmanagednetworkfabric.ErrorDetail{ + // }, + // }, + // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), + // } +}