| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. See License.txt in the project root for license information. |
| | 3 | | // |
| | 4 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | 5 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | 6 | | // regenerated. |
| | 7 | |
|
| | 8 | | // |
| | 9 | | // This file was autogenerated by a tool. |
| | 10 | | // Do not modify it. |
| | 11 | | // |
| | 12 | |
|
| | 13 | | namespace Microsoft.Azure.Batch |
| | 14 | | { |
| | 15 | | using Models = Microsoft.Azure.Batch.Protocol.Models; |
| | 16 | | using System; |
| | 17 | | using System.Collections.Generic; |
| | 18 | | using System.Linq; |
| | 19 | |
|
| | 20 | | /// <summary> |
| | 21 | | /// A specification for uploading files from an Azure Batch node to another location after the Batch service has fin |
| | 22 | | /// executing the task process. |
| | 23 | | /// </summary> |
| | 24 | | public partial class OutputFile : ITransportObjectProvider<Models.OutputFile>, IPropertyMetadata |
| | 25 | | { |
| | 26 | | #region Constructors |
| | 27 | | /// <summary> |
| | 28 | | /// Initializes a new instance of the <see cref="OutputFile"/> class. |
| | 29 | | /// </summary> |
| | 30 | | /// <param name='filePattern'>A pattern indicating which file(s) to upload.</param> |
| | 31 | | /// <param name='destination'>The destination for the output file(s).</param> |
| | 32 | | /// <param name='uploadOptions'>Additional options for the upload operation, including under what conditions to |
| 798 | 33 | | public OutputFile( |
| 798 | 34 | | string filePattern, |
| 798 | 35 | | OutputFileDestination destination, |
| 798 | 36 | | OutputFileUploadOptions uploadOptions) |
| | 37 | | { |
| 798 | 38 | | this.FilePattern = filePattern; |
| 798 | 39 | | this.Destination = destination; |
| 798 | 40 | | this.UploadOptions = uploadOptions; |
| 798 | 41 | | } |
| | 42 | |
|
| 3811 | 43 | | internal OutputFile(Models.OutputFile protocolObject) |
| | 44 | | { |
| 5776 | 45 | | this.Destination = UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.Destination, o => new OutputFi |
| 3811 | 46 | | this.FilePattern = protocolObject.FilePattern; |
| 5692 | 47 | | this.UploadOptions = UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.UploadOptions, o => new Outp |
| 3811 | 48 | | } |
| | 49 | |
|
| | 50 | | #endregion Constructors |
| | 51 | |
|
| | 52 | | #region OutputFile |
| | 53 | |
|
| | 54 | | /// <summary> |
| | 55 | | /// Gets the destination for the output file(s). |
| | 56 | | /// </summary> |
| 5406 | 57 | | public OutputFileDestination Destination { get; } |
| | 58 | |
|
| | 59 | | /// <summary> |
| | 60 | | /// Gets a pattern indicating which file(s) to upload. |
| | 61 | | /// </summary> |
| | 62 | | /// <remarks> |
| | 63 | | /// <para>Both relative and absolute paths are supported. Relative paths are relative to the Task working direct |
| | 64 | | /// following wildcards are supported: * matches 0 or more characters (for example pattern abc* would match abc |
| | 65 | | /// abcdef), ** matches any directory, ? matches any single character, [abc] matches one character in the bracke |
| | 66 | | /// and [a-c] matches one character in the range.</para><para>Brackets can include a negation to match any chara |
| | 67 | | /// not specified (for example [!abc] matches any character but a, b, or c).</para><para>If a file name starts w |
| | 68 | | /// "." it is ignored by default but may be matched by specifying it explicitly (for example *.gif will not matc |
| | 69 | | /// .a.gif, but .*.gif will). A simple example: **\*.txt matches any file that does not start in '.' and ends wi |
| | 70 | | /// .txt in the Task working directory or any subdirectory.</para><para>If the filename contains a wildcard char |
| | 71 | | /// it can be escaped using brackets (for example abc[*] would match a file named abc*).</para><para>Note that b |
| | 72 | | /// \ and / are treated as directory separators on Windows, but only / is on Linux.</para><para>Environment vari |
| | 73 | | /// (%var% on Windows or $var on Linux) are expanded prior to the pattern being applied.</para> |
| | 74 | | /// </remarks> |
| 5406 | 75 | | public string FilePattern { get; } |
| | 76 | |
|
| | 77 | | /// <summary> |
| | 78 | | /// Gets additional options for the upload operation, including under what conditions to perform the upload. |
| | 79 | | /// </summary> |
| 5406 | 80 | | public OutputFileUploadOptions UploadOptions { get; } |
| | 81 | |
|
| | 82 | | #endregion // OutputFile |
| | 83 | |
|
| | 84 | | #region IPropertyMetadata |
| | 85 | |
|
| | 86 | | bool IModifiable.HasBeenModified |
| | 87 | | { |
| | 88 | | //This class is compile time readonly so it cannot have been modified |
| 0 | 89 | | get { return false; } |
| | 90 | | } |
| | 91 | |
|
| | 92 | | bool IReadOnly.IsReadOnly |
| | 93 | | { |
| 0 | 94 | | get { return true; } |
| | 95 | | set |
| | 96 | | { |
| | 97 | | // This class is compile time readonly already |
| 10067 | 98 | | } |
| | 99 | | } |
| | 100 | |
|
| | 101 | | #endregion // IPropertyMetadata |
| | 102 | |
|
| | 103 | | #region Internal/private methods |
| | 104 | |
|
| | 105 | | /// <summary> |
| | 106 | | /// Return a protocol object of the requested type. |
| | 107 | | /// </summary> |
| | 108 | | /// <returns>The protocol object of the requested type.</returns> |
| | 109 | | Models.OutputFile ITransportObjectProvider<Models.OutputFile>.GetTransportObject() |
| | 110 | | { |
| 797 | 111 | | Models.OutputFile result = new Models.OutputFile() |
| 797 | 112 | | { |
| 1594 | 113 | | Destination = UtilitiesInternal.CreateObjectWithNullCheck(this.Destination, (o) => o.GetTransportObject( |
| 797 | 114 | | FilePattern = this.FilePattern, |
| 1594 | 115 | | UploadOptions = UtilitiesInternal.CreateObjectWithNullCheck(this.UploadOptions, (o) => o.GetTransportObj |
| 797 | 116 | | }; |
| | 117 | |
|
| 797 | 118 | | return result; |
| | 119 | | } |
| | 120 | |
|
| | 121 | | /// <summary> |
| | 122 | | /// Converts a collection of protocol layer objects to object layer collection objects. |
| | 123 | | /// </summary> |
| | 124 | | internal static IList<OutputFile> ConvertFromProtocolCollection(IEnumerable<Models.OutputFile> protoCollection) |
| | 125 | | { |
| 714 | 126 | | ConcurrentChangeTrackedModifiableList<OutputFile> converted = UtilitiesInternal.CollectionToThreadSafeCollec |
| 714 | 127 | | items: protoCollection, |
| 2339 | 128 | | objectCreationFunc: o => new OutputFile(o)); |
| | 129 | |
|
| 714 | 130 | | return converted; |
| | 131 | | } |
| | 132 | |
|
| | 133 | | /// <summary> |
| | 134 | | /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state. |
| | 135 | | /// </summary> |
| | 136 | | internal static IList<OutputFile> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.OutputFile> protoCol |
| | 137 | | { |
| 1021 | 138 | | ConcurrentChangeTrackedModifiableList<OutputFile> converted = UtilitiesInternal.CollectionToThreadSafeCollec |
| 1021 | 139 | | items: protoCollection, |
| 3207 | 140 | | objectCreationFunc: o => new OutputFile(o).Freeze()); |
| | 141 | |
|
| 1522 | 142 | | converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze()); |
| | 143 | |
|
| 1021 | 144 | | return converted; |
| | 145 | | } |
| | 146 | |
|
| | 147 | | /// <summary> |
| | 148 | | /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked |
| | 149 | | /// and returned as a readonly collection. |
| | 150 | | /// </summary> |
| | 151 | | internal static IReadOnlyList<OutputFile> ConvertFromProtocolCollectionReadOnly(IEnumerable<Models.OutputFile> p |
| | 152 | | { |
| 0 | 153 | | IReadOnlyList<OutputFile> converted = |
| 0 | 154 | | UtilitiesInternal.CreateObjectWithNullCheck( |
| 0 | 155 | | UtilitiesInternal.CollectionToNonThreadSafeCollection( |
| 0 | 156 | | items: protoCollection, |
| 0 | 157 | | objectCreationFunc: o => new OutputFile(o).Freeze()), o => o.AsReadOnly()); |
| | 158 | |
|
| 0 | 159 | | return converted; |
| | 160 | | } |
| | 161 | |
|
| | 162 | | #endregion // Internal/private methods |
| | 163 | | } |
| | 164 | | } |