Class: OCI::StackMonitoring::Models::CreateOnboardConfigDetails

Inherits:
CreateConfigDetails show all
Defined in:
lib/oci/stack_monitoring/models/create_onboard_config_details.rb

Overview

A configuration of the ONBOARD type, contains fields describing Onboarding customization: policies, dynamic groups, user groups.

Instance Attribute Summary collapse

Attributes inherited from CreateConfigDetails

#compartment_id, #config_type, #defined_tags, #display_name, #freeform_tags

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CreateConfigDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ CreateOnboardConfigDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
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
# File 'lib/oci/stack_monitoring/models/create_onboard_config_details.rb', line 91

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

  attributes['configType'] = 'ONBOARD'

  super(attributes)

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

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

  self.is_manually_onboarded = attributes[:'isManuallyOnboarded'] unless attributes[:'isManuallyOnboarded'].nil?

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

  self.is_manually_onboarded = attributes[:'is_manually_onboarded'] unless attributes[:'is_manually_onboarded'].nil?

  self.policy_names = attributes[:'policyNames'] if attributes[:'policyNames']

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

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

  self.dynamic_groups = attributes[:'dynamicGroups'] if attributes[:'dynamicGroups']

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

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

  self.user_groups = attributes[:'userGroups'] if attributes[:'userGroups']

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

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

  self.additional_configurations = attributes[:'additionalConfigurations'] if attributes[:'additionalConfigurations']

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

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

Instance Attribute Details

#additional_configurationsOCI::StackMonitoring::Models::AdditionalConfigurationDetails



35
36
37
# File 'lib/oci/stack_monitoring/models/create_onboard_config_details.rb', line 35

def additional_configurations
  @additional_configurations
end

#dynamic_groupsArray<OCI::StackMonitoring::Models::DynamicGroupDetails>

List of dynamic groups dedicated for Stack Monitoring.



28
29
30
# File 'lib/oci/stack_monitoring/models/create_onboard_config_details.rb', line 28

def dynamic_groups
  @dynamic_groups
end

#is_manually_onboardedBOOLEAN

[Required] True if customer decides marks configuration as manually configured.

Returns:

  • (BOOLEAN)


20
21
22
# File 'lib/oci/stack_monitoring/models/create_onboard_config_details.rb', line 20

def is_manually_onboarded
  @is_manually_onboarded
end

#policy_namesArray<String>

List of policy names assigned for onboarding

Returns:

  • (Array<String>)


24
25
26
# File 'lib/oci/stack_monitoring/models/create_onboard_config_details.rb', line 24

def policy_names
  @policy_names
end

#user_groupsArray<OCI::StackMonitoring::Models::GroupDetails>

List of user groups dedicated for Stack Monitoring.



32
33
34
# File 'lib/oci/stack_monitoring/models/create_onboard_config_details.rb', line 32

def user_groups
  @user_groups
end

#versionString

Assigned version to given onboard configuration.

Returns:

  • (String)


16
17
18
# File 'lib/oci/stack_monitoring/models/create_onboard_config_details.rb', line 16

def version
  @version
end

Class Method Details

.attribute_mapObject

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



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/oci/stack_monitoring/models/create_onboard_config_details.rb', line 38

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'displayName',
    'compartment_id': :'compartmentId',
    'config_type': :'configType',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags',
    'version': :'version',
    'is_manually_onboarded': :'isManuallyOnboarded',
    'policy_names': :'policyNames',
    'dynamic_groups': :'dynamicGroups',
    'user_groups': :'userGroups',
    'additional_configurations': :'additionalConfigurations'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'String',
    'compartment_id': :'String',
    'config_type': :'String',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'version': :'String',
    'is_manually_onboarded': :'BOOLEAN',
    'policy_names': :'Array<String>',
    'dynamic_groups': :'Array<OCI::StackMonitoring::Models::DynamicGroupDetails>',
    'user_groups': :'Array<OCI::StackMonitoring::Models::GroupDetails>',
    'additional_configurations': :'OCI::StackMonitoring::Models::AdditionalConfigurationDetails'
    # 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



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/oci/stack_monitoring/models/create_onboard_config_details.rb', line 141

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

  self.class == other.class &&
    display_name == other.display_name &&
    compartment_id == other.compartment_id &&
    config_type == other.config_type &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags &&
    version == other.version &&
    is_manually_onboarded == other.is_manually_onboarded &&
    policy_names == other.policy_names &&
    dynamic_groups == other.dynamic_groups &&
    user_groups == other.user_groups &&
    additional_configurations == other.additional_configurations
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



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/oci/stack_monitoring/models/create_onboard_config_details.rb', line 181

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


161
162
163
# File 'lib/oci/stack_monitoring/models/create_onboard_config_details.rb', line 161

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



170
171
172
# File 'lib/oci/stack_monitoring/models/create_onboard_config_details.rb', line 170

def hash
  [display_name, compartment_id, config_type, freeform_tags, defined_tags, version, is_manually_onboarded, policy_names, dynamic_groups, user_groups, additional_configurations].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



214
215
216
217
218
219
220
221
222
223
# File 'lib/oci/stack_monitoring/models/create_onboard_config_details.rb', line 214

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



208
209
210
# File 'lib/oci/stack_monitoring/models/create_onboard_config_details.rb', line 208

def to_s
  to_hash.to_s
end