Exemplo n.º 1
0
 internal RemoteDeviceAdapterSetRequestBody(string methodName, string apiVersion, string name, SystemData systemData, RemoteDeviceAdapterProperties properties) : base(methodName, apiVersion)
 {
     Name       = name;
     SystemData = systemData;
     Properties = properties;
     MethodName = methodName ?? "RemoteDeviceAdapterSetRequestBody";
 }
        internal static RemoteDeviceAdapterSetRequestBody DeserializeRemoteDeviceAdapterSetRequestBody(JsonElement element)
        {
            string name = default;
            Optional <SystemData> systemData = default;
            Optional <RemoteDeviceAdapterProperties> properties = default;
            string            methodName = default;
            Optional <string> apiVersion = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    systemData = SystemData.DeserializeSystemData(property.Value);
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    properties = RemoteDeviceAdapterProperties.DeserializeRemoteDeviceAdapterProperties(property.Value);
                    continue;
                }
                if (property.NameEquals("methodName"))
                {
                    methodName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("@apiVersion"))
                {
                    apiVersion = property.Value.GetString();
                    continue;
                }
            }
            return(new RemoteDeviceAdapterSetRequestBody(methodName, apiVersion.Value, name, systemData.Value, properties.Value));
        }
 internal RemoteDeviceAdapter(string name, SystemData systemData, RemoteDeviceAdapterProperties properties)
 {
     Name       = name;
     SystemData = systemData;
     Properties = properties;
 }