internal static OnvifDeviceGetRequest DeserializeOnvifDeviceGetRequest(JsonElement element)
        {
            EndpointBase      endpoint   = default;
            string            methodName = default;
            Optional <string> apiVersion = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("endpoint"))
                {
                    endpoint = EndpointBase.DeserializeEndpointBase(property.Value);
                    continue;
                }
                if (property.NameEquals("methodName"))
                {
                    methodName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("@apiVersion"))
                {
                    apiVersion = property.Value.GetString();
                    continue;
                }
            }
            return(new OnvifDeviceGetRequest(methodName, apiVersion.Value, endpoint));
        }
コード例 #2
0
        public GrpcExtension(string name, IEnumerable <NodeInput> inputs, EndpointBase endpoint, ImageProperties image, GrpcExtensionDataTransfer dataTransfer) : base(name, inputs, endpoint, image)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (inputs == null)
            {
                throw new ArgumentNullException(nameof(inputs));
            }
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }
            if (image == null)
            {
                throw new ArgumentNullException(nameof(image));
            }
            if (dataTransfer == null)
            {
                throw new ArgumentNullException(nameof(dataTransfer));
            }

            DataTransfer = dataTransfer;
            Type         = "#Microsoft.VideoAnalyzer.GrpcExtension";
        }
コード例 #3
0
 internal ExtensionProcessorBase(string type, string name, IList <NodeInput> inputs, EndpointBase endpoint, ImageProperties image, SamplingOptions samplingOptions) : base(type, name, inputs)
 {
     Endpoint        = endpoint;
     Image           = image;
     SamplingOptions = samplingOptions;
     Type            = type ?? "#Microsoft.VideoAnalyzer.ExtensionProcessorBase";
 }
 internal CognitiveServicesVisionProcessor(string type, string name, IList <NodeInput> inputs, EndpointBase endpoint, ImageProperties image, SamplingOptions samplingOptions, SpatialAnalysisOperationBase operation) : base(type, name, inputs)
 {
     Endpoint        = endpoint;
     Image           = image;
     SamplingOptions = samplingOptions;
     Operation       = operation;
     Type            = type ?? "#Microsoft.VideoAnalyzer.CognitiveServicesVisionProcessor";
 }
コード例 #5
0
        public OnvifDeviceGetRequest(EndpointBase endpoint)
        {
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }

            Endpoint   = endpoint;
            MethodName = "onvifDeviceGet";
        }
コード例 #6
0
        internal static HttpExtension DeserializeHttpExtension(JsonElement element)
        {
            EndpointBase               endpoint        = default;
            ImageProperties            image           = default;
            Optional <SamplingOptions> samplingOptions = default;
            string            type   = default;
            string            name   = default;
            IList <NodeInput> inputs = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("endpoint"))
                {
                    endpoint = EndpointBase.DeserializeEndpointBase(property.Value);
                    continue;
                }
                if (property.NameEquals("image"))
                {
                    image = ImageProperties.DeserializeImageProperties(property.Value);
                    continue;
                }
                if (property.NameEquals("samplingOptions"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    samplingOptions = SamplingOptions.DeserializeSamplingOptions(property.Value);
                    continue;
                }
                if (property.NameEquals("@type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("inputs"))
                {
                    List <NodeInput> array = new List <NodeInput>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(NodeInput.DeserializeNodeInput(item));
                    }
                    inputs = array;
                    continue;
                }
            }
            return(new HttpExtension(type, name, inputs, endpoint, image, samplingOptions.Value));
        }
コード例 #7
0
        public RtspSource(string name, EndpointBase endpoint) : base(name)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }

            Endpoint = endpoint;
            Type     = "#Microsoft.VideoAnalyzer.RtspSource";
        }
コード例 #8
0
        public HttpExtension(string name, IEnumerable <NodeInput> inputs, EndpointBase endpoint, ImageProperties image) : base(name, inputs, endpoint, image)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (inputs == null)
            {
                throw new ArgumentNullException(nameof(inputs));
            }
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }
            if (image == null)
            {
                throw new ArgumentNullException(nameof(image));
            }

            Type = "#Microsoft.VideoAnalyzer.HttpExtension";
        }
        public CognitiveServicesVisionProcessor(string name, IEnumerable <NodeInput> inputs, EndpointBase endpoint, SpatialAnalysisOperationBase operation) : base(name, inputs)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (inputs == null)
            {
                throw new ArgumentNullException(nameof(inputs));
            }
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }
            if (operation == null)
            {
                throw new ArgumentNullException(nameof(operation));
            }

            Endpoint  = endpoint;
            Operation = operation;
            Type      = "#Microsoft.VideoAnalyzer.CognitiveServicesVisionProcessor";
        }
コード例 #10
0
        public ExtensionProcessorBase(string name, IEnumerable <NodeInput> inputs, EndpointBase endpoint, ImageProperties image) : base(name, inputs)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (inputs == null)
            {
                throw new ArgumentNullException(nameof(inputs));
            }
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }
            if (image == null)
            {
                throw new ArgumentNullException(nameof(image));
            }

            Endpoint = endpoint;
            Image    = image;
            Type     = "#Microsoft.VideoAnalyzer.ExtensionProcessorBase";
        }
