diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/api/Azure.ResourceManager.Cdn.netstandard2.0.cs b/sdk/cdn/Azure.ResourceManager.Cdn/api/Azure.ResourceManager.Cdn.netstandard2.0.cs index 63cde2ec8ec7..4f253822bad5 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/api/Azure.ResourceManager.Cdn.netstandard2.0.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/api/Azure.ResourceManager.Cdn.netstandard2.0.cs @@ -63,7 +63,7 @@ public partial class CdnEndpointData : Azure.ResourceManager.Models.TrackedResou { public CdnEndpointData(Azure.Core.AzureLocation location) : base (default(Azure.Core.AzureLocation)) { } public System.Collections.Generic.IList ContentTypesToCompress { get { throw null; } } - public System.Collections.Generic.IReadOnlyList CustomDomains { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CustomDomains { get { throw null; } } public Azure.Core.ResourceIdentifier DefaultOriginGroupId { get { throw null; } set { } } public Azure.ResourceManager.Cdn.Models.EndpointDeliveryPolicy DeliveryPolicy { get { throw null; } set { } } public System.Collections.Generic.IList GeoFilters { get { throw null; } } @@ -126,6 +126,8 @@ protected CdnEndpointResource() { } } public static partial class CdnExtensions { + public static Azure.Response CanMigrateProfile(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.ResourceManager.Cdn.Models.CanMigrateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> CanMigrateProfileAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.ResourceManager.Cdn.Models.CanMigrateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response CheckCdnNameAvailability(this Azure.ResourceManager.Resources.TenantResource tenantResource, Azure.ResourceManager.Cdn.Models.CdnNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> CheckCdnNameAvailabilityAsync(this Azure.ResourceManager.Resources.TenantResource tenantResource, Azure.ResourceManager.Cdn.Models.CdnNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response CheckCdnNameAvailabilityWithSubscription(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.Cdn.Models.CdnNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -161,6 +163,8 @@ public static partial class CdnExtensions public static Azure.AsyncPageable GetProfilesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Pageable GetResourceUsages(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetResourceUsagesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ArmOperation MigrateProfile(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.WaitUntil waitUntil, Azure.ResourceManager.Cdn.Models.MigrationContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> MigrateProfileAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.WaitUntil waitUntil, Azure.ResourceManager.Cdn.Models.MigrationContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response ValidateProbe(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.Cdn.Models.ValidateProbeContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> ValidateProbeAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.Cdn.Models.ValidateProbeContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } @@ -271,6 +275,7 @@ public CdnWebApplicationFirewallPolicyData(Azure.Core.AzureLocation location, Az public System.Collections.Generic.IList CustomRules { get { throw null; } } public System.Collections.Generic.IReadOnlyList EndpointLinks { get { throw null; } } public Azure.ETag? ETag { get { throw null; } set { } } + public System.Collections.Generic.IDictionary ExtendedProperties { get { throw null; } } public System.Collections.Generic.IList ManagedRuleSets { get { throw null; } } public Azure.ResourceManager.Cdn.Models.WafPolicySettings PolicySettings { get { throw null; } set { } } public Azure.ResourceManager.Cdn.Models.WebApplicationFirewallPolicyProvisioningState? ProvisioningState { get { throw null; } } @@ -319,6 +324,7 @@ public FrontDoorCustomDomainData() { } public Azure.ResourceManager.Cdn.Models.FrontDoorDeploymentStatus? DeploymentStatus { get { throw null; } } public Azure.Core.ResourceIdentifier DnsZoneId { get { throw null; } set { } } public Azure.ResourceManager.Cdn.Models.DomainValidationState? DomainValidationState { get { throw null; } } + public System.Collections.Generic.IDictionary ExtendedProperties { get { throw null; } } public string HostName { get { throw null; } set { } } public Azure.Core.ResourceIdentifier PreValidatedCustomDomainResourceId { get { throw null; } set { } } public string ProfileName { get { throw null; } } @@ -707,7 +713,9 @@ protected ProfileCollection() { } public partial class ProfileData : Azure.ResourceManager.Models.TrackedResourceData { public ProfileData(Azure.Core.AzureLocation location, Azure.ResourceManager.Cdn.Models.CdnSku sku) : base (default(Azure.Core.AzureLocation)) { } + public System.Collections.Generic.IDictionary ExtendedProperties { get { throw null; } } public System.Guid? FrontDoorId { get { throw null; } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public string Kind { get { throw null; } } public int? OriginResponseTimeoutSeconds { get { throw null; } set { } } public Azure.ResourceManager.Cdn.Models.ProfileProvisioningState? ProvisioningState { get { throw null; } } @@ -722,6 +730,8 @@ protected ProfileResource() { } public virtual bool HasData { get { throw null; } } public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CheckEndpointNameAvailabilityFrontDoorProfile(Azure.ResourceManager.Cdn.Models.EndpointNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CheckEndpointNameAvailabilityFrontDoorProfileAsync(Azure.ResourceManager.Cdn.Models.EndpointNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CheckFrontDoorProfileHostNameAvailability(Azure.ResourceManager.Cdn.Models.HostNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CheckFrontDoorProfileHostNameAvailabilityAsync(Azure.ResourceManager.Cdn.Models.HostNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string profileName) { throw null; } @@ -770,12 +780,18 @@ protected ProfileResource() { } public virtual System.Threading.Tasks.Task> GetWafLogAnalyticsMetricsAsync(System.Collections.Generic.IEnumerable metrics, System.DateTimeOffset dateTimeBegin, System.DateTimeOffset dateTimeEnd, Azure.ResourceManager.Cdn.Models.WafGranularity granularity, System.Collections.Generic.IEnumerable actions = null, System.Collections.Generic.IEnumerable groupBy = null, System.Collections.Generic.IEnumerable ruleTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetWafLogAnalyticsRankings(System.Collections.Generic.IEnumerable metrics, System.DateTimeOffset dateTimeBegin, System.DateTimeOffset dateTimeEnd, int maxRanking, System.Collections.Generic.IEnumerable rankings, System.Collections.Generic.IEnumerable actions = null, System.Collections.Generic.IEnumerable ruleTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetWafLogAnalyticsRankingsAsync(System.Collections.Generic.IEnumerable metrics, System.DateTimeOffset dateTimeBegin, System.DateTimeOffset dateTimeEnd, int maxRanking, System.Collections.Generic.IEnumerable rankings, System.Collections.Generic.IEnumerable actions = null, System.Collections.Generic.IEnumerable ruleTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation MigrationCommit(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task MigrationCommitAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Cdn.Models.ProfilePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Cdn.Models.ProfilePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation UpgradeFrontDoorProfile(Azure.WaitUntil waitUntil, Azure.ResourceManager.Cdn.Models.ProfileUpgradeContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpgradeFrontDoorProfileAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Cdn.Models.ProfileUpgradeContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ValidateSecretFrontDoorProfile(Azure.ResourceManager.Cdn.Models.ValidateSecretContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ValidateSecretFrontDoorProfileAsync(Azure.ResourceManager.Cdn.Models.ValidateSecretContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.Cdn.Models @@ -861,6 +877,36 @@ public CacheKeyQueryStringActionProperties(Azure.ResourceManager.Cdn.Models.Cach public static bool operator !=(Azure.ResourceManager.Cdn.Models.CacheKeyQueryStringActionType left, Azure.ResourceManager.Cdn.Models.CacheKeyQueryStringActionType right) { throw null; } public override string ToString() { throw null; } } + public partial class CanMigrateContent + { + public CanMigrateContent(Azure.ResourceManager.Resources.Models.WritableSubResource classicResourceReference) { } + public Azure.Core.ResourceIdentifier ClassicResourceReferenceId { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CanMigrateDefaultSku : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CanMigrateDefaultSku(string value) { throw null; } + public static Azure.ResourceManager.Cdn.Models.CanMigrateDefaultSku PremiumAzureFrontDoor { get { throw null; } } + public static Azure.ResourceManager.Cdn.Models.CanMigrateDefaultSku StandardAzureFrontDoor { get { throw null; } } + public bool Equals(Azure.ResourceManager.Cdn.Models.CanMigrateDefaultSku other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Cdn.Models.CanMigrateDefaultSku left, Azure.ResourceManager.Cdn.Models.CanMigrateDefaultSku right) { throw null; } + public static implicit operator Azure.ResourceManager.Cdn.Models.CanMigrateDefaultSku (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Cdn.Models.CanMigrateDefaultSku left, Azure.ResourceManager.Cdn.Models.CanMigrateDefaultSku right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CanMigrateResult + { + internal CanMigrateResult() { } + public bool? CanMigrate { get { throw null; } } + public Azure.ResourceManager.Cdn.Models.CanMigrateDefaultSku? DefaultSku { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct CdnCacheLevel : System.IEquatable { @@ -1395,6 +1441,13 @@ public CustomRuleMatchCondition(Azure.ResourceManager.Cdn.Models.WafMatchVariabl public string Selector { get { throw null; } set { } } public System.Collections.Generic.IList Transforms { get { throw null; } } } + public partial class DeepCreatedCustomDomain + { + internal DeepCreatedCustomDomain() { } + public string HostName { get { throw null; } } + public string Name { get { throw null; } } + public string ValidationData { get { throw null; } } + } public partial class DeepCreatedOrigin { public DeepCreatedOrigin(string name) { } @@ -2538,66 +2591,94 @@ public ManagedRuleSetDefinition() { } public static bool operator !=(Azure.ResourceManager.Cdn.Models.MatchProcessingBehavior left, Azure.ResourceManager.Cdn.Models.MatchProcessingBehavior right) { throw null; } public override string ToString() { throw null; } } - public partial class MetricsResponse - { - internal MetricsResponse() { } - public System.DateTimeOffset? DateTimeBegin { get { throw null; } } - public System.DateTimeOffset? DateTimeEnd { get { throw null; } } - public Azure.ResourceManager.Cdn.Models.MetricsResponseGranularity? Granularity { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Series { get { throw null; } } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct MetricsResponseGranularity : System.IEquatable + public readonly partial struct MetricsGranularity : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public MetricsResponseGranularity(string value) { throw null; } - public static Azure.ResourceManager.Cdn.Models.MetricsResponseGranularity P1D { get { throw null; } } - public static Azure.ResourceManager.Cdn.Models.MetricsResponseGranularity PT1H { get { throw null; } } - public static Azure.ResourceManager.Cdn.Models.MetricsResponseGranularity PT5M { get { throw null; } } - public bool Equals(Azure.ResourceManager.Cdn.Models.MetricsResponseGranularity other) { throw null; } + public MetricsGranularity(string value) { throw null; } + public static Azure.ResourceManager.Cdn.Models.MetricsGranularity P1D { get { throw null; } } + public static Azure.ResourceManager.Cdn.Models.MetricsGranularity PT1H { get { throw null; } } + public static Azure.ResourceManager.Cdn.Models.MetricsGranularity PT5M { get { throw null; } } + public bool Equals(Azure.ResourceManager.Cdn.Models.MetricsGranularity other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.Cdn.Models.MetricsResponseGranularity left, Azure.ResourceManager.Cdn.Models.MetricsResponseGranularity right) { throw null; } - public static implicit operator Azure.ResourceManager.Cdn.Models.MetricsResponseGranularity (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.Cdn.Models.MetricsResponseGranularity left, Azure.ResourceManager.Cdn.Models.MetricsResponseGranularity right) { throw null; } + public static bool operator ==(Azure.ResourceManager.Cdn.Models.MetricsGranularity left, Azure.ResourceManager.Cdn.Models.MetricsGranularity right) { throw null; } + public static implicit operator Azure.ResourceManager.Cdn.Models.MetricsGranularity (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Cdn.Models.MetricsGranularity left, Azure.ResourceManager.Cdn.Models.MetricsGranularity right) { throw null; } public override string ToString() { throw null; } } + public partial class MetricsResponse + { + internal MetricsResponse() { } + public System.DateTimeOffset? DateTimeBegin { get { throw null; } } + public System.DateTimeOffset? DateTimeEnd { get { throw null; } } + public Azure.ResourceManager.Cdn.Models.MetricsGranularity? Granularity { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Series { get { throw null; } } + } public partial class MetricsResponseSeriesItem { internal MetricsResponseSeriesItem() { } public System.Collections.Generic.IReadOnlyList Data { get { throw null; } } public System.Collections.Generic.IReadOnlyList Groups { get { throw null; } } public string Metric { get { throw null; } } - public Azure.ResourceManager.Cdn.Models.MetricsResponseSeriesItemUnit? Unit { get { throw null; } } + public Azure.ResourceManager.Cdn.Models.MetricsSeriesUnit? Unit { get { throw null; } } + } + public partial class MetricsResponseSeriesPropertiesItemsItem + { + internal MetricsResponseSeriesPropertiesItemsItem() { } + public string Name { get { throw null; } } + public string Value { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct MetricsResponseSeriesItemUnit : System.IEquatable + public readonly partial struct MetricsSeriesUnit : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public MetricsResponseSeriesItemUnit(string value) { throw null; } - public static Azure.ResourceManager.Cdn.Models.MetricsResponseSeriesItemUnit BitsPerSecond { get { throw null; } } - public static Azure.ResourceManager.Cdn.Models.MetricsResponseSeriesItemUnit Bytes { get { throw null; } } - public static Azure.ResourceManager.Cdn.Models.MetricsResponseSeriesItemUnit Count { get { throw null; } } - public static Azure.ResourceManager.Cdn.Models.MetricsResponseSeriesItemUnit MilliSeconds { get { throw null; } } - public bool Equals(Azure.ResourceManager.Cdn.Models.MetricsResponseSeriesItemUnit other) { throw null; } + public MetricsSeriesUnit(string value) { throw null; } + public static Azure.ResourceManager.Cdn.Models.MetricsSeriesUnit BitsPerSecond { get { throw null; } } + public static Azure.ResourceManager.Cdn.Models.MetricsSeriesUnit Bytes { get { throw null; } } + public static Azure.ResourceManager.Cdn.Models.MetricsSeriesUnit Count { get { throw null; } } + public static Azure.ResourceManager.Cdn.Models.MetricsSeriesUnit MilliSeconds { get { throw null; } } + public bool Equals(Azure.ResourceManager.Cdn.Models.MetricsSeriesUnit other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.Cdn.Models.MetricsResponseSeriesItemUnit left, Azure.ResourceManager.Cdn.Models.MetricsResponseSeriesItemUnit right) { throw null; } - public static implicit operator Azure.ResourceManager.Cdn.Models.MetricsResponseSeriesItemUnit (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.Cdn.Models.MetricsResponseSeriesItemUnit left, Azure.ResourceManager.Cdn.Models.MetricsResponseSeriesItemUnit right) { throw null; } + public static bool operator ==(Azure.ResourceManager.Cdn.Models.MetricsSeriesUnit left, Azure.ResourceManager.Cdn.Models.MetricsSeriesUnit right) { throw null; } + public static implicit operator Azure.ResourceManager.Cdn.Models.MetricsSeriesUnit (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Cdn.Models.MetricsSeriesUnit left, Azure.ResourceManager.Cdn.Models.MetricsSeriesUnit right) { throw null; } public override string ToString() { throw null; } } - public partial class MetricsResponseSeriesPropertiesItemsItem + public partial class MigrateResult { - internal MetricsResponseSeriesPropertiesItemsItem() { } - public string Name { get { throw null; } } - public string Value { get { throw null; } } + internal MigrateResult() { } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public Azure.Core.ResourceIdentifier MigratedProfileResourceIdId { get { throw null; } } + } + public partial class MigrationContent + { + public MigrationContent(Azure.ResourceManager.Cdn.Models.CdnSku sku, Azure.ResourceManager.Resources.Models.WritableSubResource classicResourceReference, string profileName) { } + public Azure.Core.ResourceIdentifier ClassicResourceReferenceId { get { throw null; } } + public System.Collections.Generic.IList MigrationWebApplicationFirewallMappings { get { throw null; } } + public string ProfileName { get { throw null; } } + public Azure.ResourceManager.Cdn.Models.CdnSkuName? SkuName { get { throw null; } } + } + public partial class MigrationErrorType + { + internal MigrationErrorType() { } + public string Code { get { throw null; } } + public string ErrorMessage { get { throw null; } } + public string NextSteps { get { throw null; } } + public string ResourceName { get { throw null; } } + } + public partial class MigrationWebApplicationFirewallMapping + { + public MigrationWebApplicationFirewallMapping() { } + public Azure.Core.ResourceIdentifier MigratedFromId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier MigratedToId { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct OptimizationType : System.IEquatable @@ -2947,9 +3028,16 @@ public PostArgsMatchCondition(Azure.ResourceManager.Cdn.Models.PostArgsMatchCond public static bool operator !=(Azure.ResourceManager.Cdn.Models.PrivateEndpointStatus left, Azure.ResourceManager.Cdn.Models.PrivateEndpointStatus right) { throw null; } public override string ToString() { throw null; } } + public partial class ProfileChangeSkuWafMapping + { + public ProfileChangeSkuWafMapping(string securityPolicyName, Azure.ResourceManager.Resources.Models.WritableSubResource changeToWafPolicy) { } + public Azure.Core.ResourceIdentifier ChangeToWafPolicyId { get { throw null; } } + public string SecurityPolicyName { get { throw null; } } + } public partial class ProfilePatch { public ProfilePatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public int? OriginResponseTimeoutSeconds { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } } @@ -2980,10 +3068,15 @@ public ProfilePatch() { } private readonly object _dummy; private readonly int _dummyPrimitive; public ProfileResourceState(string value) { throw null; } + public static Azure.ResourceManager.Cdn.Models.ProfileResourceState AbortingMigration { get { throw null; } } public static Azure.ResourceManager.Cdn.Models.ProfileResourceState Active { get { throw null; } } + public static Azure.ResourceManager.Cdn.Models.ProfileResourceState CommittingMigration { get { throw null; } } public static Azure.ResourceManager.Cdn.Models.ProfileResourceState Creating { get { throw null; } } public static Azure.ResourceManager.Cdn.Models.ProfileResourceState Deleting { get { throw null; } } public static Azure.ResourceManager.Cdn.Models.ProfileResourceState Disabled { get { throw null; } } + public static Azure.ResourceManager.Cdn.Models.ProfileResourceState Migrated { get { throw null; } } + public static Azure.ResourceManager.Cdn.Models.ProfileResourceState Migrating { get { throw null; } } + public static Azure.ResourceManager.Cdn.Models.ProfileResourceState PendingMigrationCommit { get { throw null; } } public bool Equals(Azure.ResourceManager.Cdn.Models.ProfileResourceState other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } @@ -2994,6 +3087,11 @@ public ProfilePatch() { } public static bool operator !=(Azure.ResourceManager.Cdn.Models.ProfileResourceState left, Azure.ResourceManager.Cdn.Models.ProfileResourceState right) { throw null; } public override string ToString() { throw null; } } + public partial class ProfileUpgradeContent + { + public ProfileUpgradeContent(System.Collections.Generic.IEnumerable wafMappingList) { } + public System.Collections.Generic.IList WafMappingList { get { throw null; } } + } public partial class PurgeContent { public PurgeContent(System.Collections.Generic.IEnumerable contentPaths) { } @@ -3590,6 +3688,26 @@ public RouteConfigurationOverrideActionProperties(Azure.ResourceManager.Cdn.Mode public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SecretType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SecretType(string value) { throw null; } + public static Azure.ResourceManager.Cdn.Models.SecretType AzureFirstPartyManagedCertificate { get { throw null; } } + public static Azure.ResourceManager.Cdn.Models.SecretType CustomerCertificate { get { throw null; } } + public static Azure.ResourceManager.Cdn.Models.SecretType ManagedCertificate { get { throw null; } } + public static Azure.ResourceManager.Cdn.Models.SecretType UriSigningKey { get { throw null; } } + public bool Equals(Azure.ResourceManager.Cdn.Models.SecretType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Cdn.Models.SecretType left, Azure.ResourceManager.Cdn.Models.SecretType right) { throw null; } + public static implicit operator Azure.ResourceManager.Cdn.Models.SecretType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Cdn.Models.SecretType left, Azure.ResourceManager.Cdn.Models.SecretType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct SecureDeliveryProtocolType : System.IEquatable { private readonly object _dummy; @@ -4116,6 +4234,39 @@ internal ValidateProbeResult() { } public bool? IsValid { get { throw null; } } public string Message { get { throw null; } } } + public partial class ValidateSecretContent + { + public ValidateSecretContent(Azure.ResourceManager.Cdn.Models.SecretType secretType, Azure.ResourceManager.Resources.Models.WritableSubResource secretSource) { } + public Azure.Core.ResourceIdentifier SecretSourceId { get { throw null; } } + public Azure.ResourceManager.Cdn.Models.SecretType SecretType { get { throw null; } } + public string SecretVersion { get { throw null; } set { } } + } + public partial class ValidateSecretResult + { + internal ValidateSecretResult() { } + public string Message { get { throw null; } } + public Azure.ResourceManager.Cdn.Models.ValidationStatus? Status { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ValidationStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ValidationStatus(string value) { throw null; } + public static Azure.ResourceManager.Cdn.Models.ValidationStatus AccessDenied { get { throw null; } } + public static Azure.ResourceManager.Cdn.Models.ValidationStatus CertificateExpired { get { throw null; } } + public static Azure.ResourceManager.Cdn.Models.ValidationStatus Invalid { get { throw null; } } + public static Azure.ResourceManager.Cdn.Models.ValidationStatus Valid { get { throw null; } } + public bool Equals(Azure.ResourceManager.Cdn.Models.ValidationStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Cdn.Models.ValidationStatus left, Azure.ResourceManager.Cdn.Models.ValidationStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Cdn.Models.ValidationStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Cdn.Models.ValidationStatus left, Azure.ResourceManager.Cdn.Models.ValidationStatus right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct WafAction : System.IEquatable { @@ -4197,64 +4348,64 @@ internal ValidateProbeResult() { } public static bool operator !=(Azure.ResourceManager.Cdn.Models.WafMetric left, Azure.ResourceManager.Cdn.Models.WafMetric right) { throw null; } public override string ToString() { throw null; } } - public partial class WafMetricsResponse - { - internal WafMetricsResponse() { } - public System.DateTimeOffset? DateTimeBegin { get { throw null; } } - public System.DateTimeOffset? DateTimeEnd { get { throw null; } } - public Azure.ResourceManager.Cdn.Models.WafMetricsResponseGranularity? Granularity { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Series { get { throw null; } } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct WafMetricsResponseGranularity : System.IEquatable + public readonly partial struct WafMetricsGranularity : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public WafMetricsResponseGranularity(string value) { throw null; } - public static Azure.ResourceManager.Cdn.Models.WafMetricsResponseGranularity P1D { get { throw null; } } - public static Azure.ResourceManager.Cdn.Models.WafMetricsResponseGranularity PT1H { get { throw null; } } - public static Azure.ResourceManager.Cdn.Models.WafMetricsResponseGranularity PT5M { get { throw null; } } - public bool Equals(Azure.ResourceManager.Cdn.Models.WafMetricsResponseGranularity other) { throw null; } + public WafMetricsGranularity(string value) { throw null; } + public static Azure.ResourceManager.Cdn.Models.WafMetricsGranularity P1D { get { throw null; } } + public static Azure.ResourceManager.Cdn.Models.WafMetricsGranularity PT1H { get { throw null; } } + public static Azure.ResourceManager.Cdn.Models.WafMetricsGranularity PT5M { get { throw null; } } + public bool Equals(Azure.ResourceManager.Cdn.Models.WafMetricsGranularity other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.Cdn.Models.WafMetricsResponseGranularity left, Azure.ResourceManager.Cdn.Models.WafMetricsResponseGranularity right) { throw null; } - public static implicit operator Azure.ResourceManager.Cdn.Models.WafMetricsResponseGranularity (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.Cdn.Models.WafMetricsResponseGranularity left, Azure.ResourceManager.Cdn.Models.WafMetricsResponseGranularity right) { throw null; } + public static bool operator ==(Azure.ResourceManager.Cdn.Models.WafMetricsGranularity left, Azure.ResourceManager.Cdn.Models.WafMetricsGranularity right) { throw null; } + public static implicit operator Azure.ResourceManager.Cdn.Models.WafMetricsGranularity (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Cdn.Models.WafMetricsGranularity left, Azure.ResourceManager.Cdn.Models.WafMetricsGranularity right) { throw null; } public override string ToString() { throw null; } } + public partial class WafMetricsResponse + { + internal WafMetricsResponse() { } + public System.DateTimeOffset? DateTimeBegin { get { throw null; } } + public System.DateTimeOffset? DateTimeEnd { get { throw null; } } + public Azure.ResourceManager.Cdn.Models.WafMetricsGranularity? Granularity { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Series { get { throw null; } } + } public partial class WafMetricsResponseSeriesItem { internal WafMetricsResponseSeriesItem() { } public System.Collections.Generic.IReadOnlyList Data { get { throw null; } } public System.Collections.Generic.IReadOnlyList Groups { get { throw null; } } public string Metric { get { throw null; } } - public Azure.ResourceManager.Cdn.Models.WafMetricsResponseSeriesItemUnit? Unit { get { throw null; } } + public Azure.ResourceManager.Cdn.Models.WafMetricsSeriesUnit? Unit { get { throw null; } } + } + public partial class WafMetricsResponseSeriesPropertiesItemsItem + { + internal WafMetricsResponseSeriesPropertiesItemsItem() { } + public string Name { get { throw null; } } + public string Value { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct WafMetricsResponseSeriesItemUnit : System.IEquatable + public readonly partial struct WafMetricsSeriesUnit : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public WafMetricsResponseSeriesItemUnit(string value) { throw null; } - public static Azure.ResourceManager.Cdn.Models.WafMetricsResponseSeriesItemUnit Count { get { throw null; } } - public bool Equals(Azure.ResourceManager.Cdn.Models.WafMetricsResponseSeriesItemUnit other) { throw null; } + public WafMetricsSeriesUnit(string value) { throw null; } + public static Azure.ResourceManager.Cdn.Models.WafMetricsSeriesUnit Count { get { throw null; } } + public bool Equals(Azure.ResourceManager.Cdn.Models.WafMetricsSeriesUnit other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.Cdn.Models.WafMetricsResponseSeriesItemUnit left, Azure.ResourceManager.Cdn.Models.WafMetricsResponseSeriesItemUnit right) { throw null; } - public static implicit operator Azure.ResourceManager.Cdn.Models.WafMetricsResponseSeriesItemUnit (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.Cdn.Models.WafMetricsResponseSeriesItemUnit left, Azure.ResourceManager.Cdn.Models.WafMetricsResponseSeriesItemUnit right) { throw null; } + public static bool operator ==(Azure.ResourceManager.Cdn.Models.WafMetricsSeriesUnit left, Azure.ResourceManager.Cdn.Models.WafMetricsSeriesUnit right) { throw null; } + public static implicit operator Azure.ResourceManager.Cdn.Models.WafMetricsSeriesUnit (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Cdn.Models.WafMetricsSeriesUnit left, Azure.ResourceManager.Cdn.Models.WafMetricsSeriesUnit right) { throw null; } public override string ToString() { throw null; } } - public partial class WafMetricsResponseSeriesPropertiesItemsItem - { - internal WafMetricsResponseSeriesPropertiesItemsItem() { } - public string Name { get { throw null; } } - public string Value { get { throw null; } } - } public partial class WafPolicyManagedRuleSet { public WafPolicyManagedRuleSet(string ruleSetType, string ruleSetVersion) { } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/CdnEndpointData.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/CdnEndpointData.cs index 6b5979ceac0b..d577481671bc 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/CdnEndpointData.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/CdnEndpointData.cs @@ -24,7 +24,7 @@ public CdnEndpointData(AzureLocation location) : base(location) UriSigningKeys = new ChangeTrackingList(); Origins = new ChangeTrackingList(); OriginGroups = new ChangeTrackingList(); - CustomDomains = new ChangeTrackingList(); + CustomDomains = new ChangeTrackingList(); } /// Initializes a new instance of CdnEndpointData. @@ -54,7 +54,7 @@ public CdnEndpointData(AzureLocation location) : base(location) /// The custom domains under the endpoint. /// Resource status of the endpoint. /// Provisioning status of the endpoint. - internal CdnEndpointData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string originPath, IList contentTypesToCompress, string originHostHeader, bool? isCompressionEnabled, bool? isHttpAllowed, bool? isHttpsAllowed, QueryStringCachingBehavior? queryStringCachingBehavior, OptimizationType? optimizationType, string probePath, IList geoFilters, EndpointPropertiesUpdateParametersDefaultOriginGroup defaultOriginGroup, IList uriSigningKeys, EndpointDeliveryPolicy deliveryPolicy, EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink, string hostName, IList origins, IList originGroups, IReadOnlyList customDomains, EndpointResourceState? resourceState, CdnEndpointProvisioningState? provisioningState) : base(id, name, resourceType, systemData, tags, location) + internal CdnEndpointData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string originPath, IList contentTypesToCompress, string originHostHeader, bool? isCompressionEnabled, bool? isHttpAllowed, bool? isHttpsAllowed, QueryStringCachingBehavior? queryStringCachingBehavior, OptimizationType? optimizationType, string probePath, IList geoFilters, EndpointPropertiesUpdateParametersDefaultOriginGroup defaultOriginGroup, IList uriSigningKeys, EndpointDeliveryPolicy deliveryPolicy, EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink, string hostName, IList origins, IList originGroups, IReadOnlyList customDomains, EndpointResourceState? resourceState, CdnEndpointProvisioningState? provisioningState) : base(id, name, resourceType, systemData, tags, location) { OriginPath = originPath; ContentTypesToCompress = contentTypesToCompress; @@ -137,7 +137,7 @@ public ResourceIdentifier WebApplicationFirewallPolicyLinkId /// The origin groups comprising of origins that are used for load balancing the traffic based on availability. public IList OriginGroups { get; } /// The custom domains under the endpoint. - public IReadOnlyList CustomDomains { get; } + public IReadOnlyList CustomDomains { get; } /// Resource status of the endpoint. public EndpointResourceState? ResourceState { get; } /// Provisioning status of the endpoint. diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/CdnWebApplicationFirewallPolicyData.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/CdnWebApplicationFirewallPolicyData.cs index 39b2dd0670f2..72da2d44152e 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/CdnWebApplicationFirewallPolicyData.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/CdnWebApplicationFirewallPolicyData.cs @@ -28,6 +28,7 @@ public CdnWebApplicationFirewallPolicyData(AzureLocation location, CdnSku sku) : Sku = sku; EndpointLinks = new ChangeTrackingList(); + ExtendedProperties = new ChangeTrackingDictionary(); } /// Initializes a new instance of CdnWebApplicationFirewallPolicyData. @@ -44,9 +45,10 @@ public CdnWebApplicationFirewallPolicyData(AzureLocation location, CdnSku sku) : /// Describes custom rules inside the policy. /// Describes managed rules inside the policy. /// Describes Azure CDN endpoints associated with this Web Application Firewall policy. + /// Key-Value pair representing additional properties for Web Application Firewall policy. /// Provisioning state of the WebApplicationFirewallPolicy. /// Resource status of the policy. - internal CdnWebApplicationFirewallPolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, CdnSku sku, WafPolicySettings policySettings, RateLimitRuleList rateLimitSettings, CustomRuleList customSettings, ManagedRuleSetList managedRules, IReadOnlyList endpointLinks, WebApplicationFirewallPolicyProvisioningState? provisioningState, PolicyResourceState? resourceState) : base(id, name, resourceType, systemData, tags, location) + internal CdnWebApplicationFirewallPolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, CdnSku sku, WafPolicySettings policySettings, RateLimitRuleList rateLimitSettings, CustomRuleList customSettings, ManagedRuleSetList managedRules, IReadOnlyList endpointLinks, IDictionary extendedProperties, WebApplicationFirewallPolicyProvisioningState? provisioningState, PolicyResourceState? resourceState) : base(id, name, resourceType, systemData, tags, location) { ETag = etag; Sku = sku; @@ -55,6 +57,7 @@ internal CdnWebApplicationFirewallPolicyData(ResourceIdentifier id, string name, CustomSettings = customSettings; ManagedRules = managedRules; EndpointLinks = endpointLinks; + ExtendedProperties = extendedProperties; ProvisioningState = provisioningState; ResourceState = resourceState; } @@ -118,6 +121,8 @@ public IList ManagedRuleSets /// Describes Azure CDN endpoints associated with this Web Application Firewall policy. public IReadOnlyList EndpointLinks { get; } + /// Key-Value pair representing additional properties for Web Application Firewall policy. + public IDictionary ExtendedProperties { get; } /// Provisioning state of the WebApplicationFirewallPolicy. public WebApplicationFirewallPolicyProvisioningState? ProvisioningState { get; } /// Resource status of the policy. diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnExtensions.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnExtensions.cs index f9a7f5890119..fa22a1ac7054 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnExtensions.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnExtensions.cs @@ -358,6 +358,72 @@ public static Response CheckEndpointNameAvailabi return GetExtensionClient(resourceGroupResource).CheckEndpointNameAvailability(content, cancellationToken); } + /// + /// Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/canMigrate + /// Operation Id: Profiles_CanMigrate + /// + /// The instance the method will execute against. + /// Properties needed to check if cdn profile or classic frontdoor can be migrated. + /// The cancellation token to use. + /// is null. + public static async Task> CanMigrateProfileAsync(this ResourceGroupResource resourceGroupResource, CanMigrateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + return await GetExtensionClient(resourceGroupResource).CanMigrateProfileAsync(content, cancellationToken).ConfigureAwait(false); + } + + /// + /// Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/canMigrate + /// Operation Id: Profiles_CanMigrate + /// + /// The instance the method will execute against. + /// Properties needed to check if cdn profile or classic frontdoor can be migrated. + /// The cancellation token to use. + /// is null. + public static Response CanMigrateProfile(this ResourceGroupResource resourceGroupResource, CanMigrateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + return GetExtensionClient(resourceGroupResource).CanMigrateProfile(content, cancellationToken); + } + + /// + /// Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/migrate + /// Operation Id: Profiles_Migrate + /// + /// The instance the method will execute against. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Properties needed to migrate the profile. + /// The cancellation token to use. + /// is null. + public static async Task> MigrateProfileAsync(this ResourceGroupResource resourceGroupResource, WaitUntil waitUntil, MigrationContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + return await GetExtensionClient(resourceGroupResource).MigrateProfileAsync(waitUntil, content, cancellationToken).ConfigureAwait(false); + } + + /// + /// Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/migrate + /// Operation Id: Profiles_Migrate + /// + /// The instance the method will execute against. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Properties needed to migrate the profile. + /// The cancellation token to use. + /// is null. + public static ArmOperation MigrateProfile(this ResourceGroupResource resourceGroupResource, WaitUntil waitUntil, MigrationContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + return GetExtensionClient(resourceGroupResource).MigrateProfile(waitUntil, content, cancellationToken); + } + #region FrontDoorCustomDomainResource /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs index b4f0b8c7fc59..d2df35eefc3f 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs @@ -21,6 +21,8 @@ internal partial class ResourceGroupResourceExtensionClient : ArmResource { private ClientDiagnostics _defaultClientDiagnostics; private CdnManagementRestOperations _defaultRestClient; + private ClientDiagnostics _profileClientDiagnostics; + private ProfilesRestOperations _profileRestClient; /// Initializes a new instance of the class for mocking. protected ResourceGroupResourceExtensionClient() @@ -36,6 +38,8 @@ internal ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifi private ClientDiagnostics DefaultClientDiagnostics => _defaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Cdn", ProviderConstants.DefaultProviderNamespace, Diagnostics); private CdnManagementRestOperations DefaultRestClient => _defaultRestClient ??= new CdnManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics ProfileClientDiagnostics => _profileClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Cdn", ProfileResource.ResourceType.Namespace, Diagnostics); + private ProfilesRestOperations ProfileRestClient => _profileRestClient ??= new ProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ProfileResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -102,5 +106,105 @@ public virtual Response CheckEndpointNameAvailab throw; } } + + /// + /// Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/canMigrate + /// Operation Id: Profiles_CanMigrate + /// + /// Properties needed to check if cdn profile or classic frontdoor can be migrated. + /// The cancellation token to use. + public virtual async Task> CanMigrateProfileAsync(CanMigrateContent content, CancellationToken cancellationToken = default) + { + using var scope = ProfileClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CanMigrateProfile"); + scope.Start(); + try + { + var response = await ProfileRestClient.CanMigrateAsync(Id.SubscriptionId, Id.ResourceGroupName, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/canMigrate + /// Operation Id: Profiles_CanMigrate + /// + /// Properties needed to check if cdn profile or classic frontdoor can be migrated. + /// The cancellation token to use. + public virtual Response CanMigrateProfile(CanMigrateContent content, CancellationToken cancellationToken = default) + { + using var scope = ProfileClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CanMigrateProfile"); + scope.Start(); + try + { + var response = ProfileRestClient.CanMigrate(Id.SubscriptionId, Id.ResourceGroupName, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/migrate + /// Operation Id: Profiles_Migrate + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Properties needed to migrate the profile. + /// The cancellation token to use. + public virtual async Task> MigrateProfileAsync(WaitUntil waitUntil, MigrationContent content, CancellationToken cancellationToken = default) + { + using var scope = ProfileClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.MigrateProfile"); + scope.Start(); + try + { + var response = await ProfileRestClient.MigrateAsync(Id.SubscriptionId, Id.ResourceGroupName, content, cancellationToken).ConfigureAwait(false); + var operation = new CdnArmOperation(new MigrateResultOperationSource(), ProfileClientDiagnostics, Pipeline, ProfileRestClient.CreateMigrateRequest(Id.SubscriptionId, Id.ResourceGroupName, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/migrate + /// Operation Id: Profiles_Migrate + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Properties needed to migrate the profile. + /// The cancellation token to use. + public virtual ArmOperation MigrateProfile(WaitUntil waitUntil, MigrationContent content, CancellationToken cancellationToken = default) + { + using var scope = ProfileClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.MigrateProfile"); + scope.Start(); + try + { + var response = ProfileRestClient.Migrate(Id.SubscriptionId, Id.ResourceGroupName, content, cancellationToken); + var operation = new CdnArmOperation(new MigrateResultOperationSource(), ProfileClientDiagnostics, Pipeline, ProfileRestClient.CreateMigrateRequest(Id.SubscriptionId, Id.ResourceGroupName, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorCustomDomainData.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorCustomDomainData.cs index e13992738b12..c984a325acd9 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorCustomDomainData.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorCustomDomainData.cs @@ -5,6 +5,7 @@ #nullable disable +using System.Collections.Generic; using Azure.Core; using Azure.ResourceManager.Cdn.Models; using Azure.ResourceManager.Models; @@ -18,6 +19,7 @@ public partial class FrontDoorCustomDomainData : ResourceData /// Initializes a new instance of FrontDoorCustomDomainData. public FrontDoorCustomDomainData() { + ExtendedProperties = new ChangeTrackingDictionary(); } /// Initializes a new instance of FrontDoorCustomDomainData. @@ -33,8 +35,9 @@ public FrontDoorCustomDomainData() /// /// Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. DCV stands for DomainControlValidation. /// The host name of the domain. Must be a domain name. + /// Key-Value pair representing migration properties for domains. /// Values the customer needs to validate domain ownership. - internal FrontDoorCustomDomainData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string profileName, FrontDoorCustomDomainHttpsContent tlsSettings, WritableSubResource dnsZone, FrontDoorCustomDomainUpdatePropertiesParametersPreValidatedCustomDomainResourceId preValidatedCustomDomainResource, FrontDoorProvisioningState? provisioningState, FrontDoorDeploymentStatus? deploymentStatus, DomainValidationState? domainValidationState, string hostName, DomainValidationProperties validationProperties) : base(id, name, resourceType, systemData) + internal FrontDoorCustomDomainData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string profileName, FrontDoorCustomDomainHttpsContent tlsSettings, WritableSubResource dnsZone, FrontDoorCustomDomainUpdatePropertiesParametersPreValidatedCustomDomainResourceId preValidatedCustomDomainResource, FrontDoorProvisioningState? provisioningState, FrontDoorDeploymentStatus? deploymentStatus, DomainValidationState? domainValidationState, string hostName, IDictionary extendedProperties, DomainValidationProperties validationProperties) : base(id, name, resourceType, systemData) { ProfileName = profileName; TlsSettings = tlsSettings; @@ -44,6 +47,7 @@ internal FrontDoorCustomDomainData(ResourceIdentifier id, string name, ResourceT DeploymentStatus = deploymentStatus; DomainValidationState = domainValidationState; HostName = hostName; + ExtendedProperties = extendedProperties; ValidationProperties = validationProperties; } @@ -87,6 +91,8 @@ public ResourceIdentifier PreValidatedCustomDomainResourceId public DomainValidationState? DomainValidationState { get; } /// The host name of the domain. Must be a domain name. public string HostName { get; set; } + /// Key-Value pair representing migration properties for domains. + public IDictionary ExtendedProperties { get; } /// Values the customer needs to validate domain ownership. public DomainValidationProperties ValidationProperties { get; } } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorEndpointResource.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorEndpointResource.cs index 1dc17124bd31..dfc755dfbf2a 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorEndpointResource.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorEndpointResource.cs @@ -346,7 +346,7 @@ public virtual ArmOperation PurgeContent(WaitUntil waitUntil, FrontDoorPurgeCont } /// - /// Checks the quota and actual usage of the given AzureFrontDoor endpoint under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/usages /// Operation Id: FrontDoorEndpoints_ListResourceUsage /// @@ -388,7 +388,7 @@ async Task> NextPageFunc(string nextLink, int? pageSizeHint } /// - /// Checks the quota and actual usage of the given AzureFrontDoor endpoint under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/usages /// Operation Id: FrontDoorEndpoints_ListResourceUsage /// @@ -430,7 +430,7 @@ Page NextPageFunc(string nextLink, int? pageSizeHint) } /// - /// Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS.This api isn't work for apex domain. + /// Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/validateCustomDomain /// Operation Id: FrontDoorEndpoints_ValidateCustomDomain /// @@ -456,7 +456,7 @@ public virtual async Task> ValidateCustomDo } /// - /// Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS.This api isn't work for apex domain. + /// Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/validateCustomDomain /// Operation Id: FrontDoorEndpoints_ValidateCustomDomain /// diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorOriginData.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorOriginData.cs index 9042e33e7d83..17bcf3dde383 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorOriginData.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorOriginData.cs @@ -30,7 +30,7 @@ public FrontDoorOriginData() /// The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported.This should be unique across all origins in an endpoint. /// The value of the HTTP port. Must be between 1 and 65535. /// The value of the HTTPS port. Must be between 1 and 65535. - /// The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. This overrides the host header defined at Endpoint. + /// The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. This overrides the host header defined at Endpoint. /// Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. /// Weight of the origin in given origin group for load balancing. Must be between 1 and 1000. /// The properties of the private link resource for private origin. @@ -77,7 +77,7 @@ public ResourceIdentifier OriginId public int? HttpPort { get; set; } /// The value of the HTTPS port. Must be between 1 and 65535. public int? HttpsPort { get; set; } - /// The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. This overrides the host header defined at Endpoint. + /// The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. This overrides the host header defined at Endpoint. public string OriginHostHeader { get; set; } /// Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. public int? Priority { get; set; } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorOriginGroupResource.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorOriginGroupResource.cs index 73ff895859c1..63af6ca28238 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorOriginGroupResource.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorOriginGroupResource.cs @@ -285,7 +285,7 @@ public virtual ArmOperation Update(WaitUntil waitU } /// - /// Checks the quota and actual usage of the given AzureFrontDoor origin group under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/usages /// Operation Id: FrontDoorOriginGroups_ListResourceUsage /// @@ -327,7 +327,7 @@ async Task> NextPageFunc(string nextLink, int? pageSizeHint } /// - /// Checks the quota and actual usage of the given AzureFrontDoor origin group under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/usages /// Operation Id: FrontDoorOriginGroups_ListResourceUsage /// diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorRuleSetResource.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorRuleSetResource.cs index d788b28e4d3b..bc8928abd7ee 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorRuleSetResource.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorRuleSetResource.cs @@ -277,7 +277,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil } /// - /// Checks the quota and actual usage of the given AzureFrontDoor rule set under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/usages /// Operation Id: FrontDoorRuleSets_ListResourceUsage /// @@ -319,7 +319,7 @@ async Task> NextPageFunc(string nextLink, int? pageSizeHint } /// - /// Checks the quota and actual usage of the given AzureFrontDoor rule set under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/usages /// Operation Id: FrontDoorRuleSets_ListResourceUsage /// diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/LongRunningOperation/MigrateResultOperationSource.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/LongRunningOperation/MigrateResultOperationSource.cs new file mode 100644 index 000000000000..a9d8c4126675 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/LongRunningOperation/MigrateResultOperationSource.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Cdn.Models; + +namespace Azure.ResourceManager.Cdn +{ + internal class MigrateResultOperationSource : IOperationSource + { + MigrateResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return MigrateResult.DeserializeMigrateResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return MigrateResult.DeserializeMigrateResult(document.RootElement); + } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CanMigrateContent.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CanMigrateContent.Serialization.cs new file mode 100644 index 000000000000..e96b8f341be9 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CanMigrateContent.Serialization.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Cdn.Models +{ + public partial class CanMigrateContent : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("classicResourceReference"); + JsonSerializer.Serialize(writer, ClassicResourceReference); writer.WriteEndObject(); + } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CanMigrateContent.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CanMigrateContent.cs new file mode 100644 index 000000000000..2796df2e8d45 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CanMigrateContent.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Cdn.Models +{ + /// Request body for CanMigrate operation. + public partial class CanMigrateContent + { + /// Initializes a new instance of CanMigrateContent. + /// Resource reference of the classic cdn profile or classic frontdoor that need to be migrated. + /// is null. + public CanMigrateContent(WritableSubResource classicResourceReference) + { + Argument.AssertNotNull(classicResourceReference, nameof(classicResourceReference)); + + ClassicResourceReference = classicResourceReference; + } + + /// Resource reference of the classic cdn profile or classic frontdoor that need to be migrated. + internal WritableSubResource ClassicResourceReference { get; } + /// Gets or sets Id. + public ResourceIdentifier ClassicResourceReferenceId + { + get => ClassicResourceReference?.Id; + } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CanMigrateDefaultSku.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CanMigrateDefaultSku.cs new file mode 100644 index 000000000000..84c5756df397 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CanMigrateDefaultSku.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Cdn.Models +{ + /// Recommended sku for the migration. + public readonly partial struct CanMigrateDefaultSku : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CanMigrateDefaultSku(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StandardAzureFrontDoorValue = "Standard_AzureFrontDoor"; + private const string PremiumAzureFrontDoorValue = "Premium_AzureFrontDoor"; + + /// Standard_AzureFrontDoor. + public static CanMigrateDefaultSku StandardAzureFrontDoor { get; } = new CanMigrateDefaultSku(StandardAzureFrontDoorValue); + /// Premium_AzureFrontDoor. + public static CanMigrateDefaultSku PremiumAzureFrontDoor { get; } = new CanMigrateDefaultSku(PremiumAzureFrontDoorValue); + /// Determines if two values are the same. + public static bool operator ==(CanMigrateDefaultSku left, CanMigrateDefaultSku right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CanMigrateDefaultSku left, CanMigrateDefaultSku right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CanMigrateDefaultSku(string value) => new CanMigrateDefaultSku(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CanMigrateDefaultSku other && Equals(other); + /// + public bool Equals(CanMigrateDefaultSku other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CanMigrateResult.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CanMigrateResult.Serialization.cs new file mode 100644 index 000000000000..b643184e0871 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CanMigrateResult.Serialization.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Cdn.Models +{ + public partial class CanMigrateResult + { + internal static CanMigrateResult DeserializeCanMigrateResult(JsonElement element) + { + Optional canMigrate = default; + Optional defaultSku = default; + Optional> errors = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("canMigrate")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + canMigrate = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("defaultSku")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + defaultSku = new CanMigrateDefaultSku(property.Value.GetString()); + continue; + } + if (property.NameEquals("errors")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationErrorType.DeserializeMigrationErrorType(item)); + } + errors = array; + continue; + } + } + return new CanMigrateResult(Optional.ToNullable(canMigrate), Optional.ToNullable(defaultSku), Optional.ToList(errors)); + } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CanMigrateResult.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CanMigrateResult.cs new file mode 100644 index 000000000000..a34a0e568ce3 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CanMigrateResult.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Cdn.Models +{ + /// Result for canMigrate operation. + public partial class CanMigrateResult + { + /// Initializes a new instance of CanMigrateResult. + internal CanMigrateResult() + { + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of CanMigrateResult. + /// Flag that says if the profile can be migrated. + /// Recommended sku for the migration. + /// + internal CanMigrateResult(bool? canMigrate, CanMigrateDefaultSku? defaultSku, IReadOnlyList errors) + { + CanMigrate = canMigrate; + DefaultSku = defaultSku; + Errors = errors; + } + + /// Flag that says if the profile can be migrated. + public bool? CanMigrate { get; } + /// Recommended sku for the migration. + public CanMigrateDefaultSku? DefaultSku { get; } + /// Gets the errors. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CdnEndpointData.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CdnEndpointData.Serialization.cs index 3d2c4e183389..52250f6c4b7d 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CdnEndpointData.Serialization.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CdnEndpointData.Serialization.cs @@ -202,7 +202,7 @@ internal static CdnEndpointData DeserializeCdnEndpointData(JsonElement element) Optional hostName = default; Optional> origins = default; Optional> originGroups = default; - Optional> customDomains = default; + Optional> customDomains = default; Optional resourceState = default; Optional provisioningState = default; foreach (var property in element.EnumerateObject()) @@ -443,10 +443,10 @@ internal static CdnEndpointData DeserializeCdnEndpointData(JsonElement element) property0.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); + List array = new List(); foreach (var item in property0.Value.EnumerateArray()) { - array.Add(CdnCustomDomainData.DeserializeCdnCustomDomainData(item)); + array.Add(DeepCreatedCustomDomain.DeserializeDeepCreatedCustomDomain(item)); } customDomains = array; continue; diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CdnWebApplicationFirewallPolicyData.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CdnWebApplicationFirewallPolicyData.Serialization.cs index 9d472c1a4ab1..f9fc68debbc4 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CdnWebApplicationFirewallPolicyData.Serialization.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/CdnWebApplicationFirewallPolicyData.Serialization.cs @@ -62,6 +62,17 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("managedRules"); writer.WriteObjectValue(ManagedRules); } + if (Optional.IsCollectionDefined(ExtendedProperties)) + { + writer.WritePropertyName("extendedProperties"); + writer.WriteStartObject(); + foreach (var item in ExtendedProperties) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -81,6 +92,7 @@ internal static CdnWebApplicationFirewallPolicyData DeserializeCdnWebApplication Optional customRules = default; Optional managedRules = default; Optional> endpointLinks = default; + Optional> extendedProperties = default; Optional provisioningState = default; Optional resourceState = default; foreach (var property in element.EnumerateObject()) @@ -209,6 +221,21 @@ internal static CdnWebApplicationFirewallPolicyData DeserializeCdnWebApplication endpointLinks = array; continue; } + if (property0.NameEquals("extendedProperties")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetString()); + } + extendedProperties = dictionary; + continue; + } if (property0.NameEquals("provisioningState")) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -233,7 +260,7 @@ internal static CdnWebApplicationFirewallPolicyData DeserializeCdnWebApplication continue; } } - return new CdnWebApplicationFirewallPolicyData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, Optional.ToNullable(etag), sku, policySettings.Value, rateLimitRules.Value, customRules.Value, managedRules.Value, Optional.ToList(endpointLinks), Optional.ToNullable(provisioningState), Optional.ToNullable(resourceState)); + return new CdnWebApplicationFirewallPolicyData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, Optional.ToNullable(etag), sku, policySettings.Value, rateLimitRules.Value, customRules.Value, managedRules.Value, Optional.ToList(endpointLinks), Optional.ToDictionary(extendedProperties), Optional.ToNullable(provisioningState), Optional.ToNullable(resourceState)); } } } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/DeepCreatedCustomDomain.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/DeepCreatedCustomDomain.Serialization.cs new file mode 100644 index 000000000000..8171cbbab759 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/DeepCreatedCustomDomain.Serialization.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Cdn.Models +{ + public partial class DeepCreatedCustomDomain + { + internal static DeepCreatedCustomDomain DeserializeDeepCreatedCustomDomain(JsonElement element) + { + string name = default; + Optional hostName = default; + Optional validationData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("hostName")) + { + hostName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("validationData")) + { + validationData = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new DeepCreatedCustomDomain(name, hostName.Value, validationData.Value); + } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/DeepCreatedCustomDomain.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/DeepCreatedCustomDomain.cs new file mode 100644 index 000000000000..79da00630d2b --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/DeepCreatedCustomDomain.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Cdn.Models +{ + /// Custom domains created on the CDN endpoint. + public partial class DeepCreatedCustomDomain + { + /// Initializes a new instance of DeepCreatedCustomDomain. + /// Custom domain name. + /// is null. + internal DeepCreatedCustomDomain(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of DeepCreatedCustomDomain. + /// Custom domain name. + /// The host name of the custom domain. Must be a domain name. + /// Special validation or data may be required when delivering CDN to some regions due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in China. + internal DeepCreatedCustomDomain(string name, string hostName, string validationData) + { + Name = name; + HostName = hostName; + ValidationData = validationData; + } + + /// Custom domain name. + public string Name { get; } + /// The host name of the custom domain. Must be a domain name. + public string HostName { get; } + /// Special validation or data may be required when delivering CDN to some regions due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in China. + public string ValidationData { get; } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/FrontDoorCustomDomainData.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/FrontDoorCustomDomainData.Serialization.cs index 9fa6cf9417c9..f1fd3e3f9478 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/FrontDoorCustomDomainData.Serialization.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/FrontDoorCustomDomainData.Serialization.cs @@ -5,6 +5,7 @@ #nullable disable +using System.Collections.Generic; using System.Text.Json; using Azure.Core; using Azure.ResourceManager.Cdn.Models; @@ -47,6 +48,17 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("hostName"); writer.WriteStringValue(HostName); } + if (Optional.IsCollectionDefined(ExtendedProperties)) + { + writer.WritePropertyName("extendedProperties"); + writer.WriteStartObject(); + foreach (var item in ExtendedProperties) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -65,6 +77,7 @@ internal static FrontDoorCustomDomainData DeserializeFrontDoorCustomDomainData(J Optional deploymentStatus = default; Optional domainValidationState = default; Optional hostName = default; + Optional> extendedProperties = default; Optional validationProperties = default; foreach (var property in element.EnumerateObject()) { @@ -172,6 +185,21 @@ internal static FrontDoorCustomDomainData DeserializeFrontDoorCustomDomainData(J hostName = property0.Value.GetString(); continue; } + if (property0.NameEquals("extendedProperties")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetString()); + } + extendedProperties = dictionary; + continue; + } if (property0.NameEquals("validationProperties")) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -186,7 +214,7 @@ internal static FrontDoorCustomDomainData DeserializeFrontDoorCustomDomainData(J continue; } } - return new FrontDoorCustomDomainData(id, name, type, systemData.Value, profileName.Value, tlsSettings.Value, azureDnsZone, preValidatedCustomDomainResourceId.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(deploymentStatus), Optional.ToNullable(domainValidationState), hostName.Value, validationProperties.Value); + return new FrontDoorCustomDomainData(id, name, type, systemData.Value, profileName.Value, tlsSettings.Value, azureDnsZone, preValidatedCustomDomainResourceId.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(deploymentStatus), Optional.ToNullable(domainValidationState), hostName.Value, Optional.ToDictionary(extendedProperties), validationProperties.Value); } } } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/FrontDoorOriginGroupListResult.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/FrontDoorOriginGroupListResult.cs index 643be8153d57..5a3581aec5c8 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/FrontDoorOriginGroupListResult.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/FrontDoorOriginGroupListResult.cs @@ -21,7 +21,7 @@ internal FrontDoorOriginGroupListResult() } /// Initializes a new instance of FrontDoorOriginGroupListResult. - /// List of CDN origin groups within an endpoint. + /// List of Azure Front Door origin groups within an Azure Front Door endpoint. /// URL to get the next set of origin objects if there are any. internal FrontDoorOriginGroupListResult(IReadOnlyList value, string nextLink) { @@ -29,7 +29,7 @@ internal FrontDoorOriginGroupListResult(IReadOnlyList NextLink = nextLink; } - /// List of CDN origin groups within an endpoint. + /// List of Azure Front Door origin groups within an Azure Front Door endpoint. public IReadOnlyList Value { get; } /// URL to get the next set of origin objects if there are any. public string NextLink { get; } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/FrontDoorOriginListResult.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/FrontDoorOriginListResult.cs index 414688ad19d2..43c4420bbee4 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/FrontDoorOriginListResult.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/FrontDoorOriginListResult.cs @@ -21,7 +21,7 @@ internal FrontDoorOriginListResult() } /// Initializes a new instance of FrontDoorOriginListResult. - /// List of CDN origins within an endpoint. + /// List of Azure Front Door origins within an Azure Front Door endpoint. /// URL to get the next set of origin objects if there are any. internal FrontDoorOriginListResult(IReadOnlyList value, string nextLink) { @@ -29,7 +29,7 @@ internal FrontDoorOriginListResult(IReadOnlyList value, str NextLink = nextLink; } - /// List of CDN origins within an endpoint. + /// List of Azure Front Door origins within an Azure Front Door endpoint. public IReadOnlyList Value { get; } /// URL to get the next set of origin objects if there are any. public string NextLink { get; } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/FrontDoorOriginPatch.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/FrontDoorOriginPatch.cs index 84f241cc4e9f..a21fde1814d4 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/FrontDoorOriginPatch.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/FrontDoorOriginPatch.cs @@ -40,7 +40,7 @@ public ResourceIdentifier OriginId public int? HttpPort { get; set; } /// The value of the HTTPS port. Must be between 1 and 65535. public int? HttpsPort { get; set; } - /// The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. This overrides the host header defined at Endpoint. + /// The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. This overrides the host header defined at Endpoint. public string OriginHostHeader { get; set; } /// Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. public int? Priority { get; set; } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ManagedRuleGroupOverrideSetting.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ManagedRuleGroupOverrideSetting.cs index 854340c2a470..fbb188d92340 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ManagedRuleGroupOverrideSetting.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ManagedRuleGroupOverrideSetting.cs @@ -27,7 +27,7 @@ public ManagedRuleGroupOverrideSetting(string ruleGroupName) /// Initializes a new instance of ManagedRuleGroupOverrideSetting. /// Describes the managed rule group within the rule set to override. - /// List of rules that will be disabled. If none specified, all rules in the group will be disabled. + /// List of rules that will be enabled. If none specified, all rules in the group will be disabled. internal ManagedRuleGroupOverrideSetting(string ruleGroupName, IList rules) { RuleGroupName = ruleGroupName; @@ -36,7 +36,7 @@ internal ManagedRuleGroupOverrideSetting(string ruleGroupName, IList Describes the managed rule group within the rule set to override. public string RuleGroupName { get; set; } - /// List of rules that will be disabled. If none specified, all rules in the group will be disabled. + /// List of rules that will be enabled. If none specified, all rules in the group will be disabled. public IList Rules { get; } } } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsGranularity.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsGranularity.cs new file mode 100644 index 000000000000..a48494231eeb --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsGranularity.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Cdn.Models +{ + /// The MetricsGranularity. + public readonly partial struct MetricsGranularity : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MetricsGranularity(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PT5MValue = "PT5M"; + private const string PT1HValue = "PT1H"; + private const string P1DValue = "P1D"; + + /// PT5M. + public static MetricsGranularity PT5M { get; } = new MetricsGranularity(PT5MValue); + /// PT1H. + public static MetricsGranularity PT1H { get; } = new MetricsGranularity(PT1HValue); + /// P1D. + public static MetricsGranularity P1D { get; } = new MetricsGranularity(P1DValue); + /// Determines if two values are the same. + public static bool operator ==(MetricsGranularity left, MetricsGranularity right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MetricsGranularity left, MetricsGranularity right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MetricsGranularity(string value) => new MetricsGranularity(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MetricsGranularity other && Equals(other); + /// + public bool Equals(MetricsGranularity other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponse.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponse.Serialization.cs index 9c36dcf4ff84..18d5d0d7d38e 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponse.Serialization.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponse.Serialization.cs @@ -18,7 +18,7 @@ internal static MetricsResponse DeserializeMetricsResponse(JsonElement element) { Optional dateTimeBegin = default; Optional dateTimeEnd = default; - Optional granularity = default; + Optional granularity = default; Optional> series = default; foreach (var property in element.EnumerateObject()) { @@ -49,7 +49,7 @@ internal static MetricsResponse DeserializeMetricsResponse(JsonElement element) property.ThrowNonNullablePropertyIsNull(); continue; } - granularity = new MetricsResponseGranularity(property.Value.GetString()); + granularity = new MetricsGranularity(property.Value.GetString()); continue; } if (property.NameEquals("series")) diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponse.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponse.cs index d358264676c7..f9481d603725 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponse.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponse.cs @@ -25,7 +25,7 @@ internal MetricsResponse() /// /// /// - internal MetricsResponse(DateTimeOffset? dateTimeBegin, DateTimeOffset? dateTimeEnd, MetricsResponseGranularity? granularity, IReadOnlyList series) + internal MetricsResponse(DateTimeOffset? dateTimeBegin, DateTimeOffset? dateTimeEnd, MetricsGranularity? granularity, IReadOnlyList series) { DateTimeBegin = dateTimeBegin; DateTimeEnd = dateTimeEnd; @@ -38,7 +38,7 @@ internal MetricsResponse(DateTimeOffset? dateTimeBegin, DateTimeOffset? dateTime /// Gets the date time end. public DateTimeOffset? DateTimeEnd { get; } /// Gets the granularity. - public MetricsResponseGranularity? Granularity { get; } + public MetricsGranularity? Granularity { get; } /// Gets the series. public IReadOnlyList Series { get; } } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponseGranularity.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponseGranularity.cs deleted file mode 100644 index c7c75de5e4a4..000000000000 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponseGranularity.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.Cdn.Models -{ - /// The MetricsResponseGranularity. - public readonly partial struct MetricsResponseGranularity : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public MetricsResponseGranularity(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string PT5MValue = "PT5M"; - private const string PT1HValue = "PT1H"; - private const string P1DValue = "P1D"; - - /// PT5M. - public static MetricsResponseGranularity PT5M { get; } = new MetricsResponseGranularity(PT5MValue); - /// PT1H. - public static MetricsResponseGranularity PT1H { get; } = new MetricsResponseGranularity(PT1HValue); - /// P1D. - public static MetricsResponseGranularity P1D { get; } = new MetricsResponseGranularity(P1DValue); - /// Determines if two values are the same. - public static bool operator ==(MetricsResponseGranularity left, MetricsResponseGranularity right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MetricsResponseGranularity left, MetricsResponseGranularity right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator MetricsResponseGranularity(string value) => new MetricsResponseGranularity(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MetricsResponseGranularity other && Equals(other); - /// - public bool Equals(MetricsResponseGranularity other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponseSeriesItem.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponseSeriesItem.Serialization.cs index 2c31a2602154..5162470ded7a 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponseSeriesItem.Serialization.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponseSeriesItem.Serialization.cs @@ -16,7 +16,7 @@ public partial class MetricsResponseSeriesItem internal static MetricsResponseSeriesItem DeserializeMetricsResponseSeriesItem(JsonElement element) { Optional metric = default; - Optional unit = default; + Optional unit = default; Optional> groups = default; Optional> data = default; foreach (var property in element.EnumerateObject()) @@ -33,7 +33,7 @@ internal static MetricsResponseSeriesItem DeserializeMetricsResponseSeriesItem(J property.ThrowNonNullablePropertyIsNull(); continue; } - unit = new MetricsResponseSeriesItemUnit(property.Value.GetString()); + unit = new MetricsSeriesUnit(property.Value.GetString()); continue; } if (property.NameEquals("groups")) diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponseSeriesItem.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponseSeriesItem.cs index c3b2d726ddfd..874bba61e128 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponseSeriesItem.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponseSeriesItem.cs @@ -25,7 +25,7 @@ internal MetricsResponseSeriesItem() /// /// /// - internal MetricsResponseSeriesItem(string metric, MetricsResponseSeriesItemUnit? unit, IReadOnlyList groups, IReadOnlyList data) + internal MetricsResponseSeriesItem(string metric, MetricsSeriesUnit? unit, IReadOnlyList groups, IReadOnlyList data) { Metric = metric; Unit = unit; @@ -36,7 +36,7 @@ internal MetricsResponseSeriesItem(string metric, MetricsResponseSeriesItemUnit? /// Gets the metric. public string Metric { get; } /// Gets the unit. - public MetricsResponseSeriesItemUnit? Unit { get; } + public MetricsSeriesUnit? Unit { get; } /// Gets the groups. public IReadOnlyList Groups { get; } /// Gets the data. diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponseSeriesItemUnit.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponseSeriesItemUnit.cs deleted file mode 100644 index 9da6c1bb349a..000000000000 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsResponseSeriesItemUnit.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.Cdn.Models -{ - /// The MetricsResponseSeriesItemUnit. - public readonly partial struct MetricsResponseSeriesItemUnit : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public MetricsResponseSeriesItemUnit(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CountValue = "count"; - private const string BytesValue = "bytes"; - private const string BitsPerSecondValue = "bitsPerSecond"; - private const string MilliSecondsValue = "milliSeconds"; - - /// count. - public static MetricsResponseSeriesItemUnit Count { get; } = new MetricsResponseSeriesItemUnit(CountValue); - /// bytes. - public static MetricsResponseSeriesItemUnit Bytes { get; } = new MetricsResponseSeriesItemUnit(BytesValue); - /// bitsPerSecond. - public static MetricsResponseSeriesItemUnit BitsPerSecond { get; } = new MetricsResponseSeriesItemUnit(BitsPerSecondValue); - /// milliSeconds. - public static MetricsResponseSeriesItemUnit MilliSeconds { get; } = new MetricsResponseSeriesItemUnit(MilliSecondsValue); - /// Determines if two values are the same. - public static bool operator ==(MetricsResponseSeriesItemUnit left, MetricsResponseSeriesItemUnit right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MetricsResponseSeriesItemUnit left, MetricsResponseSeriesItemUnit right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator MetricsResponseSeriesItemUnit(string value) => new MetricsResponseSeriesItemUnit(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MetricsResponseSeriesItemUnit other && Equals(other); - /// - public bool Equals(MetricsResponseSeriesItemUnit other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsSeriesUnit.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsSeriesUnit.cs new file mode 100644 index 000000000000..e55ea05315b7 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MetricsSeriesUnit.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Cdn.Models +{ + /// The MetricsSeriesUnit. + public readonly partial struct MetricsSeriesUnit : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MetricsSeriesUnit(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CountValue = "count"; + private const string BytesValue = "bytes"; + private const string BitsPerSecondValue = "bitsPerSecond"; + private const string MilliSecondsValue = "milliSeconds"; + + /// count. + public static MetricsSeriesUnit Count { get; } = new MetricsSeriesUnit(CountValue); + /// bytes. + public static MetricsSeriesUnit Bytes { get; } = new MetricsSeriesUnit(BytesValue); + /// bitsPerSecond. + public static MetricsSeriesUnit BitsPerSecond { get; } = new MetricsSeriesUnit(BitsPerSecondValue); + /// milliSeconds. + public static MetricsSeriesUnit MilliSeconds { get; } = new MetricsSeriesUnit(MilliSecondsValue); + /// Determines if two values are the same. + public static bool operator ==(MetricsSeriesUnit left, MetricsSeriesUnit right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MetricsSeriesUnit left, MetricsSeriesUnit right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MetricsSeriesUnit(string value) => new MetricsSeriesUnit(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MetricsSeriesUnit other && Equals(other); + /// + public bool Equals(MetricsSeriesUnit other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrateResult.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrateResult.Serialization.cs new file mode 100644 index 000000000000..5e7588d13efd --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrateResult.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Cdn.Models +{ + public partial class MigrateResult + { + internal static MigrateResult DeserializeMigrateResult(JsonElement element) + { + Optional migratedProfileResourceId = default; + Optional> errors = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("migratedProfileResourceId")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + migratedProfileResourceId = JsonSerializer.Deserialize(property.Value.ToString()); + continue; + } + if (property.NameEquals("errors")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationErrorType.DeserializeMigrationErrorType(item)); + } + errors = array; + continue; + } + } + return new MigrateResult(migratedProfileResourceId, Optional.ToList(errors)); + } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrateResult.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrateResult.cs new file mode 100644 index 000000000000..acfb022765e3 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrateResult.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Cdn.Models +{ + /// Result for migrate operation. + public partial class MigrateResult + { + /// Initializes a new instance of MigrateResult. + internal MigrateResult() + { + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of MigrateResult. + /// Arm resource id of the migrated profile. + /// + internal MigrateResult(WritableSubResource migratedProfileResourceId, IReadOnlyList errors) + { + MigratedProfileResourceId = migratedProfileResourceId; + Errors = errors; + } + + /// Arm resource id of the migrated profile. + internal WritableSubResource MigratedProfileResourceId { get; } + /// Gets or sets Id. + public ResourceIdentifier MigratedProfileResourceIdId + { + get => MigratedProfileResourceId?.Id; + } + + /// Gets the errors. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrationContent.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrationContent.Serialization.cs new file mode 100644 index 000000000000..75e789bc625c --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrationContent.Serialization.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Cdn.Models +{ + public partial class MigrationContent : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("sku"); + writer.WriteObjectValue(Sku); + writer.WritePropertyName("classicResourceReference"); + JsonSerializer.Serialize(writer, ClassicResourceReference); writer.WritePropertyName("profileName"); + writer.WriteStringValue(ProfileName); + if (Optional.IsCollectionDefined(MigrationWebApplicationFirewallMappings)) + { + writer.WritePropertyName("migrationWebApplicationFirewallMappings"); + writer.WriteStartArray(); + foreach (var item in MigrationWebApplicationFirewallMappings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrationContent.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrationContent.cs new file mode 100644 index 000000000000..f8bd3ca169e5 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrationContent.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Cdn.Models +{ + /// Request body for Migrate operation. + public partial class MigrationContent + { + /// Initializes a new instance of MigrationContent. + /// Sku for the migration. + /// Resource reference of the classic cdn profile or classic frontdoor that need to be migrated. + /// Name of the new profile that need to be created. + /// , or is null. + public MigrationContent(CdnSku sku, WritableSubResource classicResourceReference, string profileName) + { + Argument.AssertNotNull(sku, nameof(sku)); + Argument.AssertNotNull(classicResourceReference, nameof(classicResourceReference)); + Argument.AssertNotNull(profileName, nameof(profileName)); + + Sku = sku; + ClassicResourceReference = classicResourceReference; + ProfileName = profileName; + MigrationWebApplicationFirewallMappings = new ChangeTrackingList(); + } + + /// Sku for the migration. + internal CdnSku Sku { get; } + /// Name of the pricing tier. + public CdnSkuName? SkuName + { + get => Sku?.Name; + } + + /// Resource reference of the classic cdn profile or classic frontdoor that need to be migrated. + internal WritableSubResource ClassicResourceReference { get; } + /// Gets or sets Id. + public ResourceIdentifier ClassicResourceReferenceId + { + get => ClassicResourceReference?.Id; + } + + /// Name of the new profile that need to be created. + public string ProfileName { get; } + /// Waf mapping for the migrated profile. + public IList MigrationWebApplicationFirewallMappings { get; } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrationErrorType.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrationErrorType.Serialization.cs new file mode 100644 index 000000000000..ff9a536c6c18 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrationErrorType.Serialization.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Cdn.Models +{ + public partial class MigrationErrorType + { + internal static MigrationErrorType DeserializeMigrationErrorType(JsonElement element) + { + Optional code = default; + Optional resourceName = default; + Optional errorMessage = default; + Optional nextSteps = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code")) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceName")) + { + resourceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("errorMessage")) + { + errorMessage = property.Value.GetString(); + continue; + } + if (property.NameEquals("nextSteps")) + { + nextSteps = property.Value.GetString(); + continue; + } + } + return new MigrationErrorType(code.Value, resourceName.Value, errorMessage.Value, nextSteps.Value); + } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrationErrorType.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrationErrorType.cs new file mode 100644 index 000000000000..5cfde5ef67ba --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrationErrorType.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Cdn.Models +{ + /// Error response indicates CDN service is not able to process the incoming request. The reason is provided in the error message. + public partial class MigrationErrorType + { + /// Initializes a new instance of MigrationErrorType. + internal MigrationErrorType() + { + } + + /// Initializes a new instance of MigrationErrorType. + /// Error code. + /// Resource which has the problem. + /// Error message indicating why the operation failed. + /// Describes what needs to be done to fix the problem. + internal MigrationErrorType(string code, string resourceName, string errorMessage, string nextSteps) + { + Code = code; + ResourceName = resourceName; + ErrorMessage = errorMessage; + NextSteps = nextSteps; + } + + /// Error code. + public string Code { get; } + /// Resource which has the problem. + public string ResourceName { get; } + /// Error message indicating why the operation failed. + public string ErrorMessage { get; } + /// Describes what needs to be done to fix the problem. + public string NextSteps { get; } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrationWebApplicationFirewallMapping.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrationWebApplicationFirewallMapping.Serialization.cs new file mode 100644 index 000000000000..c5b42aa5dc2b --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrationWebApplicationFirewallMapping.Serialization.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Cdn.Models +{ + public partial class MigrationWebApplicationFirewallMapping : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(MigratedFrom)) + { + writer.WritePropertyName("migratedFrom"); + JsonSerializer.Serialize(writer, MigratedFrom); + } + if (Optional.IsDefined(MigratedTo)) + { + writer.WritePropertyName("migratedTo"); + JsonSerializer.Serialize(writer, MigratedTo); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrationWebApplicationFirewallMapping.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrationWebApplicationFirewallMapping.cs new file mode 100644 index 000000000000..731965a2a4c5 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/MigrationWebApplicationFirewallMapping.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Cdn.Models +{ + /// Web Application Firewall Mapping. + public partial class MigrationWebApplicationFirewallMapping + { + /// Initializes a new instance of MigrationWebApplicationFirewallMapping. + public MigrationWebApplicationFirewallMapping() + { + } + + /// Migration From Waf policy. + internal WritableSubResource MigratedFrom { get; set; } + /// Gets or sets Id. + public ResourceIdentifier MigratedFromId + { + get => MigratedFrom is null ? default : MigratedFrom.Id; + set + { + if (MigratedFrom is null) + MigratedFrom = new WritableSubResource(); + MigratedFrom.Id = value; + } + } + + /// Migration to Waf policy. + internal WritableSubResource MigratedTo { get; set; } + /// Gets or sets Id. + public ResourceIdentifier MigratedToId + { + get => MigratedTo is null ? default : MigratedTo.Id; + set + { + if (MigratedTo is null) + MigratedTo = new WritableSubResource(); + MigratedTo.Id = value; + } + } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileChangeSkuWafMapping.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileChangeSkuWafMapping.Serialization.cs new file mode 100644 index 000000000000..a0100386ebe5 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileChangeSkuWafMapping.Serialization.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Cdn.Models +{ + public partial class ProfileChangeSkuWafMapping : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("securityPolicyName"); + writer.WriteStringValue(SecurityPolicyName); + writer.WritePropertyName("changeToWafPolicy"); + JsonSerializer.Serialize(writer, ChangeToWafPolicy); writer.WriteEndObject(); + } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileChangeSkuWafMapping.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileChangeSkuWafMapping.cs new file mode 100644 index 000000000000..7f89b4d99069 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileChangeSkuWafMapping.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Cdn.Models +{ + /// Parameters required for profile upgrade. + public partial class ProfileChangeSkuWafMapping + { + /// Initializes a new instance of ProfileChangeSkuWafMapping. + /// The security policy name. + /// The new waf resource for the security policy to use. + /// or is null. + public ProfileChangeSkuWafMapping(string securityPolicyName, WritableSubResource changeToWafPolicy) + { + Argument.AssertNotNull(securityPolicyName, nameof(securityPolicyName)); + Argument.AssertNotNull(changeToWafPolicy, nameof(changeToWafPolicy)); + + SecurityPolicyName = securityPolicyName; + ChangeToWafPolicy = changeToWafPolicy; + } + + /// The security policy name. + public string SecurityPolicyName { get; } + /// The new waf resource for the security policy to use. + internal WritableSubResource ChangeToWafPolicy { get; } + /// Gets or sets Id. + public ResourceIdentifier ChangeToWafPolicyId + { + get => ChangeToWafPolicy?.Id; + } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileData.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileData.Serialization.cs index 77041e132342..59f5a0bed60c 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileData.Serialization.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileData.Serialization.cs @@ -21,6 +21,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("sku"); writer.WriteObjectValue(Sku); + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"); + JsonSerializer.Serialize(writer, Identity); + } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"); @@ -36,6 +41,17 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(Location); writer.WritePropertyName("properties"); writer.WriteStartObject(); + if (Optional.IsCollectionDefined(ExtendedProperties)) + { + writer.WritePropertyName("extendedProperties"); + writer.WriteStartObject(); + foreach (var item in ExtendedProperties) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } if (Optional.IsDefined(OriginResponseTimeoutSeconds)) { if (OriginResponseTimeoutSeconds != null) @@ -56,6 +72,7 @@ internal static ProfileData DeserializeProfileData(JsonElement element) { CdnSku sku = default; Optional kind = default; + Optional identity = default; Optional> tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -64,6 +81,7 @@ internal static ProfileData DeserializeProfileData(JsonElement element) Optional systemData = default; Optional resourceState = default; Optional provisioningState = default; + Optional> extendedProperties = default; Optional frontDoorId = default; Optional originResponseTimeoutSeconds = default; foreach (var property in element.EnumerateObject()) @@ -78,6 +96,16 @@ internal static ProfileData DeserializeProfileData(JsonElement element) kind = property.Value.GetString(); continue; } + if (property.NameEquals("identity")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + identity = JsonSerializer.Deserialize(property.Value.ToString()); + continue; + } if (property.NameEquals("tags")) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -152,6 +180,21 @@ internal static ProfileData DeserializeProfileData(JsonElement element) provisioningState = new ProfileProvisioningState(property0.Value.GetString()); continue; } + if (property0.NameEquals("extendedProperties")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetString()); + } + extendedProperties = dictionary; + continue; + } if (property0.NameEquals("frontDoorId")) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -176,7 +219,7 @@ internal static ProfileData DeserializeProfileData(JsonElement element) continue; } } - return new ProfileData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku, kind.Value, Optional.ToNullable(resourceState), Optional.ToNullable(provisioningState), Optional.ToNullable(frontDoorId), Optional.ToNullable(originResponseTimeoutSeconds)); + return new ProfileData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku, kind.Value, identity, Optional.ToNullable(resourceState), Optional.ToNullable(provisioningState), Optional.ToDictionary(extendedProperties), Optional.ToNullable(frontDoorId), Optional.ToNullable(originResponseTimeoutSeconds)); } } } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfilePatch.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfilePatch.Serialization.cs index 2960c738ced1..1d324dd76e68 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfilePatch.Serialization.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfilePatch.Serialization.cs @@ -26,6 +26,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndObject(); } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"); + JsonSerializer.Serialize(writer, Identity); + } writer.WritePropertyName("properties"); writer.WriteStartObject(); if (Optional.IsDefined(OriginResponseTimeoutSeconds)) diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfilePatch.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfilePatch.cs index 6a34f2a7440b..a6ef7541b80f 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfilePatch.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfilePatch.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.Cdn.Models { @@ -21,6 +22,8 @@ public ProfilePatch() /// Profile tags. public IDictionary Tags { get; } + /// Managed service identity (system assigned and/or user assigned identities). + public ManagedServiceIdentity Identity { get; set; } /// Send and receive timeout on forwarding request to the origin. When timeout is reached, the request fails and returns. public int? OriginResponseTimeoutSeconds { get; set; } } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileResourceState.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileResourceState.cs index 141ea6dbeb57..034bb143dc23 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileResourceState.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileResourceState.cs @@ -26,6 +26,11 @@ public ProfileResourceState(string value) private const string ActiveValue = "Active"; private const string DeletingValue = "Deleting"; private const string DisabledValue = "Disabled"; + private const string MigratingValue = "Migrating"; + private const string MigratedValue = "Migrated"; + private const string PendingMigrationCommitValue = "PendingMigrationCommit"; + private const string CommittingMigrationValue = "CommittingMigration"; + private const string AbortingMigrationValue = "AbortingMigration"; /// Creating. public static ProfileResourceState Creating { get; } = new ProfileResourceState(CreatingValue); @@ -35,6 +40,16 @@ public ProfileResourceState(string value) public static ProfileResourceState Deleting { get; } = new ProfileResourceState(DeletingValue); /// Disabled. public static ProfileResourceState Disabled { get; } = new ProfileResourceState(DisabledValue); + /// Migrating. + public static ProfileResourceState Migrating { get; } = new ProfileResourceState(MigratingValue); + /// Migrated. + public static ProfileResourceState Migrated { get; } = new ProfileResourceState(MigratedValue); + /// PendingMigrationCommit. + public static ProfileResourceState PendingMigrationCommit { get; } = new ProfileResourceState(PendingMigrationCommitValue); + /// CommittingMigration. + public static ProfileResourceState CommittingMigration { get; } = new ProfileResourceState(CommittingMigrationValue); + /// AbortingMigration. + public static ProfileResourceState AbortingMigration { get; } = new ProfileResourceState(AbortingMigrationValue); /// Determines if two values are the same. public static bool operator ==(ProfileResourceState left, ProfileResourceState right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileUpgradeContent.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileUpgradeContent.Serialization.cs new file mode 100644 index 000000000000..273c016e4f01 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileUpgradeContent.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Cdn.Models +{ + public partial class ProfileUpgradeContent : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("wafMappingList"); + writer.WriteStartArray(); + foreach (var item in WafMappingList) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileUpgradeContent.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileUpgradeContent.cs new file mode 100644 index 000000000000..ed23bbdc5299 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ProfileUpgradeContent.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.Cdn.Models +{ + /// Parameters required for profile upgrade. + public partial class ProfileUpgradeContent + { + /// Initializes a new instance of ProfileUpgradeContent. + /// Web Application Firewall (WAF) and security policy mapping for the profile upgrade. + /// is null. + public ProfileUpgradeContent(IEnumerable wafMappingList) + { + Argument.AssertNotNull(wafMappingList, nameof(wafMappingList)); + + WafMappingList = wafMappingList.ToList(); + } + + /// Web Application Firewall (WAF) and security policy mapping for the profile upgrade. + public IList WafMappingList { get; } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/SecretType.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/SecretType.cs index 9621e0a960ee..6780221495f9 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/SecretType.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/SecretType.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Cdn.Models { /// The type of the secret resource. - internal readonly partial struct SecretType : IEquatable + public readonly partial struct SecretType : IEquatable { private readonly string _value; diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ValidateSecretContent.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ValidateSecretContent.Serialization.cs new file mode 100644 index 000000000000..95362cd35a9e --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ValidateSecretContent.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Cdn.Models +{ + public partial class ValidateSecretContent : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("secretType"); + writer.WriteStringValue(SecretType.ToString()); + writer.WritePropertyName("secretSource"); + JsonSerializer.Serialize(writer, SecretSource); if (Optional.IsDefined(SecretVersion)) + { + writer.WritePropertyName("secretVersion"); + writer.WriteStringValue(SecretVersion); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ValidateSecretContent.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ValidateSecretContent.cs new file mode 100644 index 000000000000..6bd87e30b5d1 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ValidateSecretContent.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Cdn.Models +{ + /// Input of the secret to be validated. + public partial class ValidateSecretContent + { + /// Initializes a new instance of ValidateSecretContent. + /// The secret type. + /// Resource reference to the Azure Key Vault secret. Expected to be in format of /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + /// is null. + public ValidateSecretContent(SecretType secretType, WritableSubResource secretSource) + { + Argument.AssertNotNull(secretSource, nameof(secretSource)); + + SecretType = secretType; + SecretSource = secretSource; + } + + /// The secret type. + public SecretType SecretType { get; } + /// Resource reference to the Azure Key Vault secret. Expected to be in format of /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​. + internal WritableSubResource SecretSource { get; } + /// Gets or sets Id. + public ResourceIdentifier SecretSourceId + { + get => SecretSource?.Id; + } + + /// Secret version, if customer is using a specific version. + public string SecretVersion { get; set; } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ValidateSecretResult.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ValidateSecretResult.Serialization.cs new file mode 100644 index 000000000000..cc6462dfd850 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ValidateSecretResult.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Cdn.Models +{ + public partial class ValidateSecretResult + { + internal static ValidateSecretResult DeserializeValidateSecretResult(JsonElement element) + { + Optional status = default; + Optional message = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + status = new ValidationStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("message")) + { + message = property.Value.GetString(); + continue; + } + } + return new ValidateSecretResult(Optional.ToNullable(status), message.Value); + } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ValidateSecretResult.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ValidateSecretResult.cs new file mode 100644 index 000000000000..13651485375e --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ValidateSecretResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Cdn.Models +{ + /// Output of the validated secret. + public partial class ValidateSecretResult + { + /// Initializes a new instance of ValidateSecretResult. + internal ValidateSecretResult() + { + } + + /// Initializes a new instance of ValidateSecretResult. + /// The validation status. + /// Detailed error message. + internal ValidateSecretResult(ValidationStatus? status, string message) + { + Status = status; + Message = message; + } + + /// The validation status. + public ValidationStatus? Status { get; } + /// Detailed error message. + public string Message { get; } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ValidationStatus.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ValidationStatus.cs new file mode 100644 index 000000000000..2024bd1bb960 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/ValidationStatus.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Cdn.Models +{ + /// The validation status. + public readonly partial struct ValidationStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ValidationStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ValidValue = "Valid"; + private const string InvalidValue = "Invalid"; + private const string AccessDeniedValue = "AccessDenied"; + private const string CertificateExpiredValue = "CertificateExpired"; + + /// Valid. + public static ValidationStatus Valid { get; } = new ValidationStatus(ValidValue); + /// Invalid. + public static ValidationStatus Invalid { get; } = new ValidationStatus(InvalidValue); + /// AccessDenied. + public static ValidationStatus AccessDenied { get; } = new ValidationStatus(AccessDeniedValue); + /// CertificateExpired. + public static ValidationStatus CertificateExpired { get; } = new ValidationStatus(CertificateExpiredValue); + /// Determines if two values are the same. + public static bool operator ==(ValidationStatus left, ValidationStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ValidationStatus left, ValidationStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ValidationStatus(string value) => new ValidationStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ValidationStatus other && Equals(other); + /// + public bool Equals(ValidationStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsGranularity.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsGranularity.cs new file mode 100644 index 000000000000..dde13b4d2e44 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsGranularity.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Cdn.Models +{ + /// The WafMetricsGranularity. + public readonly partial struct WafMetricsGranularity : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public WafMetricsGranularity(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PT5MValue = "PT5M"; + private const string PT1HValue = "PT1H"; + private const string P1DValue = "P1D"; + + /// PT5M. + public static WafMetricsGranularity PT5M { get; } = new WafMetricsGranularity(PT5MValue); + /// PT1H. + public static WafMetricsGranularity PT1H { get; } = new WafMetricsGranularity(PT1HValue); + /// P1D. + public static WafMetricsGranularity P1D { get; } = new WafMetricsGranularity(P1DValue); + /// Determines if two values are the same. + public static bool operator ==(WafMetricsGranularity left, WafMetricsGranularity right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(WafMetricsGranularity left, WafMetricsGranularity right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator WafMetricsGranularity(string value) => new WafMetricsGranularity(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is WafMetricsGranularity other && Equals(other); + /// + public bool Equals(WafMetricsGranularity other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponse.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponse.Serialization.cs index 685a477e9eb5..0443a1b57f85 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponse.Serialization.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponse.Serialization.cs @@ -18,7 +18,7 @@ internal static WafMetricsResponse DeserializeWafMetricsResponse(JsonElement ele { Optional dateTimeBegin = default; Optional dateTimeEnd = default; - Optional granularity = default; + Optional granularity = default; Optional> series = default; foreach (var property in element.EnumerateObject()) { @@ -49,7 +49,7 @@ internal static WafMetricsResponse DeserializeWafMetricsResponse(JsonElement ele property.ThrowNonNullablePropertyIsNull(); continue; } - granularity = new WafMetricsResponseGranularity(property.Value.GetString()); + granularity = new WafMetricsGranularity(property.Value.GetString()); continue; } if (property.NameEquals("series")) diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponse.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponse.cs index 24b12c301c63..59542877809e 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponse.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponse.cs @@ -25,7 +25,7 @@ internal WafMetricsResponse() /// /// /// - internal WafMetricsResponse(DateTimeOffset? dateTimeBegin, DateTimeOffset? dateTimeEnd, WafMetricsResponseGranularity? granularity, IReadOnlyList series) + internal WafMetricsResponse(DateTimeOffset? dateTimeBegin, DateTimeOffset? dateTimeEnd, WafMetricsGranularity? granularity, IReadOnlyList series) { DateTimeBegin = dateTimeBegin; DateTimeEnd = dateTimeEnd; @@ -38,7 +38,7 @@ internal WafMetricsResponse(DateTimeOffset? dateTimeBegin, DateTimeOffset? dateT /// Gets the date time end. public DateTimeOffset? DateTimeEnd { get; } /// Gets the granularity. - public WafMetricsResponseGranularity? Granularity { get; } + public WafMetricsGranularity? Granularity { get; } /// Gets the series. public IReadOnlyList Series { get; } } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponseGranularity.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponseGranularity.cs deleted file mode 100644 index c6550dd362b5..000000000000 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponseGranularity.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.Cdn.Models -{ - /// The WafMetricsResponseGranularity. - public readonly partial struct WafMetricsResponseGranularity : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public WafMetricsResponseGranularity(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string PT5MValue = "PT5M"; - private const string PT1HValue = "PT1H"; - private const string P1DValue = "P1D"; - - /// PT5M. - public static WafMetricsResponseGranularity PT5M { get; } = new WafMetricsResponseGranularity(PT5MValue); - /// PT1H. - public static WafMetricsResponseGranularity PT1H { get; } = new WafMetricsResponseGranularity(PT1HValue); - /// P1D. - public static WafMetricsResponseGranularity P1D { get; } = new WafMetricsResponseGranularity(P1DValue); - /// Determines if two values are the same. - public static bool operator ==(WafMetricsResponseGranularity left, WafMetricsResponseGranularity right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(WafMetricsResponseGranularity left, WafMetricsResponseGranularity right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator WafMetricsResponseGranularity(string value) => new WafMetricsResponseGranularity(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is WafMetricsResponseGranularity other && Equals(other); - /// - public bool Equals(WafMetricsResponseGranularity other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponseSeriesItem.Serialization.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponseSeriesItem.Serialization.cs index 26bf81791b4f..8a8b3b318a0c 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponseSeriesItem.Serialization.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponseSeriesItem.Serialization.cs @@ -16,7 +16,7 @@ public partial class WafMetricsResponseSeriesItem internal static WafMetricsResponseSeriesItem DeserializeWafMetricsResponseSeriesItem(JsonElement element) { Optional metric = default; - Optional unit = default; + Optional unit = default; Optional> groups = default; Optional> data = default; foreach (var property in element.EnumerateObject()) @@ -33,7 +33,7 @@ internal static WafMetricsResponseSeriesItem DeserializeWafMetricsResponseSeries property.ThrowNonNullablePropertyIsNull(); continue; } - unit = new WafMetricsResponseSeriesItemUnit(property.Value.GetString()); + unit = new WafMetricsSeriesUnit(property.Value.GetString()); continue; } if (property.NameEquals("groups")) diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponseSeriesItem.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponseSeriesItem.cs index 1432f3f7d94d..9f4095d5cfb2 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponseSeriesItem.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponseSeriesItem.cs @@ -25,7 +25,7 @@ internal WafMetricsResponseSeriesItem() /// /// /// - internal WafMetricsResponseSeriesItem(string metric, WafMetricsResponseSeriesItemUnit? unit, IReadOnlyList groups, IReadOnlyList data) + internal WafMetricsResponseSeriesItem(string metric, WafMetricsSeriesUnit? unit, IReadOnlyList groups, IReadOnlyList data) { Metric = metric; Unit = unit; @@ -36,7 +36,7 @@ internal WafMetricsResponseSeriesItem(string metric, WafMetricsResponseSeriesIte /// Gets the metric. public string Metric { get; } /// Gets the unit. - public WafMetricsResponseSeriesItemUnit? Unit { get; } + public WafMetricsSeriesUnit? Unit { get; } /// Gets the groups. public IReadOnlyList Groups { get; } /// Gets the data. diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponseSeriesItemUnit.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponseSeriesItemUnit.cs deleted file mode 100644 index 271c77666479..000000000000 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsResponseSeriesItemUnit.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.Cdn.Models -{ - /// The WafMetricsResponseSeriesItemUnit. - public readonly partial struct WafMetricsResponseSeriesItemUnit : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public WafMetricsResponseSeriesItemUnit(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CountValue = "count"; - - /// count. - public static WafMetricsResponseSeriesItemUnit Count { get; } = new WafMetricsResponseSeriesItemUnit(CountValue); - /// Determines if two values are the same. - public static bool operator ==(WafMetricsResponseSeriesItemUnit left, WafMetricsResponseSeriesItemUnit right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(WafMetricsResponseSeriesItemUnit left, WafMetricsResponseSeriesItemUnit right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator WafMetricsResponseSeriesItemUnit(string value) => new WafMetricsResponseSeriesItemUnit(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is WafMetricsResponseSeriesItemUnit other && Equals(other); - /// - public bool Equals(WafMetricsResponseSeriesItemUnit other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsSeriesUnit.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsSeriesUnit.cs new file mode 100644 index 000000000000..0eb9abb1fa77 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Models/WafMetricsSeriesUnit.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Cdn.Models +{ + /// The WafMetricsSeriesUnit. + public readonly partial struct WafMetricsSeriesUnit : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public WafMetricsSeriesUnit(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CountValue = "count"; + + /// count. + public static WafMetricsSeriesUnit Count { get; } = new WafMetricsSeriesUnit(CountValue); + /// Determines if two values are the same. + public static bool operator ==(WafMetricsSeriesUnit left, WafMetricsSeriesUnit right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(WafMetricsSeriesUnit left, WafMetricsSeriesUnit right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator WafMetricsSeriesUnit(string value) => new WafMetricsSeriesUnit(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is WafMetricsSeriesUnit other && Equals(other); + /// + public bool Equals(WafMetricsSeriesUnit other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/ProfileData.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/ProfileData.cs index 8e6fb6c505c5..931b772aa6f0 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/ProfileData.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/ProfileData.cs @@ -25,6 +25,7 @@ public ProfileData(AzureLocation location, CdnSku sku) : base(location) Argument.AssertNotNull(sku, nameof(sku)); Sku = sku; + ExtendedProperties = new ChangeTrackingDictionary(); } /// Initializes a new instance of ProfileData. @@ -36,16 +37,20 @@ public ProfileData(AzureLocation location, CdnSku sku) : base(location) /// The location. /// The pricing tier (defines Azure Front Door Standard or Premium or a CDN provider, feature list and rate) of the profile. /// Kind of the profile. Used by portal to differentiate traditional CDN profile and new AFD profile. + /// Managed service identity (system assigned and/or user assigned identities). /// Resource status of the profile. /// Provisioning status of the profile. + /// Key-Value pair representing additional properties for profiles. /// The Id of the frontdoor. /// Send and receive timeout on forwarding request to the origin. When timeout is reached, the request fails and returns. - internal ProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CdnSku sku, string kind, ProfileResourceState? resourceState, ProfileProvisioningState? provisioningState, Guid? frontDoorId, int? originResponseTimeoutSeconds) : base(id, name, resourceType, systemData, tags, location) + internal ProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CdnSku sku, string kind, ManagedServiceIdentity identity, ProfileResourceState? resourceState, ProfileProvisioningState? provisioningState, IDictionary extendedProperties, Guid? frontDoorId, int? originResponseTimeoutSeconds) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; Kind = kind; + Identity = identity; ResourceState = resourceState; ProvisioningState = provisioningState; + ExtendedProperties = extendedProperties; FrontDoorId = frontDoorId; OriginResponseTimeoutSeconds = originResponseTimeoutSeconds; } @@ -66,10 +71,14 @@ public CdnSkuName? SkuName /// Kind of the profile. Used by portal to differentiate traditional CDN profile and new AFD profile. public string Kind { get; } + /// Managed service identity (system assigned and/or user assigned identities). + public ManagedServiceIdentity Identity { get; set; } /// Resource status of the profile. public ProfileResourceState? ResourceState { get; } /// Provisioning status of the profile. public ProfileProvisioningState? ProvisioningState { get; } + /// Key-Value pair representing additional properties for profiles. + public IDictionary ExtendedProperties { get; } /// The Id of the frontdoor. public Guid? FrontDoorId { get; } /// Send and receive timeout on forwarding request to the origin. When timeout is reached, the request fails and returns. diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/ProfileResource.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/ProfileResource.cs index 240d6b84c6e0..f7c971868e5c 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/ProfileResource.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/ProfileResource.cs @@ -517,7 +517,59 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Profile } /// - /// Checks the quota and actual usage of AzureFrontDoor endpoints under the given CDN profile. + /// Check the availability of an afdx endpoint name, and return the globally unique endpoint host name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkEndpointNameAvailability + /// Operation Id: FrontDoorProfiles_CheckEndpointNameAvailability + /// + /// Input to check. + /// The cancellation token to use. + /// is null. + public virtual async Task> CheckEndpointNameAvailabilityFrontDoorProfileAsync(EndpointNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _frontDoorProfilesClientDiagnostics.CreateScope("ProfileResource.CheckEndpointNameAvailabilityFrontDoorProfile"); + scope.Start(); + try + { + var response = await _frontDoorProfilesRestClient.CheckEndpointNameAvailabilityAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Check the availability of an afdx endpoint name, and return the globally unique endpoint host name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkEndpointNameAvailability + /// Operation Id: FrontDoorProfiles_CheckEndpointNameAvailability + /// + /// Input to check. + /// The cancellation token to use. + /// is null. + public virtual Response CheckEndpointNameAvailabilityFrontDoorProfile(EndpointNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _frontDoorProfilesClientDiagnostics.CreateScope("ProfileResource.CheckEndpointNameAvailabilityFrontDoorProfile"); + scope.Start(); + try + { + var response = _frontDoorProfilesRestClient.CheckEndpointNameAvailability(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/usages /// Operation Id: FrontDoorProfiles_ListResourceUsage /// @@ -559,7 +611,7 @@ async Task> NextPageFunc(string nextLink, int? pageSizeHint } /// - /// Checks the quota and actual usage of AzureFrontDoor endpoints under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/usages /// Operation Id: FrontDoorProfiles_ListResourceUsage /// @@ -601,7 +653,7 @@ Page NextPageFunc(string nextLink, int? pageSizeHint) } /// - /// Check the name availability of a host name. + /// Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkHostNameAvailability /// Operation Id: FrontDoorProfiles_CheckHostNameAvailability /// @@ -627,7 +679,7 @@ public virtual async Task> CheckFrontDoorPro } /// - /// Check the name availability of a host name. + /// Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkHostNameAvailability /// Operation Id: FrontDoorProfiles_CheckHostNameAvailability /// @@ -652,6 +704,118 @@ public virtual Response CheckFrontDoorProfileHostName } } + /// + /// Validate a Secret in the profile. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/validateSecret + /// Operation Id: FrontDoorProfiles_ValidateSecret + /// + /// The Secret source. + /// The cancellation token to use. + /// is null. + public virtual async Task> ValidateSecretFrontDoorProfileAsync(ValidateSecretContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _frontDoorProfilesClientDiagnostics.CreateScope("ProfileResource.ValidateSecretFrontDoorProfile"); + scope.Start(); + try + { + var response = await _frontDoorProfilesRestClient.ValidateSecretAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Validate a Secret in the profile. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/validateSecret + /// Operation Id: FrontDoorProfiles_ValidateSecret + /// + /// The Secret source. + /// The cancellation token to use. + /// is null. + public virtual Response ValidateSecretFrontDoorProfile(ValidateSecretContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _frontDoorProfilesClientDiagnostics.CreateScope("ProfileResource.ValidateSecretFrontDoorProfile"); + scope.Start(); + try + { + var response = _frontDoorProfilesRestClient.ValidateSecret(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/upgrade + /// Operation Id: FrontDoorProfiles_Upgrade + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Profile upgrade input parameter. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpgradeFrontDoorProfileAsync(WaitUntil waitUntil, ProfileUpgradeContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _frontDoorProfilesClientDiagnostics.CreateScope("ProfileResource.UpgradeFrontDoorProfile"); + scope.Start(); + try + { + var response = await _frontDoorProfilesRestClient.UpgradeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new CdnArmOperation(new ProfileOperationSource(Client), _frontDoorProfilesClientDiagnostics, Pipeline, _frontDoorProfilesRestClient.CreateUpgradeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/upgrade + /// Operation Id: FrontDoorProfiles_Upgrade + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Profile upgrade input parameter. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation UpgradeFrontDoorProfile(WaitUntil waitUntil, ProfileUpgradeContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _frontDoorProfilesClientDiagnostics.CreateScope("ProfileResource.UpgradeFrontDoorProfile"); + scope.Start(); + try + { + var response = _frontDoorProfilesRestClient.Upgrade(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new CdnArmOperation(new ProfileOperationSource(Client), _frontDoorProfilesClientDiagnostics, Pipeline, _frontDoorProfilesRestClient.CreateUpgradeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Get log report for AFD profile /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getLogAnalyticsMetrics @@ -1006,6 +1170,58 @@ public virtual Response GetWafLogAnalyticsRankings(IEnumera } } + /// + /// Commit the migrated Azure Frontdoor(Standard/Premium) profile. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/migrationCommit + /// Operation Id: Profiles_MigrationCommit + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task MigrationCommitAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _profileClientDiagnostics.CreateScope("ProfileResource.MigrationCommit"); + scope.Start(); + try + { + var response = await _profileRestClient.MigrationCommitAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new CdnArmOperation(_profileClientDiagnostics, Pipeline, _profileRestClient.CreateMigrationCommitRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Commit the migrated Azure Frontdoor(Standard/Premium) profile. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/migrationCommit + /// Operation Id: Profiles_MigrationCommit + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation MigrationCommit(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _profileClientDiagnostics.CreateScope("ProfileResource.MigrationCommit"); + scope.Start(); + try + { + var response = _profileRestClient.MigrationCommit(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new CdnArmOperation(_profileClientDiagnostics, Pipeline, _profileRestClient.CreateMigrationCommitRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is used to configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The SSO URI changes approximately every 10 minutes. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/generateSsoUri diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnCustomDomainsRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnCustomDomainsRestOperations.cs index ba164bc3a5f2..b3701d153b5f 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnCustomDomainsRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnCustomDomainsRestOperations.cs @@ -33,7 +33,7 @@ public CdnCustomDomainsRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnEndpointsRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnEndpointsRestOperations.cs index 02fe71027d7b..21c0eb5016ff 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnEndpointsRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnEndpointsRestOperations.cs @@ -33,7 +33,7 @@ public CdnEndpointsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnManagementRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnManagementRestOperations.cs index dc5f239a4d52..cc3491510821 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnManagementRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnManagementRestOperations.cs @@ -33,7 +33,7 @@ public CdnManagementRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnOriginGroupsRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnOriginGroupsRestOperations.cs index d4b57e83284b..30aa013c8471 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnOriginGroupsRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnOriginGroupsRestOperations.cs @@ -33,7 +33,7 @@ public CdnOriginGroupsRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnOriginsRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnOriginsRestOperations.cs index f403e355d862..9b7e25fbfe8d 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnOriginsRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/CdnOriginsRestOperations.cs @@ -33,7 +33,7 @@ public CdnOriginsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/EdgeNodesRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/EdgeNodesRestOperations.cs index 6609c9fbf1df..421ec33d6e76 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/EdgeNodesRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/EdgeNodesRestOperations.cs @@ -33,7 +33,7 @@ public EdgeNodesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorCustomDomainsRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorCustomDomainsRestOperations.cs index 878bcc896906..89854126af73 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorCustomDomainsRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorCustomDomainsRestOperations.cs @@ -33,7 +33,7 @@ public FrontDoorCustomDomainsRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -61,7 +61,7 @@ internal HttpMessage CreateListByProfileRequest(string subscriptionId, string re /// Lists existing AzureFrontDoor domains. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. - /// Name of the Azure Front Door Standard or Azure Front Door Premium profile or CDN profile which is unique within the resource group. + /// Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -90,7 +90,7 @@ public async Task> ListByProfileAsync( /// Lists existing AzureFrontDoor domains. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. - /// Name of the Azure Front Door Standard or Azure Front Door Premium profile or CDN profile which is unique within the resource group. + /// Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -547,7 +547,7 @@ internal HttpMessage CreateListByProfileNextPageRequest(string nextLink, string /// The URL to the next page of results. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. - /// Name of the Azure Front Door Standard or Azure Front Door Premium profile or CDN profile which is unique within the resource group. + /// Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -578,7 +578,7 @@ public async Task> ListByProfileNextPa /// The URL to the next page of results. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. - /// Name of the Azure Front Door Standard or Azure Front Door Premium profile or CDN profile which is unique within the resource group. + /// Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorEndpointsRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorEndpointsRestOperations.cs index 884d8f31de52..b456009f0084 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorEndpointsRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorEndpointsRestOperations.cs @@ -33,7 +33,7 @@ public FrontDoorEndpointsRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -560,7 +560,7 @@ internal HttpMessage CreateListResourceUsageRequest(string subscriptionId, strin return message; } - /// Checks the quota and actual usage of the given AzureFrontDoor endpoint under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. /// Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group. @@ -591,7 +591,7 @@ public async Task> ListResourceUsageAsync(string subs } } - /// Checks the quota and actual usage of the given AzureFrontDoor endpoint under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. /// Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group. @@ -649,7 +649,7 @@ internal HttpMessage CreateValidateCustomDomainRequest(string subscriptionId, st return message; } - /// Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS.This api isn't work for apex domain. + /// Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. /// Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group. @@ -682,7 +682,7 @@ public async Task> ValidateCustomDomainAsyn } } - /// Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS.This api isn't work for apex domain. + /// Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. /// Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group. @@ -805,7 +805,7 @@ internal HttpMessage CreateListResourceUsageNextPageRequest(string nextLink, str return message; } - /// Checks the quota and actual usage of the given AzureFrontDoor endpoint under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile. /// The URL to the next page of results. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. @@ -838,7 +838,7 @@ public async Task> ListResourceUsageNextPageAsync(str } } - /// Checks the quota and actual usage of the given AzureFrontDoor endpoint under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile. /// The URL to the next page of results. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorOriginGroupsRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorOriginGroupsRestOperations.cs index d1ba5c828d11..8acc9c4cb73c 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorOriginGroupsRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorOriginGroupsRestOperations.cs @@ -33,7 +33,7 @@ public FrontDoorOriginGroupsRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -475,7 +475,7 @@ internal HttpMessage CreateListResourceUsageRequest(string subscriptionId, strin return message; } - /// Checks the quota and actual usage of the given AzureFrontDoor origin group under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. /// Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group. @@ -506,7 +506,7 @@ public async Task> ListResourceUsageAsync(string subs } } - /// Checks the quota and actual usage of the given AzureFrontDoor origin group under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. /// Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group. @@ -627,7 +627,7 @@ internal HttpMessage CreateListResourceUsageNextPageRequest(string nextLink, str return message; } - /// Checks the quota and actual usage of the given AzureFrontDoor origin group under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. /// The URL to the next page of results. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. @@ -660,7 +660,7 @@ public async Task> ListResourceUsageNextPageAsync(str } } - /// Checks the quota and actual usage of the given AzureFrontDoor origin group under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. /// The URL to the next page of results. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorOriginsRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorOriginsRestOperations.cs index 5163902d5d34..faedfb94b059 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorOriginsRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorOriginsRestOperations.cs @@ -33,7 +33,7 @@ public FrontDoorOriginsRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorProfilesRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorProfilesRestOperations.cs index ed9b79a31042..52742ef3a9ce 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorProfilesRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorProfilesRestOperations.cs @@ -33,10 +33,97 @@ public FrontDoorProfilesRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } + internal HttpMessage CreateCheckEndpointNameAvailabilityRequest(string subscriptionId, string resourceGroupName, string profileName, EndpointNameAvailabilityContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Cdn/profiles/", false); + uri.AppendPath(profileName, true); + uri.AppendPath("/checkEndpointNameAvailability", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Check the availability of an afdx endpoint name, and return the globally unique endpoint host name. + /// Azure Subscription ID. + /// Name of the Resource group within the Azure subscription. + /// Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. + /// Input to check. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> CheckEndpointNameAvailabilityAsync(string subscriptionId, string resourceGroupName, string profileName, EndpointNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(profileName, nameof(profileName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateCheckEndpointNameAvailabilityRequest(subscriptionId, resourceGroupName, profileName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointNameAvailabilityResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointNameAvailabilityResult.DeserializeEndpointNameAvailabilityResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Check the availability of an afdx endpoint name, and return the globally unique endpoint host name. + /// Azure Subscription ID. + /// Name of the Resource group within the Azure subscription. + /// Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. + /// Input to check. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CheckEndpointNameAvailability(string subscriptionId, string resourceGroupName, string profileName, EndpointNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(profileName, nameof(profileName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateCheckEndpointNameAvailabilityRequest(subscriptionId, resourceGroupName, profileName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointNameAvailabilityResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointNameAvailabilityResult.DeserializeEndpointNameAvailabilityResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateListResourceUsageRequest(string subscriptionId, string resourceGroupName, string profileName) { var message = _pipeline.CreateMessage(); @@ -58,10 +145,10 @@ internal HttpMessage CreateListResourceUsageRequest(string subscriptionId, strin return message; } - /// Checks the quota and actual usage of AzureFrontDoor endpoints under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. - /// Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the resource group. + /// Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -87,10 +174,10 @@ public async Task> ListResourceUsageAsync(string subs } } - /// Checks the quota and actual usage of AzureFrontDoor endpoints under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. - /// Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the resource group. + /// Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -141,10 +228,10 @@ internal HttpMessage CreateCheckHostNameAvailabilityRequest(string subscriptionI return message; } - /// Check the name availability of a host name. + /// Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. - /// Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the resource group. + /// Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group. /// Custom domain to be validated. /// The cancellation token to use. /// , , or is null. @@ -172,10 +259,10 @@ public async Task> CheckHostNameAvailability } } - /// Check the name availability of a host name. + /// Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in DNS. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. - /// Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the resource group. + /// Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group. /// Custom domain to be validated. /// The cancellation token to use. /// , , or is null. @@ -203,6 +290,172 @@ public Response CheckHostNameAvailability(string subs } } + internal HttpMessage CreateValidateSecretRequest(string subscriptionId, string resourceGroupName, string profileName, ValidateSecretContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Cdn/profiles/", false); + uri.AppendPath(profileName, true); + uri.AppendPath("/validateSecret", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Validate a Secret in the profile. + /// Azure Subscription ID. + /// Name of the Resource group within the Azure subscription. + /// Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. + /// The Secret source. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ValidateSecretAsync(string subscriptionId, string resourceGroupName, string profileName, ValidateSecretContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(profileName, nameof(profileName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateValidateSecretRequest(subscriptionId, resourceGroupName, profileName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ValidateSecretResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ValidateSecretResult.DeserializeValidateSecretResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Validate a Secret in the profile. + /// Azure Subscription ID. + /// Name of the Resource group within the Azure subscription. + /// Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. + /// The Secret source. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ValidateSecret(string subscriptionId, string resourceGroupName, string profileName, ValidateSecretContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(profileName, nameof(profileName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateValidateSecretRequest(subscriptionId, resourceGroupName, profileName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ValidateSecretResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ValidateSecretResult.DeserializeValidateSecretResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpgradeRequest(string subscriptionId, string resourceGroupName, string profileName, ProfileUpgradeContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Cdn/profiles/", false); + uri.AppendPath(profileName, true); + uri.AppendPath("/upgrade", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + /// Azure Subscription ID. + /// Name of the Resource group within the Azure subscription. + /// Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. + /// Profile upgrade input parameter. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpgradeAsync(string subscriptionId, string resourceGroupName, string profileName, ProfileUpgradeContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(profileName, nameof(profileName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUpgradeRequest(subscriptionId, resourceGroupName, profileName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Upgrade a profile from Standard_AzureFrontDoor to Premium_AzureFrontDoor. + /// Azure Subscription ID. + /// Name of the Resource group within the Azure subscription. + /// Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. + /// Profile upgrade input parameter. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Upgrade(string subscriptionId, string resourceGroupName, string profileName, ProfileUpgradeContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(profileName, nameof(profileName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUpgradeRequest(subscriptionId, resourceGroupName, profileName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateListResourceUsageNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string profileName) { var message = _pipeline.CreateMessage(); @@ -217,11 +470,11 @@ internal HttpMessage CreateListResourceUsageNextPageRequest(string nextLink, str return message; } - /// Checks the quota and actual usage of AzureFrontDoor endpoints under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile. /// The URL to the next page of results. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. - /// Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the resource group. + /// Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -248,11 +501,11 @@ public async Task> ListResourceUsageNextPageAsync(str } } - /// Checks the quota and actual usage of AzureFrontDoor endpoints under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile. /// The URL to the next page of results. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. - /// Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the resource group. + /// Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorRoutesRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorRoutesRestOperations.cs index e58a00fc1cf0..9afb9177e650 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorRoutesRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorRoutesRestOperations.cs @@ -33,7 +33,7 @@ public FrontDoorRoutesRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorRuleSetsRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorRuleSetsRestOperations.cs index 83d13aaf4845..6789dbba137e 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorRuleSetsRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorRuleSetsRestOperations.cs @@ -33,7 +33,7 @@ public FrontDoorRuleSetsRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -391,7 +391,7 @@ internal HttpMessage CreateListResourceUsageRequest(string subscriptionId, strin return message; } - /// Checks the quota and actual usage of the given AzureFrontDoor rule set under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. /// Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group. @@ -422,7 +422,7 @@ public async Task> ListResourceUsageAsync(string subs } } - /// Checks the quota and actual usage of the given AzureFrontDoor rule set under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. /// Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group. @@ -543,7 +543,7 @@ internal HttpMessage CreateListResourceUsageNextPageRequest(string nextLink, str return message; } - /// Checks the quota and actual usage of the given AzureFrontDoor rule set under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. /// The URL to the next page of results. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. @@ -576,7 +576,7 @@ public async Task> ListResourceUsageNextPageAsync(str } } - /// Checks the quota and actual usage of the given AzureFrontDoor rule set under the given CDN profile. + /// Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. /// The URL to the next page of results. /// Azure Subscription ID. /// Name of the Resource group within the Azure subscription. diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorRulesRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorRulesRestOperations.cs index 737871f392df..1453ceb27dbe 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorRulesRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorRulesRestOperations.cs @@ -33,7 +33,7 @@ public FrontDoorRulesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorSecretsRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorSecretsRestOperations.cs index df30aa50f99e..c2c818ad0734 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorSecretsRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorSecretsRestOperations.cs @@ -33,7 +33,7 @@ public FrontDoorSecretsRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorSecurityPoliciesRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorSecurityPoliciesRestOperations.cs index e2f817782ea5..bed5e6921684 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorSecurityPoliciesRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/FrontDoorSecurityPoliciesRestOperations.cs @@ -33,7 +33,7 @@ public FrontDoorSecurityPoliciesRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/LogAnalyticsRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/LogAnalyticsRestOperations.cs index b2a620cc50ed..cfcb3e9b0f18 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/LogAnalyticsRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/LogAnalyticsRestOperations.cs @@ -34,7 +34,7 @@ public LogAnalyticsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/ManagedRuleSetsRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/ManagedRuleSetsRestOperations.cs index d9da272d5bc3..25cc7f95eb06 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/ManagedRuleSetsRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/ManagedRuleSetsRestOperations.cs @@ -33,7 +33,7 @@ public ManagedRuleSetsRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/PoliciesRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/PoliciesRestOperations.cs index 18e1a4702e7e..7e58a0f0db93 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/PoliciesRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/PoliciesRestOperations.cs @@ -33,7 +33,7 @@ public PoliciesRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/ProfilesRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/ProfilesRestOperations.cs index 9fa159c3bef4..0cd806a460e1 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/ProfilesRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/ProfilesRestOperations.cs @@ -33,7 +33,7 @@ public ProfilesRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -489,6 +489,231 @@ public Response Delete(string subscriptionId, string resourceGroupName, string p } } + internal HttpMessage CreateCanMigrateRequest(string subscriptionId, string resourceGroupName, CanMigrateContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Cdn/canMigrate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + /// Azure Subscription ID. + /// Name of the Resource group within the Azure subscription. + /// Properties needed to check if cdn profile or classic frontdoor can be migrated. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> CanMigrateAsync(string subscriptionId, string resourceGroupName, CanMigrateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateCanMigrateRequest(subscriptionId, resourceGroupName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CanMigrateResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CanMigrateResult.DeserializeCanMigrateResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. + /// Azure Subscription ID. + /// Name of the Resource group within the Azure subscription. + /// Properties needed to check if cdn profile or classic frontdoor can be migrated. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response CanMigrate(string subscriptionId, string resourceGroupName, CanMigrateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateCanMigrateRequest(subscriptionId, resourceGroupName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CanMigrateResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CanMigrateResult.DeserializeCanMigrateResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateMigrateRequest(string subscriptionId, string resourceGroupName, MigrationContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Cdn/migrate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + /// Azure Subscription ID. + /// Name of the Resource group within the Azure subscription. + /// Properties needed to migrate the profile. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task MigrateAsync(string subscriptionId, string resourceGroupName, MigrationContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateMigrateRequest(subscriptionId, resourceGroupName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. + /// Azure Subscription ID. + /// Name of the Resource group within the Azure subscription. + /// Properties needed to migrate the profile. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Migrate(string subscriptionId, string resourceGroupName, MigrationContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateMigrateRequest(subscriptionId, resourceGroupName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateMigrationCommitRequest(string subscriptionId, string resourceGroupName, string profileName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Cdn/profiles/", false); + uri.AppendPath(profileName, true); + uri.AppendPath("/migrationCommit", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Commit the migrated Azure Frontdoor(Standard/Premium) profile. + /// Azure Subscription ID. + /// Name of the Resource group within the Azure subscription. + /// Name of the CDN profile which is unique within the resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task MigrationCommitAsync(string subscriptionId, string resourceGroupName, string profileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(profileName, nameof(profileName)); + + using var message = CreateMigrationCommitRequest(subscriptionId, resourceGroupName, profileName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Commit the migrated Azure Frontdoor(Standard/Premium) profile. + /// Azure Subscription ID. + /// Name of the Resource group within the Azure subscription. + /// Name of the CDN profile which is unique within the resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response MigrationCommit(string subscriptionId, string resourceGroupName, string profileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(profileName, nameof(profileName)); + + using var message = CreateMigrationCommitRequest(subscriptionId, resourceGroupName, profileName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateGenerateSsoUriRequest(string subscriptionId, string resourceGroupName, string profileName) { var message = _pipeline.CreateMessage(); diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/ResourceUsageRestOperations.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/ResourceUsageRestOperations.cs index 091cd1ccb0fc..b672e8f12a77 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/ResourceUsageRestOperations.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/RestOperations/ResourceUsageRestOperations.cs @@ -33,7 +33,7 @@ public ResourceUsageRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/autorest.md b/sdk/cdn/Azure.ResourceManager.Cdn/src/autorest.md index 404b36882e39..9e9e1cb3eb74 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/autorest.md +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/autorest.md @@ -7,7 +7,7 @@ azure-arm: true library-name: Cdn namespace: Azure.ResourceManager.Cdn title: CdnManagementClient -require: https://github.com/Azure/azure-rest-api-specs/blob/236c7ce93e9bcb875e1fbe1db8602a3a159ee2ae/specification/cdn/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/cdn/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true