/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

'use strict';

/**
 * Describes a container and its runtime properties.
 *
 */
class ContainerCodePackageProperties {
  /**
   * Create a ContainerCodePackageProperties.
   * @property {string} name The name of the code package.
   * @property {string} image The Container image to use.
   * @property {object} [imageRegistryCredential] Image registry credential.
   * @property {string} [imageRegistryCredential.server] Docker image registry
   * server, without protocol such as `http` and `https`.
   * @property {string} [imageRegistryCredential.username] The username for the
   * private registry.
   * @property {string} [imageRegistryCredential.password] The password for the
   * private registry. The password is required for create or update
   * operations, however it is not returned in the get or list operations.
   * @property {string} [entrypoint] Override for the default entry point in
   * the container.
   * @property {array} [commands] Command array to execute within the container
   * in exec form.
   * @property {array} [environmentVariables] The environment variables to set
   * in this container
   * @property {array} [settings] The settings to set in this container. The
   * setting file path can be fetched from environment variable
   * "Fabric_SettingPath". The path for Windows container is "C:\\secrets". The
   * path for Linux container is "/var/secrets".
   * @property {array} [labels] The labels to set in this container.
   * @property {array} [endpoints] The endpoints exposed by this container.
   * @property {object} resources The resources required by this container.
   * @property {object} [resources.requests] Describes the requested resources
   * for a given container.
   * @property {number} [resources.requests.memoryInGB] The memory request in
   * GB for this container.
   * @property {number} [resources.requests.cpu] Requested number of CPU cores.
   * At present, only full cores are supported.
   * @property {object} [resources.limits] Describes the maximum limits on the
   * resources for a given container.
   * @property {number} [resources.limits.memoryInGB] The memory limit in GB.
   * @property {number} [resources.limits.cpu] CPU limits in cores. At present,
   * only full cores are supported.
   * @property {array} [volumeRefs] Volumes to be attached to the container.
   * The lifetime of these volumes is independent of the application's
   * lifetime.
   * @property {array} [volumes] Volumes to be attached to the container. The
   * lifetime of these volumes is scoped to the application's lifetime.
   * @property {object} [diagnostics] Reference to sinks in
   * DiagnosticsDescription.
   * @property {boolean} [diagnostics.enabled] Status of whether or not sinks
   * are enabled.
   * @property {array} [diagnostics.sinkRefs] List of sinks to be used if
   * enabled. References the list of sinks in DiagnosticsDescription.
   * @property {array} [reliableCollectionsRefs] A list of ReliableCollection
   * resources used by this particular code package. Please refer to
   * ReliablecollectionsRef for more details.
   * @property {object} [instanceView] Runtime information of a container
   * instance.
   * @property {number} [instanceView.restartCount] The number of times the
   * container has been restarted.
   * @property {object} [instanceView.currentState] Current container instance
   * state.
   * @property {string} [instanceView.currentState.state] The state of this
   * container
   * @property {date} [instanceView.currentState.startTime] Date/time when the
   * container state started.
   * @property {string} [instanceView.currentState.exitCode] The container exit
   * code.
   * @property {date} [instanceView.currentState.finishTime] Date/time when the
   * container state finished.
   * @property {string} [instanceView.currentState.detailStatus] Human-readable
   * status of this state.
   * @property {object} [instanceView.previousState] Previous container
   * instance state.
   * @property {string} [instanceView.previousState.state] The state of this
   * container
   * @property {date} [instanceView.previousState.startTime] Date/time when the
   * container state started.
   * @property {string} [instanceView.previousState.exitCode] The container
   * exit code.
   * @property {date} [instanceView.previousState.finishTime] Date/time when
   * the container state finished.
   * @property {string} [instanceView.previousState.detailStatus]
   * Human-readable status of this state.
   * @property {array} [instanceView.events] The events of this container
   * instance.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ContainerCodePackageProperties
   *
   * @returns {object} metadata of ContainerCodePackageProperties
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ContainerCodePackageProperties',
      type: {
        name: 'Composite',
        className: 'ContainerCodePackageProperties',
        modelProperties: {
          name: {
            required: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          image: {
            required: true,
            serializedName: 'image',
            type: {
              name: 'String'
            }
          },
          imageRegistryCredential: {
            required: false,
            serializedName: 'imageRegistryCredential',
            type: {
              name: 'Composite',
              className: 'ImageRegistryCredential'
            }
          },
          entrypoint: {
            required: false,
            serializedName: 'entrypoint',
            type: {
              name: 'String'
            }
          },
          commands: {
            required: false,
            serializedName: 'commands',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          environmentVariables: {
            required: false,
            serializedName: 'environmentVariables',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'EnvironmentVariableElementType',
                  type: {
                    name: 'Composite',
                    className: 'EnvironmentVariable'
                  }
              }
            }
          },
          settings: {
            required: false,
            serializedName: 'settings',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'SettingElementType',
                  type: {
                    name: 'Composite',
                    className: 'Setting'
                  }
              }
            }
          },
          labels: {
            required: false,
            serializedName: 'labels',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ContainerLabelElementType',
                  type: {
                    name: 'Composite',
                    className: 'ContainerLabel'
                  }
              }
            }
          },
          endpoints: {
            required: false,
            serializedName: 'endpoints',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'EndpointPropertiesElementType',
                  type: {
                    name: 'Composite',
                    className: 'EndpointProperties'
                  }
              }
            }
          },
          resources: {
            required: true,
            serializedName: 'resources',
            type: {
              name: 'Composite',
              className: 'ResourceRequirements'
            }
          },
          volumeRefs: {
            required: false,
            serializedName: 'volumeRefs',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'VolumeReferenceElementType',
                  type: {
                    name: 'Composite',
                    className: 'VolumeReference'
                  }
              }
            }
          },
          volumes: {
            required: false,
            serializedName: 'volumes',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ApplicationScopedVolumeElementType',
                  type: {
                    name: 'Composite',
                    className: 'ApplicationScopedVolume'
                  }
              }
            }
          },
          diagnostics: {
            required: false,
            serializedName: 'diagnostics',
            type: {
              name: 'Composite',
              className: 'DiagnosticsRef'
            }
          },
          reliableCollectionsRefs: {
            required: false,
            serializedName: 'reliableCollectionsRefs',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ReliableCollectionsRefElementType',
                  type: {
                    name: 'Composite',
                    className: 'ReliableCollectionsRef'
                  }
              }
            }
          },
          instanceView: {
            required: false,
            readOnly: true,
            serializedName: 'instanceView',
            type: {
              name: 'Composite',
              className: 'ContainerInstanceView'
            }
          }
        }
      }
    };
  }
}

module.exports = ContainerCodePackageProperties;
