Class: IntersightClient::WorkflowSolutionActionDefinition

Inherits:
MoBaseMo
  • Object
show all
Defined in:
lib/intersight_client/models/workflow_solution_action_definition.rb

Overview

Definition to capture the details needed to execute an action on the solution.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Attributes inherited from MoBaseMo

#account_moid, #ancestors, #create_time, #display_names, #domain_group_moid, #mod_time, #moid, #owners, #parent, #permission_resources, #shared_scope, #tags, #version_context

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ WorkflowSolutionActionDefinition

Initializes the object

Parameters:

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

    Model attributes in the form of hash



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 173

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `IntersightClient::WorkflowSolutionActionDefinition` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `#{self.class.name}`. Please check the name to make sure it's valid. List of attributes: " + self.class.acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  # call parent's initialize
  super(attributes)

  if attributes.key?(:'class_id')
    self.class_id = attributes[:'class_id']
  else
    self.class_id = 'workflow.SolutionActionDefinition'
  end

  if attributes.key?(:'object_type')
    self.object_type = attributes[:'object_type']
  else
    self.object_type = 'workflow.SolutionActionDefinition'
  end

  if attributes.key?(:'action_type')
    self.action_type = attributes[:'action_type']
  else
    self.action_type = 'External'
  end

  if attributes.key?(:'allowed_instance_states')
    if (value = attributes[:'allowed_instance_states']).is_a?(Array)
      self.allowed_instance_states = value
    end
  end

  if attributes.key?(:'core_workflows')
    if (value = attributes[:'core_workflows']).is_a?(Array)
      self.core_workflows = value
    end
  end

  if attributes.key?(:'description')
    self.description = attributes[:'description']
  end

  if attributes.key?(:'input_definition')
    if (value = attributes[:'input_definition']).is_a?(Array)
      self.input_definition = value
    end
  end

  if attributes.key?(:'label')
    self.label = attributes[:'label']
  end

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.key?(:'output_parameters')
    self.output_parameters = attributes[:'output_parameters']
  end

  if attributes.key?(:'periodicity')
    self.periodicity = attributes[:'periodicity']
  end

  if attributes.key?(:'post_core_workflows')
    if (value = attributes[:'post_core_workflows']).is_a?(Array)
      self.post_core_workflows = value
    end
  end

  if attributes.key?(:'pre_core_workflows')
    if (value = attributes[:'pre_core_workflows']).is_a?(Array)
      self.pre_core_workflows = value
    end
  end

  if attributes.key?(:'stop_workflows')
    if (value = attributes[:'stop_workflows']).is_a?(Array)
      self.stop_workflows = value
    end
  end

  if attributes.key?(:'validation_information')
    self.validation_information = attributes[:'validation_information']
  end

  if attributes.key?(:'validation_workflows')
    if (value = attributes[:'validation_workflows']).is_a?(Array)
      self.validation_workflows = value
    end
  end

  if attributes.key?(:'solution_definition')
    self.solution_definition = attributes[:'solution_definition']
  end

  if attributes.key?(:'workflow_definition')
    self.workflow_definition = attributes[:'workflow_definition']
  end
end

Instance Attribute Details

#action_typeObject

Type of actionDefinition which decides on how to trigger the action. * External - External actions definition can be triggered by enduser to perform actions on the solution. Once action is completed successfully (eg. create/deploy), user cannot re-trigger that action again. * Internal - Internal action definition is used to trigger periodic actions on the solution instance. * Repetitive - Repetitive action definition is an external action that can be triggered by enduser to perform repetitive actions (eg. Edit/Update/Perform health check) on the created solution.



26
27
28
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 26

def action_type
  @action_type
end

#allowed_instance_statesObject

Returns the value of attribute allowed_instance_states.



28
29
30
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 28

def allowed_instance_states
  @allowed_instance_states
end

#class_idObject

The fully-qualified name of the instantiated, concrete type. This property is used as a discriminator to identify the type of the payload when marshaling and unmarshaling data.



20
21
22
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 20

def class_id
  @class_id
end

#core_workflowsObject

Returns the value of attribute core_workflows.



30
31
32
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 30

def core_workflows
  @core_workflows
end

#descriptionObject

The description for this action which provides information on what are the pre-requisites to use this action on the solution and what features are supported by this action.



33
34
35
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 33

def description
  @description
end

#input_definitionObject

Returns the value of attribute input_definition.



35
36
37
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 35

def input_definition
  @input_definition
end

#labelObject

A user friendly short name to identify the action. Name can only contain letters (a-z, A-Z), numbers (0-9), hyphen (-), period (.), colon (:), space ( ) or an underscore (_).



38
39
40
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 38

def label
  @label