コード例 #11
0
        internal static RtspSource DeserializeRtspSource(JsonElement element)
        {
            Optional <RtspTransport> transport = default;
            EndpointBase             endpoint  = default;
            string type = default;
            string name = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("transport"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    transport = new RtspTransport(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("endpoint"))
                {
                    endpoint = EndpointBase.DeserializeEndpointBase(property.Value);
                    continue;
                }
                if (property.NameEquals("@type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
            }
            return(new RtspSource(type, name, Optional.ToNullable(transport), endpoint));
        }
        internal static ExtensionProcessorBase DeserializeExtensionProcessorBase(JsonElement element)
        {
            if (element.TryGetProperty("@type", out JsonElement discriminator))
            {
                switch (discriminator.GetString())
                {
                case "#Microsoft.VideoAnalyzer.GrpcExtension": return(GrpcExtension.DeserializeGrpcExtension(element));

                case "#Microsoft.VideoAnalyzer.HttpExtension": return(HttpExtension.DeserializeHttpExtension(element));
                }
            }
            EndpointBase               endpoint        = default;
            ImageProperties            image           = default;
            Optional <SamplingOptions> samplingOptions = default;
            string            type   = default;
            string            name   = default;
            IList <NodeInput> inputs = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("endpoint"))
                {
                    endpoint = EndpointBase.DeserializeEndpointBase(property.Value);
                    continue;
                }
                if (property.NameEquals("image"))
                {
                    image = ImageProperties.DeserializeImageProperties(property.Value);
                    continue;
                }
                if (property.NameEquals("samplingOptions"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    samplingOptions = SamplingOptions.DeserializeSamplingOptions(property.Value);
                    continue;
                }
                if (property.NameEquals("@type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("inputs"))
                {
                    List <NodeInput> array = new List <NodeInput>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(NodeInput.DeserializeNodeInput(item));
                    }
                    inputs = array;
                    continue;
                }
            }
            return(new ExtensionProcessorBase(type, name, inputs, endpoint, image, samplingOptions.Value));
        }
コード例 #13
0
        internal static CognitiveServicesVisionProcessor DeserializeCognitiveServicesVisionProcessor(JsonElement element)
        {
            EndpointBase endpoint = default;
            Optional <ImageProperties>   image           = default;
            Optional <SamplingOptions>   samplingOptions = default;
            SpatialAnalysisOperationBase operation       = default;
            string            type   = default;
            string            name   = default;
            IList <NodeInput> inputs = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("endpoint"))
                {
                    endpoint = EndpointBase.DeserializeEndpointBase(property.Value);
                    continue;
                }
                if (property.NameEquals("image"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    image = ImageProperties.DeserializeImageProperties(property.Value);
                    continue;
                }
                if (property.NameEquals("samplingOptions"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    samplingOptions = SamplingOptions.DeserializeSamplingOptions(property.Value);
                    continue;
                }
                if (property.NameEquals("operation"))
                {
                    operation = SpatialAnalysisOperationBase.DeserializeSpatialAnalysisOperationBase(property.Value);
                    continue;
                }
                if (property.NameEquals("@type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("inputs"))
                {
                    List <NodeInput> array = new List <NodeInput>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(NodeInput.DeserializeNodeInput(item));
                    }
                    inputs = array;
                    continue;
                }
            }
            return(new CognitiveServicesVisionProcessor(type, name, inputs, endpoint, image.Value, samplingOptions.Value, operation));
        }
コード例 #14
0
 internal RtspSource(string type, string name, RtspTransport?transport, EndpointBase endpoint) : base(type, name)
 {
     Transport = transport;
     Endpoint  = endpoint;
     Type      = type ?? "#Microsoft.VideoAnalyzer.RtspSource";
 }
コード例 #15
0
 internal GrpcExtension(string type, string name, IList <NodeInput> inputs, EndpointBase endpoint, ImageProperties image, SamplingOptions samplingOptions, GrpcExtensionDataTransfer dataTransfer, string extensionConfiguration) : base(type, name, inputs, endpoint, image, samplingOptions)
 {
     DataTransfer           = dataTransfer;
     ExtensionConfiguration = extensionConfiguration;
     Type = type ?? "#Microsoft.VideoAnalyzer.GrpcExtension";
 }
コード例 #16
0
 internal OnvifDeviceGetRequest(string methodName, string apiVersion, EndpointBase endpoint) : base(methodName, apiVersion)
 {
     Endpoint   = endpoint;
     MethodName = methodName ?? "onvifDeviceGet";
 }
コード例 #17
0
 internal HttpExtension(string type, string name, IList <NodeInput> inputs, EndpointBase endpoint, ImageProperties image, SamplingOptions samplingOptions) : base(type, name, inputs, endpoint, image, samplingOptions)
 {
     Type = type ?? "#Microsoft.VideoAnalyzer.HttpExtension";
 }