Class: OCI::FleetAppsManagement::Models::StepBasedUserActionDetails

Inherits:
UserActionDetails
  • Object
show all
Defined in:
lib/oci/fleet_apps_management/models/step_based_user_action_details.rb

Overview

Details for a user action to be performed on a step.

Constant Summary

Constants inherited from UserActionDetails

UserActionDetails::ACTION_ENUM, UserActionDetails::LEVEL_ENUM

Instance Attribute Summary collapse

Attributes inherited from UserActionDetails

#action, #level

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from UserActionDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ StepBasedUserActionDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :action (String)

    The value to assign to the #action proprety

  • :action_group_id (String)

    The value to assign to the #action_group_id property

  • :resource_id (String)

    The value to assign to the #resource_id property

  • :target_id (String)

    The value to assign to the #target_id property

  • :step_name (String)

    The value to assign to the #step_name property



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/oci/fleet_apps_management/models/step_based_user_action_details.rb', line 68

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

  attributes['level'] = 'STEP_NAME'

  super(attributes)

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

  self.action_group_id = attributes[:'actionGroupId'] if attributes[:'actionGroupId']

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

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

  self.resource_id = attributes[:'resourceId'] if attributes[:'resourceId']

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

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

  self.target_id = attributes[:'targetId'] if attributes[:'targetId']

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

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

  self.step_name = attributes[:'stepName'] if attributes[:'stepName']

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

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

Instance Attribute Details

#action_group_idString

[Required] Unique identifier for the action group.

Returns:

  • (String)


14
15
16
# File 'lib/oci/fleet_apps_management/models/step_based_user_action_details.rb', line 14

def action_group_id
  @action_group_id
end

#resource_idString

[Required] Resource OCID

Returns:

  • (String)


19
20
21
# File 'lib/oci/fleet_apps_management/models/step_based_user_action_details.rb', line 19

def resource_id
  @resource_id
end

#step_nameString

[Required] Name of the step on which user action needs to be performed.

Returns:

  • (String)


27
28
29
# File 'lib/oci/fleet_apps_management/models/step_based_user_action_details.rb', line 27

def step_name
  @step_name
end

#target_idString

Target associated with the execution.

Returns:

  • (String)


23
24
25
# File 'lib/oci/fleet_apps_management/models/step_based_user_action_details.rb', line 23

def target_id
  @target_id
end

Class Method Details

.attribute_mapObject

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



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/oci/fleet_apps_management/models/step_based_user_action_details.rb', line 30

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'level': :'level',
    'action': :'action',
    'action_group_id': :'actionGroupId',
    'resource_id': :'resourceId',
    'target_id': :'targetId',
    'step_name': :'stepName'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/oci/fleet_apps_management/models/step_based_user_action_details.rb', line 44

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'level': :'String',
    'action': :'String',
    'action_group_id': :'String',
    'resource_id': :'String',
    'target_id': :'String',
    'step_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



110
111
112
113
114
115
116
117
118
119
120
# File 'lib/oci/fleet_apps_management/models/step_based_user_action_details.rb', line 110

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

  self.class == other.class &&
    level == other.level &&
    action == other.action &&
    action_group_id == other.action_group_id &&
    resource_id == other.resource_id &&
    target_id == other.target_id &&
    step_name == other.step_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



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/oci/fleet_apps_management/models/step_based_user_action_details.rb', line 145

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


125
126
127
# File 'lib/oci/fleet_apps_management/models/step_based_user_action_details.rb', line 125

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



134
135
136
# File 'lib/oci/fleet_apps_management/models/step_based_user_action_details.rb', line 134

def hash
  [level, action, action_group_id, resource_id, target_id, step_name].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



178
179
180
181
182
183
184
185
186
187
# File 'lib/oci/fleet_apps_management/models/step_based_user_action_details.rb', line 178

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



172
173
174
# File 'lib/oci/fleet_apps_management/models/step_based_user_action_details.rb', line 172

def to_s
  to_hash.to_s
end