Class: OCI::Devops::Models::CreateTriggerDeploymentStageDetails

Inherits:
CreateBuildPipelineStageDetails show all
Defined in:
lib/oci/devops/models/create_trigger_deployment_stage_details.rb

Overview

Specifies the Trigger Deployment stage, which runs another pipeline of the application.

Instance Attribute Summary collapse

Attributes inherited from CreateBuildPipelineStageDetails

#build_pipeline_id, #build_pipeline_stage_predecessor_collection, #build_pipeline_stage_type, #defined_tags, #description, #display_name, #freeform_tags

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CreateBuildPipelineStageDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ CreateTriggerDeploymentStageDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/oci/devops/models/create_trigger_deployment_stage_details.rb', line 68

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

  attributes['buildPipelineStageType'] = 'TRIGGER_DEPLOYMENT_PIPELINE'

  super(attributes)

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

  self.deploy_pipeline_id = attributes[:'deployPipelineId'] if attributes[:'deployPipelineId']

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

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

  self.is_pass_all_parameters_enabled = attributes[:'isPassAllParametersEnabled'] unless attributes[:'isPassAllParametersEnabled'].nil?

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

  self.is_pass_all_parameters_enabled = attributes[:'is_pass_all_parameters_enabled'] unless attributes[:'is_pass_all_parameters_enabled'].nil?
end

Instance Attribute Details

#deploy_pipeline_idString

[Required] A target deployment pipeline OCID that will run in this stage.

Returns:

  • (String)


14
15
16
# File 'lib/oci/devops/models/create_trigger_deployment_stage_details.rb', line 14

def deploy_pipeline_id
  @deploy_pipeline_id
end

#is_pass_all_parameters_enabledBOOLEAN

[Required] A boolean flag that specifies whether all the parameters must be passed when the deployment is triggered.

Returns:

  • (BOOLEAN)


18
19
20
# File 'lib/oci/devops/models/create_trigger_deployment_stage_details.rb', line 18

def is_pass_all_parameters_enabled
  @is_pass_all_parameters_enabled
end

Class Method Details

.attribute_mapObject

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



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/oci/devops/models/create_trigger_deployment_stage_details.rb', line 21

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'displayName',
    'description': :'description',
    'build_pipeline_stage_type': :'buildPipelineStageType',
    'build_pipeline_id': :'buildPipelineId',
    'build_pipeline_stage_predecessor_collection': :'buildPipelineStagePredecessorCollection',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags',
    'deploy_pipeline_id': :'deployPipelineId',
    'is_pass_all_parameters_enabled': :'isPassAllParametersEnabled'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'String',
    'description': :'String',
    'build_pipeline_stage_type': :'String',
    'build_pipeline_id': :'String',
    'build_pipeline_stage_predecessor_collection': :'OCI::Devops::Models::BuildPipelineStagePredecessorCollection',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'deploy_pipeline_id': :'String',
    'is_pass_all_parameters_enabled': :'BOOLEAN'
    # 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



98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/oci/devops/models/create_trigger_deployment_stage_details.rb', line 98

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

  self.class == other.class &&
    display_name == other.display_name &&
    description == other.description &&
    build_pipeline_stage_type == other.build_pipeline_stage_type &&
    build_pipeline_id == other.build_pipeline_id &&
    build_pipeline_stage_predecessor_collection == other.build_pipeline_stage_predecessor_collection &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags &&
    deploy_pipeline_id == other.deploy_pipeline_id &&
    is_pass_all_parameters_enabled == other.is_pass_all_parameters_enabled
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



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/oci/devops/models/create_trigger_deployment_stage_details.rb', line 136

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


116
117
118
# File 'lib/oci/devops/models/create_trigger_deployment_stage_details.rb', line 116

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



125
126
127
# File 'lib/oci/devops/models/create_trigger_deployment_stage_details.rb', line 125

def hash
  [display_name, description, build_pipeline_stage_type, build_pipeline_id, build_pipeline_stage_predecessor_collection, freeform_tags, defined_tags, deploy_pipeline_id, is_pass_all_parameters_enabled].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



169
170
171
172
173
174
175
176
177
178
# File 'lib/oci/devops/models/create_trigger_deployment_stage_details.rb', line 169

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



163
164
165
# File 'lib/oci/devops/models/create_trigger_deployment_stage_details.rb', line 163

def to_s
  to_hash.to_s
end