# 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::CognitiveServices::Face::V1_0
  module Models
    #
    # Operation status object. Operation refers to the asynchronous backend
    # task including taking a snapshot and applying a snapshot.
    #
    class OperationStatus

      include MsRestAzure

      # @return [OperationStatusType] Operation status: notstarted, running,
      # succeeded, failed. If the operation is requested and waiting to
      # perform, the status is notstarted. If the operation is ongoing in
      # backend, the status is running. Status succeeded means the operation is
      # completed successfully, specifically for snapshot taking operation, it
      # illustrates the snapshot is well taken and ready to apply, and for
      # snapshot applying operation, it presents the target object has finished
      # creating by the snapshot and ready to be used. Status failed is often
      # caused by editing the source object while taking the snapshot or
      # editing the target object while applying the snapshot before
      # completion, see the field "message" to check the failure reason.
      # Possible values include: 'notstarted', 'running', 'succeeded', 'failed'
      attr_accessor :status

      # @return [DateTime] A combined UTC date and time string that describes
      # the time when the operation (take or apply a snapshot) is requested.
      # E.g. 2018-12-25T11:41:02.2331413Z.
      attr_accessor :created_time

      # @return [DateTime] A combined UTC date and time string that describes
      # the last time the operation (take or apply a snapshot) is actively
      # migrating data. The lastActionTime will keep increasing until the
      # operation finishes. E.g. 2018-12-25T11:51:27.8705696Z.
      attr_accessor :last_action_time

      # @return [String] When the operation succeeds successfully, for snapshot
      # taking operation the snapshot id will be included in this field, and
      # for snapshot applying operation, the path to get the target object will
      # be returned in this field.
      attr_accessor :resource_location

      # @return [String] Show failure message when operation fails (omitted
      # when operation succeeds).
      attr_accessor :message


      #
      # Mapper for OperationStatus class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'OperationStatus',
          type: {
            name: 'Composite',
            class_name: 'OperationStatus',
            model_properties: {
              status: {
                client_side_validation: true,
                required: true,
                serialized_name: 'status',
                type: {
                  name: 'Enum',
                  module: 'OperationStatusType'
                }
              },
              created_time: {
                client_side_validation: true,
                required: true,
                serialized_name: 'createdTime',
                type: {
                  name: 'DateTime'
                }
              },
              last_action_time: {
                client_side_validation: true,
                required: false,
                serialized_name: 'lastActionTime',
                type: {
                  name: 'DateTime'
                }
              },
              resource_location: {
                client_side_validation: true,
                required: false,
                serialized_name: 'resourceLocation',
                type: {
                  name: 'String'
                }
              },
              message: {
                client_side_validation: true,
                required: false,
                serialized_name: 'message',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end
