| | 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 | | /// The container settings for a task. |
| | 22 | | /// </summary> |
| | 23 | | public partial class TaskContainerSettings : ITransportObjectProvider<Models.TaskContainerSettings>, IPropertyMetada |
| | 24 | | { |
| | 25 | | #region Constructors |
| | 26 | | /// <summary> |
| | 27 | | /// Initializes a new instance of the <see cref="TaskContainerSettings"/> class. |
| | 28 | | /// </summary> |
| | 29 | | /// <param name='imageName'>The image to use to create the container in which the task will run.</param> |
| | 30 | | /// <param name='containerRunOptions'>Additional options to the container create command.</param> |
| | 31 | | /// <param name='registry'>The private registry which contains the container image.</param> |
| | 32 | | /// <param name='workingDirectory'>The location of the container task working directory.</param> |
| 582 | 33 | | public TaskContainerSettings( |
| 582 | 34 | | string imageName, |
| 582 | 35 | | string containerRunOptions = default(string), |
| 582 | 36 | | ContainerRegistry registry = default(ContainerRegistry), |
| 582 | 37 | | Common.ContainerWorkingDirectory? workingDirectory = default(Common.ContainerWorkingDirectory?)) |
| | 38 | | { |
| 582 | 39 | | this.ImageName = imageName; |
| 582 | 40 | | this.ContainerRunOptions = containerRunOptions; |
| 582 | 41 | | this.Registry = registry; |
| 582 | 42 | | this.WorkingDirectory = workingDirectory; |
| 582 | 43 | | } |
| | 44 | |
|
| 2141 | 45 | | internal TaskContainerSettings(Models.TaskContainerSettings protocolObject) |
| | 46 | | { |
| 2141 | 47 | | this.ContainerRunOptions = protocolObject.ContainerRunOptions; |
| 2141 | 48 | | this.ImageName = protocolObject.ImageName; |
| 3207 | 49 | | this.Registry = UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.Registry, o => new ContainerRegis |
| 2141 | 50 | | this.WorkingDirectory = UtilitiesInternal.MapNullableEnum<Models.ContainerWorkingDirectory, Common.Container |
| 2141 | 51 | | } |
| | 52 | |
|
| | 53 | | #endregion Constructors |
| | 54 | |
|
| | 55 | | #region TaskContainerSettings |
| | 56 | |
|
| | 57 | | /// <summary> |
| | 58 | | /// Gets additional options to the container create command. |
| | 59 | | /// </summary> |
| | 60 | | /// <remarks> |
| | 61 | | /// These additional options are supplied as arguments to the "docker create" command, in addition to those cont |
| | 62 | | /// by the Batch Service. |
| | 63 | | /// </remarks> |
| 3302 | 64 | | public string ContainerRunOptions { get; } |
| | 65 | |
|
| | 66 | | /// <summary> |
| | 67 | | /// Gets the image to use to create the container in which the task will run. |
| | 68 | | /// </summary> |
| | 69 | | /// <remarks> |
| | 70 | | /// This is the full image reference, as would be specified to "docker pull". If no tag is provided as part of t |
| | 71 | | /// image name, the tag ":latest" is used as a default. |
| | 72 | | /// </remarks> |
| 3302 | 73 | | public string ImageName { get; } |
| | 74 | |
|
| | 75 | | /// <summary> |
| | 76 | | /// Gets the private registry which contains the container image. |
| | 77 | | /// </summary> |
| | 78 | | /// <remarks> |
| | 79 | | /// This setting can be omitted if was already provided at pool creation. |
| | 80 | | /// </remarks> |
| 3302 | 81 | | public ContainerRegistry Registry { get; } |
| | 82 | |
|
| | 83 | | /// <summary> |
| | 84 | | /// Gets the location of the container task working directory. |
| | 85 | | /// </summary> |
| | 86 | | /// <remarks> |
| | 87 | | /// If not specified, the default is <see cref="Common.ContainerWorkingDirectory.TaskWorkingDirectory"/>. |
| | 88 | | /// </remarks> |
| 3302 | 89 | | public Common.ContainerWorkingDirectory? WorkingDirectory { get; } |
| | 90 | |
|
| | 91 | | #endregion // TaskContainerSettings |
| | 92 | |
|
| | 93 | | #region IPropertyMetadata |
| | 94 | |
|
| | 95 | | bool IModifiable.HasBeenModified |
| | 96 | | { |
| | 97 | | //This class is compile time readonly so it cannot have been modified |
| 0 | 98 | | get { return false; } |
| | 99 | | } |
| | 100 | |
|
| | 101 | | bool IReadOnly.IsReadOnly |
| | 102 | | { |
| 0 | 103 | | get { return true; } |
| | 104 | | set |
| | 105 | | { |
| | 106 | | // This class is compile time readonly already |
| 3145 | 107 | | } |
| | 108 | | } |
| | 109 | |
|
| | 110 | | #endregion // IPropertyMetadata |
| | 111 | |
|
| | 112 | | #region Internal/private methods |
| | 113 | |
|
| | 114 | | /// <summary> |
| | 115 | | /// Return a protocol object of the requested type. |
| | 116 | | /// </summary> |
| | 117 | | /// <returns>The protocol object of the requested type.</returns> |
| | 118 | | Models.TaskContainerSettings ITransportObjectProvider<Models.TaskContainerSettings>.GetTransportObject() |
| | 119 | | { |
| 580 | 120 | | Models.TaskContainerSettings result = new Models.TaskContainerSettings() |
| 580 | 121 | | { |
| 580 | 122 | | ContainerRunOptions = this.ContainerRunOptions, |
| 580 | 123 | | ImageName = this.ImageName, |
| 1160 | 124 | | Registry = UtilitiesInternal.CreateObjectWithNullCheck(this.Registry, (o) => o.GetTransportObject()), |
| 580 | 125 | | WorkingDirectory = UtilitiesInternal.MapNullableEnum<Common.ContainerWorkingDirectory, Models.ContainerW |
| 580 | 126 | | }; |
| | 127 | |
|
| 580 | 128 | | return result; |
| | 129 | | } |
| | 130 | |
|
| | 131 | |
|
| | 132 | | #endregion // Internal/private methods |
| | 133 | | } |
| | 134 | | } |