Class: OCI::ResourceManager::Models::TerraformAdvancedOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/resource_manager/models/terraform_advanced_options.rb

Overview

Specifies advanced options for Terraform commands. These options are not necessary for normal usage of Terraform.

Constant Summary collapse

DETAILED_LOG_LEVEL_ENUM =
[
  DETAILED_LOG_LEVEL_ERROR = 'ERROR'.freeze,
  DETAILED_LOG_LEVEL_WARN = 'WARN'.freeze,
  DETAILED_LOG_LEVEL_INFO = 'INFO'.freeze,
  DETAILED_LOG_LEVEL_DEBUG = 'DEBUG'.freeze,
  DETAILED_LOG_LEVEL_TRACE = 'TRACE'.freeze,
  DETAILED_LOG_LEVEL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TerraformAdvancedOptions

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :is_refresh_required (BOOLEAN)

    The value to assign to the #is_refresh_required property

  • :parallelism (Integer)

    The value to assign to the #parallelism property

  • :detailed_log_level (String)

    The value to assign to the #detailed_log_level property



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/oci/resource_manager/models/terraform_advanced_options.rb', line 73

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

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

  self.is_refresh_required = attributes[:'isRefreshRequired'] unless attributes[:'isRefreshRequired'].nil?
  self.is_refresh_required = true if is_refresh_required.nil? && !attributes.key?(:'isRefreshRequired') # rubocop:disable Style/StringLiterals

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

  self.is_refresh_required = attributes[:'is_refresh_required'] unless attributes[:'is_refresh_required'].nil?
  self.is_refresh_required = true if is_refresh_required.nil? && !attributes.key?(:'isRefreshRequired') && !attributes.key?(:'is_refresh_required') # rubocop:disable Style/StringLiterals

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

  self.detailed_log_level = attributes[:'detailedLogLevel'] if attributes[:'detailedLogLevel']

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

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

Instance Attribute Details

#detailed_log_levelString

Enables detailed logs at the specified verbosity for running the job (operation).

Returns:

  • (String)


40
41
42
# File 'lib/oci/resource_manager/models/terraform_advanced_options.rb', line 40

def detailed_log_level
  @detailed_log_level
end

#is_refresh_requiredBOOLEAN

Specifies whether to refresh the state for each resource before running the job (operation). Refreshing the state can affect performance. Consider setting to false if the configuration includes several resources. Used with the following operations: PLAN, APPLY, DESTROY.

Returns:

  • (BOOLEAN)


27
28
29
# File 'lib/oci/resource_manager/models/terraform_advanced_options.rb', line 27

def is_refresh_required
  @is_refresh_required
end

#parallelismInteger

Limits the number of concurrent Terraform operations when walking the graph. Use this parameter to help debug Terraform issues or to accomplish certain special use cases. A higher value might cause resources to be throttled. Used with the following operations: PLAN, APPLY, DESTROY.

Returns:

  • (Integer)


35
36
37
# File 'lib/oci/resource_manager/models/terraform_advanced_options.rb', line 35

def parallelism
  @parallelism
end

Class Method Details

.attribute_mapObject

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



43
44
45
46
47
48
49
50
51
# File 'lib/oci/resource_manager/models/terraform_advanced_options.rb', line 43

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'is_refresh_required': :'isRefreshRequired',
    'parallelism': :'parallelism',
    'detailed_log_level': :'detailedLogLevel'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



54
55
56
57
58
59
60
61
62
# File 'lib/oci/resource_manager/models/terraform_advanced_options.rb', line 54

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'is_refresh_required': :'BOOLEAN',
    'parallelism': :'Integer',
    'detailed_log_level': :'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



116
117
118
119
120
121
122
123
# File 'lib/oci/resource_manager/models/terraform_advanced_options.rb', line 116

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

  self.class == other.class &&
    is_refresh_required == other.is_refresh_required &&
    parallelism == other.parallelism &&
    detailed_log_level == other.detailed_log_level
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



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/oci/resource_manager/models/terraform_advanced_options.rb', line 148

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


128
129
130
# File 'lib/oci/resource_manager/models/terraform_advanced_options.rb', line 128

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



137
138
139
# File 'lib/oci/resource_manager/models/terraform_advanced_options.rb', line 137

def hash
  [is_refresh_required, parallelism, detailed_log_level].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



181
182
183
184
185
186
187
188
189
190
# File 'lib/oci/resource_manager/models/terraform_advanced_options.rb', line 181

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



175
176
177
# File 'lib/oci/resource_manager/models/terraform_advanced_options.rb', line 175

def to_s
  to_hash.to_s
end