-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move feature operations to azure.resourcemanager.core #22570
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...esourcemanager/Azure.ResourceManager.Core/src/Custom/Models/ProviderInfo.Serialization.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
// <auto-generated/> | ||
|
||
#nullable disable | ||
|
||
using System.Collections.Generic; | ||
using System.Text.Json; | ||
using Azure.Core; | ||
|
||
namespace Azure.ResourceManager.Core | ||
{ | ||
public partial class ProviderInfo | ||
{ | ||
internal static ProviderInfo DeserializeProviderInfo(JsonElement element) | ||
{ | ||
Optional<string> @namespace = default; | ||
Optional<IReadOnlyList<ProviderResourceType>> resourceTypes = default; | ||
foreach (var property in element.EnumerateObject()) | ||
{ | ||
if (property.NameEquals("namespace")) | ||
{ | ||
@namespace = property.Value.GetString(); | ||
continue; | ||
} | ||
if (property.NameEquals("resourceTypes")) | ||
{ | ||
if (property.Value.ValueKind == JsonValueKind.Null) | ||
{ | ||
property.ThrowNonNullablePropertyIsNull(); | ||
continue; | ||
} | ||
List<ProviderResourceType> array = new List<ProviderResourceType>(); | ||
foreach (var item in property.Value.EnumerateArray()) | ||
{ | ||
array.Add(ProviderResourceType.DeserializeProviderResourceType(item)); | ||
} | ||
resourceTypes = array; | ||
continue; | ||
} | ||
} | ||
return new ProviderInfo(@namespace.Value, Optional.ToList(resourceTypes)); | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
sdk/resourcemanager/Azure.ResourceManager.Core/src/Custom/Models/ProviderInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
// <auto-generated/> | ||
|
||
#nullable disable | ||
|
||
using System.Collections.Generic; | ||
using Azure.Core; | ||
|
||
namespace Azure.ResourceManager.Core | ||
{ | ||
/// <summary> Resource provider information. </summary> | ||
public partial class ProviderInfo | ||
{ | ||
/// <summary> Initializes a new instance of Provider. </summary> | ||
internal ProviderInfo() | ||
{ | ||
ResourceTypes = new ChangeTrackingList<ProviderResourceType>(); | ||
} | ||
|
||
/// <summary> Initializes a new instance of Provider. </summary> | ||
/// <param name="namespace"> The namespace of the resource provider. </param> | ||
/// <param name="resourceTypes"> The collection of provider resource types. </param> | ||
internal ProviderInfo(string @namespace, IReadOnlyList<ProviderResourceType> resourceTypes) | ||
{ | ||
Namespace = @namespace; | ||
ResourceTypes = resourceTypes; | ||
} | ||
|
||
/// <summary> The namespace of the resource provider. </summary> | ||
public string Namespace { get; } | ||
/// <summary> The collection of provider resource types. </summary> | ||
public IReadOnlyList<ProviderResourceType> ResourceTypes { get; } | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...ager/Azure.ResourceManager.Core/src/Custom/Models/ProviderInfoListResult.Serialization.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
// <auto-generated/> | ||
|
||
#nullable disable | ||
|
||
using System.Collections.Generic; | ||
using System.Text.Json; | ||
using Azure.Core; | ||
|
||
namespace Azure.ResourceManager.Core | ||
{ | ||
internal partial class ProviderInfoListResult | ||
{ | ||
internal static ProviderInfoListResult DeserializeProviderInfoListResult(JsonElement element) | ||
{ | ||
Optional<IReadOnlyList<ProviderInfo>> value = default; | ||
Optional<string> nextLink = default; | ||
foreach (var property in element.EnumerateObject()) | ||
{ | ||
if (property.NameEquals("value")) | ||
{ | ||
if (property.Value.ValueKind == JsonValueKind.Null) | ||
{ | ||
property.ThrowNonNullablePropertyIsNull(); | ||
continue; | ||
} | ||
List<ProviderInfo> array = new List<ProviderInfo>(); | ||
foreach (var item in property.Value.EnumerateArray()) | ||
{ | ||
array.Add(ProviderInfo.DeserializeProviderInfo(item)); | ||
} | ||
value = array; | ||
continue; | ||
} | ||
if (property.NameEquals("nextLink")) | ||
{ | ||
nextLink = property.Value.GetString(); | ||
continue; | ||
} | ||
} | ||
return new ProviderInfoListResult(Optional.ToList(value), nextLink.Value); | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
sdk/resourcemanager/Azure.ResourceManager.Core/src/Custom/Models/ProviderInfoListResult.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
// <auto-generated/> | ||
|
||
#nullable disable | ||
|
||
using System.Collections.Generic; | ||
using Azure.Core; | ||
|
||
namespace Azure.ResourceManager.Core | ||
{ | ||
/// <summary> List of resource providers. </summary> | ||
internal partial class ProviderInfoListResult | ||
{ | ||
/// <summary> Initializes a new instance of ProviderInfoListResult. </summary> | ||
internal ProviderInfoListResult() | ||
{ | ||
Value = new ChangeTrackingList<ProviderInfo>(); | ||
} | ||
|
||
/// <summary> Initializes a new instance of ProviderInfoListResult. </summary> | ||
/// <param name="value"> An array of resource providers. </param> | ||
/// <param name="nextLink"> The URL to use for getting the next set of results. </param> | ||
internal ProviderInfoListResult(IReadOnlyList<ProviderInfo> value, string nextLink) | ||
{ | ||
Value = value; | ||
NextLink = nextLink; | ||
} | ||
|
||
/// <summary> An array of resource providers. </summary> | ||
public IReadOnlyList<ProviderInfo> Value { get; } | ||
/// <summary> The URL to use for getting the next set of results. </summary> | ||
public string NextLink { get; } | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove
// <auto-generated/>
fromProviderInfo
andProviderInfoListResult