# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::Batch::Mgmt::V2019_08_01
  module Models
    #
    # A single file or multiple files to be downloaded to a compute node.
    #
    #
    class ResourceFile

      include MsRestAzure

      # @return [String] The storage container name in the auto storage
      # account. The autoStorageContainerName, storageContainerUrl and httpUrl
      # properties are mutually exclusive and one of them must be specified.
      attr_accessor :auto_storage_container_name

      # @return [String] The URL of the blob container within Azure Blob
      # Storage. The autoStorageContainerName, storageContainerUrl and httpUrl
      # properties are mutually exclusive and one of them must be specified.
      # This URL must be readable and listable using anonymous access; that is,
      # the Batch service does not present any credentials when downloading the
      # blob. There are two ways to get such a URL for a blob in Azure storage:
      # include a Shared Access Signature (SAS) granting read and list
      # permissions on the blob, or set the ACL for the blob or its container
      # to allow public access.
      attr_accessor :storage_container_url

      # @return [String] The URL of the file to download. The
      # autoStorageContainerName, storageContainerUrl and httpUrl properties
      # are mutually exclusive and one of them must be specified. If the URL is
      # Azure Blob Storage, it must be readable using anonymous access; that
      # is, the Batch service does not present any credentials when downloading
      # the blob. There are two ways to get such a URL for a blob in Azure
      # storage: include a Shared Access Signature (SAS) granting read
      # permissions on the blob, or set the ACL for the blob or its container
      # to allow public access.
      attr_accessor :http_url

      # @return [String] The blob prefix to use when downloading blobs from an
      # Azure Storage container. Only the blobs whose names begin with the
      # specified prefix will be downloaded. The property is valid only when
      # autoStorageContainerName or storageContainerUrl is used. This prefix
      # can be a partial filename or a subdirectory. If a prefix is not
      # specified, all the files in the container will be downloaded.
      attr_accessor :blob_prefix

      # @return [String] The location on the compute node to which to download
      # the file, relative to the task's working directory. If the httpUrl
      # property is specified, the filePath is required and describes the path
      # which the file will be downloaded to, including the filename.
      # Otherwise, if the autoStorageContainerName or storageContainerUrl
      # property is specified, filePath is optional and is the directory to
      # download the files to. In the case where filePath is used as a
      # directory, any directory structure already associated with the input
      # data will be retained in full and appended to the specified filePath
      # directory. The specified relative path cannot break out of the task's
      # working directory (for example by using '..').
      attr_accessor :file_path

      # @return [String] The file permission mode attribute in octal format.
      # This property applies only to files being downloaded to Linux compute
      # nodes. It will be ignored if it is specified for a resourceFile which
      # will be downloaded to a Windows node. If this property is not specified
      # for a Linux node, then a default value of 0770 is applied to the file.
      attr_accessor :file_mode


      #
      # Mapper for ResourceFile class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'ResourceFile',
          type: {
            name: 'Composite',
            class_name: 'ResourceFile',
            model_properties: {
              auto_storage_container_name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'autoStorageContainerName',
                type: {
                  name: 'String'
                }
              },
              storage_container_url: {
                client_side_validation: true,
                required: false,
                serialized_name: 'storageContainerUrl',
                type: {
                  name: 'String'
                }
              },
              http_url: {
                client_side_validation: true,
                required: false,
                serialized_name: 'httpUrl',
                type: {
                  name: 'String'
                }
              },
              blob_prefix: {
                client_side_validation: true,
                required: false,
                serialized_name: 'blobPrefix',
                type: {
                  name: 'String'
                }
              },
              file_path: {
                client_side_validation: true,
                required: false,
                serialized_name: 'filePath',
                type: {
                  name: 'String'
                }
              },
              file_mode: {
                client_side_validation: true,
                required: false,
                serialized_name: 'fileMode',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end
