internal static LivePipelineCollection DeserializeLivePipelineCollection(JsonElement element)
        {
            Optional <IList <LivePipeline> > value = default;
            Optional <string> continuationToken    = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <LivePipeline> array = new List <LivePipeline>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(LivePipeline.DeserializeLivePipeline(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("@continuationToken"))
                {
                    continuationToken = property.Value.GetString();
                    continue;
                }
            }
            return(new LivePipelineCollection(Optional.ToList(value), continuationToken.Value));
        }
Ejemplo n.º 2
0
        internal static LivePipelineSetRequest DeserializeLivePipelineSetRequest(JsonElement element)
        {
            LivePipeline      livePipeline = default;
            string            methodName   = default;
            Optional <string> apiVersion   = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("livePipeline"))
                {
                    livePipeline = LivePipeline.DeserializeLivePipeline(property.Value);
                    continue;
                }
                if (property.NameEquals("methodName"))
                {
                    methodName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("@apiVersion"))
                {
                    apiVersion = property.Value.GetString();
                    continue;
                }
            }
            return(new LivePipelineSetRequest(methodName, apiVersion.Value, livePipeline));
        }
        public LivePipelineSetRequest(LivePipeline livePipeline)
        {
            if (livePipeline == null)
            {
                throw new ArgumentNullException(nameof(livePipeline));
            }

            LivePipeline = livePipeline;
            MethodName   = "livePipelineSet";
        }
 internal LivePipelineSetRequest(string methodName, string apiVersion, LivePipeline livePipeline) : base(methodName, apiVersion)
 {
     LivePipeline = livePipeline;
     MethodName   = methodName ?? "livePipelineSet";
 }