# 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::ServiceFabric::V6_3_0_9
  module Models
    #
    # Represents a repair task, which includes information about what kind of
    # repair was requested, what its progress is, and what its final result
    # was.
    #
    # This type supports the Service Fabric platform; it is not meant to be
    # used directly from your code.
    #
    class RepairTask

      include MsRestAzure

      # @return [String] The ID of the repair task.
      attr_accessor :task_id

      # @return [String] The version of the repair task.
      # When creating a new repair task, the version must be set to zero.  When
      # updating a repair task,
      # the version is used for optimistic concurrency checks.  If the version
      # is
      # set to zero, the update will not check for write conflicts.  If the
      # version is set to a non-zero value, then the
      # update will only succeed if the actual current version of the repair
      # task matches this value.
      attr_accessor :version

      # @return [String] A description of the purpose of the repair task, or
      # other informational details.
      # May be set when the repair task is created, and is immutable once set.
      attr_accessor :description

      # @return [State] The workflow state of the repair task. Valid initial
      # states are Created, Claimed, and Preparing. Possible values include:
      # 'Invalid', 'Created', 'Claimed', 'Preparing', 'Approved', 'Executing',
      # 'Restoring', 'Completed'
      attr_accessor :state

      # @return [Integer] A bitwise-OR of the following values, which gives
      # additional details about the status of the repair task.
      # - 1 - Cancellation of the repair has been requested
      # - 2 - Abort of the repair has been requested
      # - 4 - Approval of the repair was forced via client request
      attr_accessor :flags

      # @return [String] The requested repair action. Must be specified when
      # the repair task is created, and is immutable once set.
      attr_accessor :action

      # @return [RepairTargetDescriptionBase] The target object determines what
      # actions the system will take to prepare for the impact of the repair,
      # prior to approving execution of the repair.
      # May be set when the repair task is created, and is immutable once set.
      attr_accessor :target

      # @return [String] The name of the repair executor. Must be specified in
      # Claimed and later states, and is immutable once set.
      attr_accessor :executor

      # @return [String] A data string that the repair executor can use to
      # store its internal state.
      attr_accessor :executor_data

      # @return [RepairImpactDescriptionBase] The impact object determines what
      # actions the system will take to prepare for the impact of the repair,
      # prior to approving execution of the repair.
      # Impact must be specified by the repair executor when transitioning to
      # the Preparing state, and is immutable once set.
      attr_accessor :impact

      # @return [ResultStatus] A value describing the overall result of the
      # repair task execution. Must be specified in the Restoring and later
      # states, and is immutable once set. Possible values include: 'Invalid',
      # 'Succeeded', 'Cancelled', 'Interrupted', 'Failed', 'Pending'
      attr_accessor :result_status

      # @return [Integer] A numeric value providing additional details about
      # the result of the repair task execution.
      # May be specified in the Restoring and later states, and is immutable
      # once set.
      attr_accessor :result_code

      # @return [String] A string providing additional details about the result
      # of the repair task execution.
      # May be specified in the Restoring and later states, and is immutable
      # once set.
      attr_accessor :result_details

      # @return [RepairTaskHistory] An object that contains timestamps of the
      # repair task's state transitions.
      # These timestamps are updated by the system, and cannot be directly
      # modified.
      attr_accessor :history

      # @return [RepairTaskHealthCheckState] The workflow state of the health
      # check when the repair task is in the Preparing state. Possible values
      # include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut'
      attr_accessor :preparing_health_check_state

      # @return [RepairTaskHealthCheckState] The workflow state of the health
      # check when the repair task is in the Restoring state. Possible values
      # include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut'
      attr_accessor :restoring_health_check_state

      # @return [Boolean] A value to determine if health checks will be
      # performed when the repair task enters the Preparing state.
      attr_accessor :perform_preparing_health_check

      # @return [Boolean] A value to determine if health checks will be
      # performed when the repair task enters the Restoring state.
      attr_accessor :perform_restoring_health_check


      #
      # Mapper for RepairTask class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'RepairTask',
          type: {
            name: 'Composite',
            class_name: 'RepairTask',
            model_properties: {
              task_id: {
                client_side_validation: true,
                required: true,
                serialized_name: 'TaskId',
                type: {
                  name: 'String'
                }
              },
              version: {
                client_side_validation: true,
                required: false,
                serialized_name: 'Version',
                type: {
                  name: 'String'
                }
              },
              description: {
                client_side_validation: true,
                required: false,
                serialized_name: 'Description',
                type: {
                  name: 'String'
                }
              },
              state: {
                client_side_validation: true,
                required: true,
                serialized_name: 'State',
                type: {
                  name: 'String'
                }
              },
              flags: {
                client_side_validation: true,
                required: false,
                serialized_name: 'Flags',
                type: {
                  name: 'Number'
                }
              },
              action: {
                client_side_validation: true,
                required: true,
                serialized_name: 'Action',
                type: {
                  name: 'String'
                }
              },
              target: {
                client_side_validation: true,
                required: false,
                serialized_name: 'Target',
                type: {
                  name: 'Composite',
                  polymorphic_discriminator: 'Kind',
                  uber_parent: 'RepairTargetDescriptionBase',
                  class_name: 'RepairTargetDescriptionBase'
                }
              },
              executor: {
                client_side_validation: true,
                required: false,
                serialized_name: 'Executor',
                type: {
                  name: 'String'
                }
              },
              executor_data: {
                client_side_validation: true,
                required: false,
                serialized_name: 'ExecutorData',
                type: {
                  name: 'String'
                }
              },
              impact: {
                client_side_validation: true,
                required: false,
                serialized_name: 'Impact',
                type: {
                  name: 'Composite',
                  polymorphic_discriminator: 'Kind',
                  uber_parent: 'RepairImpactDescriptionBase',
                  class_name: 'RepairImpactDescriptionBase'
                }
              },
              result_status: {
                client_side_validation: true,
                required: false,
                serialized_name: 'ResultStatus',
                type: {
                  name: 'String'
                }
              },
              result_code: {
                client_side_validation: true,
                required: false,
                serialized_name: 'ResultCode',
                type: {
                  name: 'Number'
                }
              },
              result_details: {
                client_side_validation: true,
                required: false,
                serialized_name: 'ResultDetails',
                type: {
                  name: 'String'
                }
              },
              history: {
                client_side_validation: true,
                required: false,
                serialized_name: 'History',
                type: {
                  name: 'Composite',
                  class_name: 'RepairTaskHistory'
                }
              },
              preparing_health_check_state: {
                client_side_validation: true,
                required: false,
                serialized_name: 'PreparingHealthCheckState',
                type: {
                  name: 'String'
                }
              },
              restoring_health_check_state: {
                client_side_validation: true,
                required: false,
                serialized_name: 'RestoringHealthCheckState',
                type: {
                  name: 'String'
                }
              },
              perform_preparing_health_check: {
                client_side_validation: true,
                required: false,
                serialized_name: 'PerformPreparingHealthCheck',
                type: {
                  name: 'Boolean'
                }
              },
              perform_restoring_health_check: {
                client_side_validation: true,
                required: false,
                serialized_name: 'PerformRestoringHealthCheck',
                type: {
                  name: 'Boolean'
                }
              }
            }
          }
        }
      end
    end
  end
end
