forked from Azure/azure-powershell
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathPrivateEndpoint.json.cs
More file actions
111 lines (97 loc) · 6.69 KB
/
PrivateEndpoint.json.cs
File metadata and controls
111 lines (97 loc) · 6.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
namespace Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20
{
using static Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Extensions;
/// <summary>The Private Endpoint resource.</summary>
public partial class PrivateEndpoint
{
/// <summary>
/// <c>AfterFromJson</c> will be called after the json deserialization has finished, allowing customization of the object
/// before it is returned. Implement this method in a partial class to enable this behavior
/// </summary>
/// <param name="json">The JsonNode that should be deserialized into this object.</param>
partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json);
/// <summary>
/// <c>AfterToJson</c> will be called after the json serialization has finished, allowing customization of the <see cref="Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject"
/// /> before it is returned. Implement this method in a partial class to enable this behavior
/// </summary>
/// <param name="container">The JSON container that the serialization result will be placed in.</param>
partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container);
/// <summary>
/// <c>BeforeFromJson</c> will be called before the json deserialization has commenced, allowing complete customization of
/// the object before it is deserialized.
/// If you wish to disable the default deserialization entirely, return <c>true</c> in the <paramref name= "returnNow" />
/// output parameter.
/// Implement this method in a partial class to enable this behavior.
/// </summary>
/// <param name="json">The JsonNode that should be deserialized into this object.</param>
/// <param name="returnNow">Determines if the rest of the deserialization should be processed, or if the method should return
/// instantly.</param>
partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json, ref bool returnNow);
/// <summary>
/// <c>BeforeToJson</c> will be called before the json serialization has commenced, allowing complete customization of the
/// object before it is serialized.
/// If you wish to disable the default serialization entirely, return <c>true</c> in the <paramref name="returnNow" /> output
/// parameter.
/// Implement this method in a partial class to enable this behavior.
/// </summary>
/// <param name="container">The JSON container that the serialization result will be placed in.</param>
/// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return
/// instantly.</param>
partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, ref bool returnNow);
/// <summary>
/// Deserializes a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode"/> into an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpoint.
/// </summary>
/// <param name="node">a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode" /> to deserialize from.</param>
/// <returns>
/// an instance of Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpoint.
/// </returns>
public static Microsoft.Azure.PowerShell.Cmdlets.Api.Models.Api20.IPrivateEndpoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode node)
{
return node is Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json ? new PrivateEndpoint(json) : null;
}
/// <summary>
/// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject into a new instance of <see cref="PrivateEndpoint" />.
/// </summary>
/// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject instance to deserialize from.</param>
internal PrivateEndpoint(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject json)
{
bool returnNow = false;
BeforeFromJson(json, ref returnNow);
if (returnNow)
{
return;
}
{_id = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString>("id"), out var __jsonId) ? (string)__jsonId : (string)Id;}
AfterFromJson(json);
}
/// <summary>
/// Serializes this instance of <see cref="PrivateEndpoint" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode" />.
/// </summary>
/// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
/// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
/// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode"/>.</param>
/// <returns>
/// a serialized instance of <see cref="PrivateEndpoint" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode" />.
/// </returns>
public Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode serializationMode)
{
container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonObject();
bool returnNow = false;
BeforeToJson(ref container, ref returnNow);
if (returnNow)
{
return container;
}
if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.SerializationMode.IncludeReadOnly))
{
AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Api.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add );
}
AfterToJson(ref container);
return container;
}
}
}