-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
VMExtensionInstanceView.cs
146 lines (123 loc) · 5.41 KB
/
VMExtensionInstanceView.cs
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// 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.
//
// This file was autogenerated by a tool.
// Do not modify it.
//
namespace Microsoft.Azure.Batch
{
using Models = Microsoft.Azure.Batch.Protocol.Models;
using System;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The vm extension instance view.
/// </summary>
public partial class VMExtensionInstanceView : ITransportObjectProvider<Models.VMExtensionInstanceView>, IPropertyMetadata
{
private class PropertyContainer : PropertyCollection
{
public readonly PropertyAccessor<string> NameProperty;
public readonly PropertyAccessor<IList<InstanceViewStatus>> StatusesProperty;
public readonly PropertyAccessor<IList<InstanceViewStatus>> SubStatusesProperty;
public PropertyContainer() : base(BindingState.Unbound)
{
this.NameProperty = this.CreatePropertyAccessor<string>(nameof(Name), BindingAccess.Read | BindingAccess.Write);
this.StatusesProperty = this.CreatePropertyAccessor<IList<InstanceViewStatus>>(nameof(Statuses), BindingAccess.Read | BindingAccess.Write);
this.SubStatusesProperty = this.CreatePropertyAccessor<IList<InstanceViewStatus>>(nameof(SubStatuses), BindingAccess.Read | BindingAccess.Write);
}
public PropertyContainer(Models.VMExtensionInstanceView protocolObject) : base(BindingState.Bound)
{
this.NameProperty = this.CreatePropertyAccessor(
protocolObject.Name,
nameof(Name),
BindingAccess.Read);
this.StatusesProperty = this.CreatePropertyAccessor(
InstanceViewStatus.ConvertFromProtocolCollectionAndFreeze(protocolObject.Statuses),
nameof(Statuses),
BindingAccess.Read);
this.SubStatusesProperty = this.CreatePropertyAccessor(
InstanceViewStatus.ConvertFromProtocolCollectionAndFreeze(protocolObject.SubStatuses),
nameof(SubStatuses),
BindingAccess.Read);
}
}
private readonly PropertyContainer propertyContainer;
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="VMExtensionInstanceView"/> class.
/// </summary>
public VMExtensionInstanceView()
{
this.propertyContainer = new PropertyContainer();
}
internal VMExtensionInstanceView(Models.VMExtensionInstanceView protocolObject)
{
this.propertyContainer = new PropertyContainer(protocolObject);
}
#endregion Constructors
#region VMExtensionInstanceView
/// <summary>
/// Gets or sets the name of the vm extension instance view.
/// </summary>
public string Name
{
get { return this.propertyContainer.NameProperty.Value; }
set { this.propertyContainer.NameProperty.Value = value; }
}
/// <summary>
/// Gets or sets the resource status information.
/// </summary>
public IList<InstanceViewStatus> Statuses
{
get { return this.propertyContainer.StatusesProperty.Value; }
set
{
this.propertyContainer.StatusesProperty.Value = ConcurrentChangeTrackedModifiableList<InstanceViewStatus>.TransformEnumerableToConcurrentModifiableList(value);
}
}
/// <summary>
/// Gets or sets the resource substatus information.
/// </summary>
public IList<InstanceViewStatus> SubStatuses
{
get { return this.propertyContainer.SubStatusesProperty.Value; }
set
{
this.propertyContainer.SubStatusesProperty.Value = ConcurrentChangeTrackedModifiableList<InstanceViewStatus>.TransformEnumerableToConcurrentModifiableList(value);
}
}
#endregion // VMExtensionInstanceView
#region IPropertyMetadata
bool IModifiable.HasBeenModified
{
get { return this.propertyContainer.HasBeenModified; }
}
bool IReadOnly.IsReadOnly
{
get { return this.propertyContainer.IsReadOnly; }
set { this.propertyContainer.IsReadOnly = value; }
}
#endregion //IPropertyMetadata
#region Internal/private methods
/// <summary>
/// Return a protocol object of the requested type.
/// </summary>
/// <returns>The protocol object of the requested type.</returns>
Models.VMExtensionInstanceView ITransportObjectProvider<Models.VMExtensionInstanceView>.GetTransportObject()
{
Models.VMExtensionInstanceView result = new Models.VMExtensionInstanceView()
{
Name = this.Name,
Statuses = UtilitiesInternal.ConvertToProtocolCollection(this.Statuses),
SubStatuses = UtilitiesInternal.ConvertToProtocolCollection(this.SubStatuses),
};
return result;
}
#endregion // Internal/private methods
}
}