end

#nameObject

The name for this action definition. Name can only contain letters (a-z, A-Z), numbers (0-9), hyphen (-), period (.), colon (:) or an underscore (_). Name of the action must be unique within a solution definition.



41
42
43
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 41

def name
  @name
end

#object_typeObject

The fully-qualified name of the instantiated, concrete type. The value should be the same as the ‘ClassId’ property.



23
24
25
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 23

def object_type
  @object_type
end

#output_parametersObject

The output mappings from workflows in the action definition to the solution output definition. Any output from core or post-core workflow can be mapped to solution output definition. The output can be referred using the name of the workflow definition and the output name in the following format ‘${<ActionWorkflowDefinition.Name>.output.<outputName>’.



44
45
46
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 44

def output_parameters
  @output_parameters
end

#periodicityObject

Value in seconds to specify the periodicity of the workflows. A zero value indicate the workflow will not execute periodically. A non-zero value indicate, the workflow will be executed periodically with this periodicity.



47
48
49
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 47

def periodicity
  @periodicity
end

#post_core_workflowsObject

Returns the value of attribute post_core_workflows.



49
50
51
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 49

def post_core_workflows
  @post_core_workflows
end

#pre_core_workflowsObject

Returns the value of attribute pre_core_workflows.



51
52
53
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 51

def pre_core_workflows
  @pre_core_workflows
end

#solution_definitionObject

Returns the value of attribute solution_definition.



59
60
61
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 59

def solution_definition
  @solution_definition
end

#stop_workflowsObject

Returns the value of attribute stop_workflows.



53
54
55
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 53

def stop_workflows
  @stop_workflows
end

#validation_informationObject

Returns the value of attribute validation_information.



55
56
57
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 55

def validation_information
  @validation_information
end

#validation_workflowsObject

Returns the value of attribute validation_workflows.



57
58
59
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 57

def validation_workflows
  @validation_workflows
end

#workflow_definitionObject

Returns the value of attribute workflow_definition.



61
62
63
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 61

def workflow_definition
  @workflow_definition
end

Class Method Details

.acceptable_attribute_mapObject

Returns the key-value map of all the JSON attributes this model knows about, including the ones defined in its parent(s)



115
116
117
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 115

def self.acceptable_attribute_map
  attribute_map.merge(superclass.acceptable_attribute_map)
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about, including the ones defined in its parent(s)



110
111
112
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 110

def self.acceptable_attributes
  attribute_map.values.concat(superclass.acceptable_attributes)
end

.attribute_mapObject

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



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 86

def self.attribute_map
  {
    :'class_id' => :'ClassId',
    :'object_type' => :'ObjectType',
    :'action_type' => :'ActionType',
    :'allowed_instance_states' => :'AllowedInstanceStates',
    :'core_workflows' => :'CoreWorkflows',
    :'description' => :'Description',
    :'input_definition' => :'InputDefinition',
    :'label' => :'Label',
    :'name' => :'Name',
    :'output_parameters' => :'OutputParameters',
    :'periodicity' => :'Periodicity',
    :'post_core_workflows' => :'PostCoreWorkflows',
    :'pre_core_workflows' => :'PreCoreWorkflows',
    :'stop_workflows' => :'StopWorkflows',
    :'validation_information' => :'ValidationInformation',
    :'validation_workflows' => :'ValidationWorkflows',
    :'solution_definition' => :'SolutionDefinition',
    :'workflow_definition' => :'WorkflowDefinition'
  }
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



439
440
441
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 439

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_all_ofObject

List of class defined in allOf (OpenAPI v3)



159
160
161
162
163
164
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 159

def self.openapi_all_of
  [
  :'MoBaseMo',
  :'WorkflowSolutionActionDefinitionAllOf'
  ]
end

.openapi_discriminator_nameObject

discriminator’s property name in OpenAPI v3



167
168
169
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 167

def self.openapi_discriminator_name
  :'ClassId'
end

.openapi_nullableObject

List of attributes with nullable: true



144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 144

def self.openapi_nullable
  Set.new([
    :'allowed_instance_states',
    :'core_workflows',
    :'input_definition',
    :'output_parameters',
    :'post_core_workflows',
    :'pre_core_workflows',
    :'stop_workflows',
    :'validation_information',
    :'validation_workflows',
  ])
end

.openapi_typesObject

Attribute type mapping.



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 120

def self.openapi_types
  {
    :'class_id' => :'String',
    :'object_type' => :'String',
    :'action_type' => :'String',
    :'allowed_instance_states' => :'Array<String>',
    :'core_workflows' => :'Array<WorkflowActionWorkflowDefinition>',
    :'description' => :'String',
    :'input_definition' => :'Array<WorkflowBaseDataType>',
    :'label' => :'String',
    :'name' => :'String',
    :'output_parameters' => :'Object',
    :'periodicity' => :'Integer',
    :'post_core_workflows' => :'Array<WorkflowActionWorkflowDefinition>',
    :'pre_core_workflows' => :'Array<WorkflowActionWorkflowDefinition>',
    :'stop_workflows' => :'Array<WorkflowActionWorkflowDefinition>',
    :'validation_information' => :'WorkflowValidationInformation',
    :'validation_workflows' => :'Array<WorkflowActionWorkflowDefinition>',
    :'solution_definition' => :'WorkflowSolutionDefinitionRelationship',
    :'workflow_definition' => :'WorkflowWorkflowDefinitionRelationship'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 401

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      class_id == o.class_id &&
      object_type == o.object_type &&
      action_type == o.action_type &&
      allowed_instance_states == o.allowed_instance_states &&
      core_workflows == o.core_workflows &&
      description == o.description &&
      input_definition == o.input_definition &&
      label == o.label &&
      name == o.name &&
      output_parameters == o.output_parameters &&
      periodicity == o.periodicity &&
      post_core_workflows == o.post_core_workflows &&
      pre_core_workflows == o.pre_core_workflows &&
      stop_workflows == o.stop_workflows &&
      validation_information == o.validation_information &&
      validation_workflows == o.validation_workflows &&
      solution_definition == o.solution_definition &&
      workflow_definition == o.workflow_definition && super(o)
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 470

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = IntersightClient.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



541
542
543
544
545
546
547
548
549
550
551
552
553
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 541

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
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



446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 446

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  super(attributes)
  WorkflowSolutionActionDefinition.openapi_types.each_pair do |key, type|
    if attributes[WorkflowSolutionActionDefinition.attribute_map[key]].nil? && WorkflowSolutionActionDefinition.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[WorkflowSolutionActionDefinition.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[WorkflowSolutionActionDefinition.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[WorkflowSolutionActionDefinition.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[WorkflowSolutionActionDefinition.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


426
427
428
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 426

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



432
433
434
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 432

def hash
  [class_id, object_type, action_type, allowed_instance_states, core_workflows, description, input_definition, label, name, output_parameters, periodicity, post_core_workflows, pre_core_workflows, stop_workflows, validation_information, validation_workflows, solution_definition, workflow_definition].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 284

def list_invalid_properties
  invalid_properties = super
  if @class_id.nil?
    invalid_properties.push('invalid value for "class_id", class_id cannot be nil.')
  end

  if @object_type.nil?
    invalid_properties.push('invalid value for "object_type", object_type cannot be nil.')
  end

  pattern = Regexp.new(/^[a-zA-Z0-9]+[\sa-zA-Z0-9_.:-]{1,92}$/)
  if !@label.nil? && @label !~ pattern
    invalid_properties.push("invalid value for \"label\", must conform to the pattern #{pattern}.")
  end

  pattern = Regexp.new(/^[a-zA-Z0-9_.:-]{1,64}$/)
  if !@name.nil? && @name !~ pattern
    invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
  end

  if !@periodicity.nil? && @periodicity > 604800
    invalid_properties.push('invalid value for "periodicity", must be smaller than or equal to 604800.')
  end

  if !@periodicity.nil? && @periodicity < 0
    invalid_properties.push('invalid value for "periodicity", must be greater than or equal to 0.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



517
518
519
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 517

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 523

def to_hash
  hash = super
  WorkflowSolutionActionDefinition.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = WorkflowSolutionActionDefinition.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



511
512
513
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 511

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
# File 'lib/intersight_client/models/workflow_solution_action_definition.rb', line 317

def valid?
  return false if @class_id.nil?
  class_id_validator = EnumAttributeValidator.new('String', ["workflow.SolutionActionDefinition"])
  return false unless class_id_validator.valid?(@class_id)
  return false if @object_type.nil?
  object_type_validator = EnumAttributeValidator.new('String', ["workflow.SolutionActionDefinition"])
  return false unless object_type_validator.valid?(@object_type)
  action_type_validator = EnumAttributeValidator.new('String', ["External", "Internal", "Repetitive"])
  return false unless action_type_validator.valid?(@action_type)
  return false if !@label.nil? && @label !~ Regexp.new(/^[a-zA-Z0-9]+[\sa-zA-Z0-9_.:-]{1,92}$/)
  return false if !@name.nil? && @name !~ Regexp.new(/^[a-zA-Z0-9_.:-]{1,64}$/)
  return false if !@periodicity.nil? && @periodicity > 604800
  return false if !@periodicity.nil? && @periodicity < 0
  true && super
end