コード例 #1
0
        /// <summary>
        ///  Gets the Payload from the request result.
        /// </summary>
        /// <returns>A string containing the Payload. </returns>
        public override string GetPayloadAsJson()
        {
            var pipelineTopologyBody = new PipelineTopologySetRequestBody(PipelineTopology.Name)
            {
                SystemData = PipelineTopology.SystemData,
                Properties = PipelineTopology.Properties
            };

            return(pipelineTopologyBody.GetPayloadAsJson());
        }
        internal static MethodRequest DeserializeMethodRequest(JsonElement element)
        {
            if (element.TryGetProperty("methodName", out JsonElement discriminator))
            {
                switch (discriminator.GetString())
                {
                case "MethodRequestEmptyBodyBase": return(MethodRequestEmptyBodyBase.DeserializeMethodRequestEmptyBodyBase(element));

                case "PipelineTopologySetRequestBody": return(PipelineTopologySetRequestBody.DeserializePipelineTopologySetRequestBody(element));

                case "livePipelineActivate": return(LivePipelineActivateRequest.DeserializeLivePipelineActivateRequest(element));

                case "livePipelineDeactivate": return(LivePipelineDeactivateRequest.DeserializeLivePipelineDeactivateRequest(element));

                case "livePipelineDelete": return(LivePipelineDeleteRequest.DeserializeLivePipelineDeleteRequest(element));

                case "livePipelineGet": return(LivePipelineGetRequest.DeserializeLivePipelineGetRequest(element));

                case "livePipelineList": return(LivePipelineListRequest.DeserializeLivePipelineListRequest(element));

                case "livePipelineSet": return(LivePipelineSetRequest.DeserializeLivePipelineSetRequest(element));

                case "pipelineTopologyDelete": return(PipelineTopologyDeleteRequest.DeserializePipelineTopologyDeleteRequest(element));

                case "pipelineTopologyGet": return(PipelineTopologyGetRequest.DeserializePipelineTopologyGetRequest(element));

                case "pipelineTopologyList": return(PipelineTopologyListRequest.DeserializePipelineTopologyListRequest(element));

                case "pipelineTopologySet": return(PipelineTopologySetRequest.DeserializePipelineTopologySetRequest(element));

                case "LivePipelineSetRequestBody": return(LivePipelineSetRequestBody.DeserializeLivePipelineSetRequestBody(element));
                }
            }
            string            methodName = default;
            Optional <string> apiVersion = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("methodName"))
                {
                    methodName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("@apiVersion"))
                {
                    apiVersion = property.Value.GetString();
                    continue;
                }
            }
            return(new MethodRequest(methodName, apiVersion.Value));
        }