Class: OCI::FleetAppsManagement::Models::AssociatedLocalTaskDetails

Inherits:
AssociatedTaskDetails show all
Defined in:
lib/oci/fleet_apps_management/models/associated_local_task_details.rb

Overview

The details of the local task. The local tasks are specific to a single runbook.

Constant Summary collapse

OS_TYPE_ENUM =
[
  OS_TYPE_WINDOWS = 'WINDOWS'.freeze,
  OS_TYPE_LINUX = 'LINUX'.freeze,
  OS_TYPE_GENERIC = 'GENERIC'.freeze,
  OS_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Constants inherited from AssociatedTaskDetails

OCI::FleetAppsManagement::Models::AssociatedTaskDetails::SCOPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from AssociatedTaskDetails

#scope

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AssociatedTaskDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ AssociatedLocalTaskDetails

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/oci/fleet_apps_management/models/associated_local_task_details.rb', line 108

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['scope'] = 'LOCAL'

  super(attributes)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.execution_details = attributes[:'executionDetails'] if attributes[:'executionDetails']

  raise 'You cannot provide both :executionDetails and :execution_details' if attributes.key?(:'executionDetails') && attributes.key?(:'execution_details')

  self.execution_details = attributes[:'execution_details'] if attributes[:'execution_details']

  self.description = attributes[:'description'] if attributes[:'description']

  self.platform = attributes[:'platform'] if attributes[:'platform']

  self.is_copy_to_library_enabled = attributes[:'isCopyToLibraryEnabled'] unless attributes[:'isCopyToLibraryEnabled'].nil?
  self.is_copy_to_library_enabled = false if is_copy_to_library_enabled.nil? && !attributes.key?(:'isCopyToLibraryEnabled') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :isCopyToLibraryEnabled and :is_copy_to_library_enabled' if attributes.key?(:'isCopyToLibraryEnabled') && attributes.key?(:'is_copy_to_library_enabled')

  self.is_copy_to_library_enabled = attributes[:'is_copy_to_library_enabled'] unless attributes[:'is_copy_to_library_enabled'].nil?
  self.is_copy_to_library_enabled = false if is_copy_to_library_enabled.nil? && !attributes.key?(:'isCopyToLibraryEnabled') && !attributes.key?(:'is_copy_to_library_enabled') # rubocop:disable Style/StringLiterals

  self.os_type = attributes[:'osType'] if attributes[:'osType']
  self.os_type = "GENERIC" if os_type.nil? && !attributes.key?(:'osType') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :osType and :os_type' if attributes.key?(:'osType') && attributes.key?(:'os_type')

  self.os_type = attributes[:'os_type'] if attributes[:'os_type']
  self.os_type = "GENERIC" if os_type.nil? && !attributes.key?(:'osType') && !attributes.key?(:'os_type') # rubocop:disable Style/StringLiterals

  self.properties = attributes[:'properties'] if attributes[:'properties']

  self.is_discovery_output_task = attributes[:'isDiscoveryOutputTask'] unless attributes[:'isDiscoveryOutputTask'].nil?
  self.is_discovery_output_task = false if is_discovery_output_task.nil? && !attributes.key?(:'isDiscoveryOutputTask') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :isDiscoveryOutputTask and :is_discovery_output_task' if attributes.key?(:'isDiscoveryOutputTask') && attributes.key?(:'is_discovery_output_task')

  self.is_discovery_output_task = attributes[:'is_discovery_output_task'] unless attributes[:'is_discovery_output_task'].nil?
  self.is_discovery_output_task = false if is_discovery_output_task.nil? && !attributes.key?(:'isDiscoveryOutputTask') && !attributes.key?(:'is_discovery_output_task') # rubocop:disable Style/StringLiterals

  self.is_apply_subject_task = attributes[:'isApplySubjectTask'] unless attributes[:'isApplySubjectTask'].nil?
  self.is_apply_subject_task = false if is_apply_subject_task.nil? && !attributes.key?(:'isApplySubjectTask') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :isApplySubjectTask and :is_apply_subject_task' if attributes.key?(:'isApplySubjectTask') && attributes.key?(:'is_apply_subject_task')

  self.is_apply_subject_task = attributes[:'is_apply_subject_task'] unless attributes[:'is_apply_subject_task'].nil?
  self.is_apply_subject_task = false if is_apply_subject_task.nil? && !attributes.key?(:'isApplySubjectTask') && !attributes.key?(:'is_apply_subject_task') # rubocop:disable Style/StringLiterals

  self.name = attributes[:'name'] if attributes[:'name']
end

Instance Attribute Details

#descriptionString

The description of the task.

Returns:

  • (String)


28
29
30
# File 'lib/oci/fleet_apps_management/models/associated_local_task_details.rb', line 28

def description
  @description
end

#execution_detailsOCI::FleetAppsManagement::Models::ExecutionDetails

This attribute is required.



24
25
26
# File 'lib/oci/fleet_apps_management/models/associated_local_task_details.rb', line 24

def execution_details
  @execution_details
end

#is_apply_subject_taskBOOLEAN

Is this an Apply Subject Task? Ex. Patch Execution Task

Returns:

  • (BOOLEAN)


51
52
53
# File 'lib/oci/fleet_apps_management/models/associated_local_task_details.rb', line 51

def is_apply_subject_task
  @is_apply_subject_task
end

#is_copy_to_library_enabledBOOLEAN

Make a copy of this task in Library

Returns:

  • (BOOLEAN)


36
37
38
# File 'lib/oci/fleet_apps_management/models/associated_local_task_details.rb', line 36

def is_copy_to_library_enabled
  @is_copy_to_library_enabled
end

#is_discovery_output_taskBOOLEAN

Is this a discovery output task?

Returns:

  • (BOOLEAN)


47
48
49
# File 'lib/oci/fleet_apps_management/models/associated_local_task_details.rb', line 47

def is_discovery_output_task
  @is_discovery_output_task
end

#nameString

The name of the task

Returns:

  • (String)


55
56
57
# File 'lib/oci/fleet_apps_management/models/associated_local_task_details.rb', line 55

def name
  @name
end

#os_typeString

The OS for the task.

Returns:

  • (String)


40
41
42
# File 'lib/oci/fleet_apps_management/models/associated_local_task_details.rb', line 40

def os_type
  @os_type
end

#platformString

The platform of the runbook.

Returns:

  • (String)


32
33
34
# File 'lib/oci/fleet_apps_management/models/associated_local_task_details.rb', line 32

def platform
  @platform
end

#propertiesOCI::FleetAppsManagement::Models::Properties



43
44
45
# File 'lib/oci/fleet_apps_management/models/associated_local_task_details.rb', line 43

def properties
  @properties
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/oci/fleet_apps_management/models/associated_local_task_details.rb', line 58

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'scope': :'scope',
    'execution_details': :'executionDetails',
    'description': :'description',
    'platform': :'platform',
    'is_copy_to_library_enabled': :'isCopyToLibraryEnabled',
    'os_type': :'osType',
    'properties': :'properties',
    'is_discovery_output_task': :'isDiscoveryOutputTask',
    'is_apply_subject_task': :'isApplySubjectTask',
    'name': :'name'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/oci/fleet_apps_management/models/associated_local_task_details.rb', line 76

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'scope': :'String',
    'execution_details': :'OCI::FleetAppsManagement::Models::ExecutionDetails',
    'description': :'String',
    'platform': :'String',
    'is_copy_to_library_enabled': :'BOOLEAN',
    'os_type': :'String',
    'properties': :'OCI::FleetAppsManagement::Models::Properties',
    'is_discovery_output_task': :'BOOLEAN',
    'is_apply_subject_task': :'BOOLEAN',
    'name': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/oci/fleet_apps_management/models/associated_local_task_details.rb', line 185

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    scope == other.scope &&
    execution_details == other.execution_details &&
    description == other.description &&
    platform == other.platform &&
    is_copy_to_library_enabled == other.is_copy_to_library_enabled &&
    os_type == other.os_type &&
    properties == other.properties &&
    is_discovery_output_task == other.is_discovery_output_task &&
    is_apply_subject_task == other.is_apply_subject_task &&
    name == other.name
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/oci/fleet_apps_management/models/associated_local_task_details.rb', line 224

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


204
205
206
# File 'lib/oci/fleet_apps_management/models/associated_local_task_details.rb', line 204

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



213
214
215
# File 'lib/oci/fleet_apps_management/models/associated_local_task_details.rb', line 213

def hash
  [scope, execution_details, description, platform, is_copy_to_library_enabled, os_type, properties, is_discovery_output_task, is_apply_subject_task, name].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



257
258
259
260
261
262
263
264
265
266
# File 'lib/oci/fleet_apps_management/models/associated_local_task_details.rb', line 257

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



251
252
253
# File 'lib/oci/fleet_apps_management/models/associated_local_task_details.rb', line 251

def to_s
  to_hash.to_s
end