Beispiel #1
0
        internal static OutputFile DeserializeOutputFile(JsonElement element)
        {
            string filePattern = default;
            OutputFileDestination   destination   = default;
            OutputFileUploadOptions uploadOptions = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("filePattern"))
                {
                    filePattern = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("destination"))
                {
                    destination = OutputFileDestination.DeserializeOutputFileDestination(property.Value);
                    continue;
                }
                if (property.NameEquals("uploadOptions"))
                {
                    uploadOptions = OutputFileUploadOptions.DeserializeOutputFileUploadOptions(property.Value);
                    continue;
                }
            }
            return(new OutputFile(filePattern, destination, uploadOptions));
        }
Beispiel #2
0
        public OutputFile(string filePattern, OutputFileDestination destination, OutputFileUploadOptions uploadOptions)
        {
            if (filePattern == null)
            {
                throw new ArgumentNullException(nameof(filePattern));
            }
            if (destination == null)
            {
                throw new ArgumentNullException(nameof(destination));
            }
            if (uploadOptions == null)
            {
                throw new ArgumentNullException(nameof(uploadOptions));
            }

            FilePattern   = filePattern;
            Destination   = destination;
            UploadOptions = uploadOptions;
        }