=begin #Datadog API V2 Collection #Collection of all Datadog Public endpoints. The version of the OpenAPI document: 1.0 Contact: support@datadoghq.com Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2020-Present Datadog, Inc. =end require 'date' require 'time' module DatadogAPIClient::V2 # Details of a CI step. class CIAppPipelineEventStep include BaseGenericModel # Time when the step run finished. The time format must be RFC3339. attr_reader :_end # Contains information of the CI error. attr_accessor :error # If pipelines are triggered due to actions to a Git repository, then all payloads must contain this. # Note that either `tag` or `branch` has to be provided, but not both. attr_accessor :git # UUID for the step. It has to be unique within each pipeline execution. attr_reader :id # The parent job UUID (if applicable). attr_accessor :job_id # The parent job name (if applicable). attr_accessor :job_name # Used to distinguish between pipelines, stages, jobs and steps. attr_reader :level # A list of user-defined metrics. The metrics must follow the `key:value` pattern and the value must be numeric. attr_accessor :metrics # The name for the step. attr_reader :name # Contains information of the host running the pipeline, stage, job, or step. attr_accessor :node # A map of key-value parameters or environment variables that were defined for the pipeline. attr_accessor :parameters # The parent pipeline name. attr_reader :pipeline_name # The parent pipeline UUID. attr_reader :pipeline_unique_id # The parent stage UUID (if applicable). attr_accessor :stage_id # The parent stage name (if applicable). attr_accessor :stage_name # Time when the step run started. The time format must be RFC3339. attr_reader :start # The final status of the step. attr_reader :status # A list of user-defined tags. The tags must follow the `key:value` pattern. attr_accessor :tags # The URL to look at the step in the CI provider UI. attr_accessor :url attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. # @!visibility private def self.attribute_map { :'_end' => :'end', :'error' => :'error', :'git' => :'git', :'id' => :'id', :'job_id' => :'job_id', :'job_name' => :'job_name', :'level' => :'level', :'metrics' => :'metrics', :'name' => :'name', :'node' => :'node', :'parameters' => :'parameters', :'pipeline_name' => :'pipeline_name', :'pipeline_unique_id' => :'pipeline_unique_id', :'stage_id' => :'stage_id', :'stage_name' => :'stage_name', :'start' => :'start', :'status' => :'status', :'tags' => :'tags', :'url' => :'url' } end # Attribute type mapping. # @!visibility private def self.openapi_types { :'_end' => :'Time', :'error' => :'CIAppCIError', :'git' => :'CIAppGitInfo', :'id' => :'String', :'job_id' => :'String', :'job_name' => :'String', :'level' => :'CIAppPipelineEventStepLevel', :'metrics' => :'Array', :'name' => :'String', :'node' => :'CIAppHostInfo', :'parameters' => :'Hash', :'pipeline_name' => :'String', :'pipeline_unique_id' => :'String', :'stage_id' => :'String', :'stage_name' => :'String', :'start' => :'Time', :'status' => :'CIAppPipelineEventStepStatus', :'tags' => :'Array', :'url' => :'String' } end # List of attributes with nullable: true # @!visibility private def self.openapi_nullable Set.new([ :'error', :'git', :'job_id', :'job_name', :'metrics', :'node', :'parameters', :'stage_id', :'stage_name', :'tags', :'url', ]) end # Initializes the object # @param attributes [Hash] Model attributes in the form of hash # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CIAppPipelineEventStep` initialize method" end self.additional_properties = {} # 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.attribute_map.key?(k.to_sym)) self.additional_properties[k.to_sym] = v else h[k.to_sym] = v end } if attributes.key?(:'_end') self._end = attributes[:'_end'] end if attributes.key?(:'error') self.error = attributes[:'error'] end if attributes.key?(:'git') self.git = attributes[:'git'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'job_id') self.job_id = attributes[:'job_id'] end if attributes.key?(:'job_name') self.job_name = attributes[:'job_name'] end if attributes.key?(:'level') self.level = attributes[:'level'] end if attributes.key?(:'metrics') if (value = attributes[:'metrics']).is_a?(Array) self.metrics = value end end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'node') self.node = attributes[:'node'] end if attributes.key?(:'parameters') self.parameters = attributes[:'parameters'] end if attributes.key?(:'pipeline_name') self.pipeline_name = attributes[:'pipeline_name'] end if attributes.key?(:'pipeline_unique_id') self.pipeline_unique_id = attributes[:'pipeline_unique_id'] end if attributes.key?(:'stage_id') self.stage_id = attributes[:'stage_id'] end if attributes.key?(:'stage_name') self.stage_name = attributes[:'stage_name'] end if attributes.key?(:'start') self.start = attributes[:'start'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'tags') if (value = attributes[:'tags']).is_a?(Array) self.tags = value end end if attributes.key?(:'url') self.url = attributes[:'url'] end end # Check to see if the all the properties in the model are valid # @return true if the model is valid # @!visibility private def valid? return false if @_end.nil? return false if @id.nil? return false if @level.nil? return false if @name.nil? return false if @pipeline_name.nil? return false if @pipeline_unique_id.nil? return false if @start.nil? return false if @status.nil? true end # Custom attribute writer method with validation # @param _end [Object] Object to be assigned # @!visibility private def _end=(_end) if _end.nil? fail ArgumentError, 'invalid value for "_end", _end cannot be nil.' end @_end = _end end # Custom attribute writer method with validation # @param id [Object] Object to be assigned # @!visibility private def id=(id) if id.nil? fail ArgumentError, 'invalid value for "id", id cannot be nil.' end @id = id end # Custom attribute writer method with validation # @param level [Object] Object to be assigned # @!visibility private def level=(level) if level.nil? fail ArgumentError, 'invalid value for "level", level cannot be nil.' end @level = level end # Custom attribute writer method with validation # @param name [Object] Object to be assigned # @!visibility private def name=(name) if name.nil? fail ArgumentError, 'invalid value for "name", name cannot be nil.' end @name = name end # Custom attribute writer method with validation # @param pipeline_name [Object] Object to be assigned # @!visibility private def pipeline_name=(pipeline_name) if pipeline_name.nil? fail ArgumentError, 'invalid value for "pipeline_name", pipeline_name cannot be nil.' end @pipeline_name = pipeline_name end # Custom attribute writer method with validation # @param pipeline_unique_id [Object] Object to be assigned # @!visibility private def pipeline_unique_id=(pipeline_unique_id) if pipeline_unique_id.nil? fail ArgumentError, 'invalid value for "pipeline_unique_id", pipeline_unique_id cannot be nil.' end @pipeline_unique_id = pipeline_unique_id end # Custom attribute writer method with validation # @param start [Object] Object to be assigned # @!visibility private def start=(start) if start.nil? fail ArgumentError, 'invalid value for "start", start cannot be nil.' end @start = start end # Custom attribute writer method with validation # @param status [Object] Object to be assigned # @!visibility private def status=(status) if status.nil? fail ArgumentError, 'invalid value for "status", status cannot be nil.' end @status = status end # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end self.additional_properties.each_pair do |attr, value| hash[attr] = value end hash end # Checks equality by comparing each attribute. # @param o [Object] Object to be compared # @!visibility private def ==(o) return true if self.equal?(o) self.class == o.class && _end == o._end && error == o.error && git == o.git && id == o.id && job_id == o.job_id && job_name == o.job_name && level == o.level && metrics == o.metrics && name == o.name && node == o.node && parameters == o.parameters && pipeline_name == o.pipeline_name && pipeline_unique_id == o.pipeline_unique_id && stage_id == o.stage_id && stage_name == o.stage_name && start == o.start && status == o.status && tags == o.tags && url == o.url additional_properties == o.additional_properties end # Calculates hash code according to all attributes. # @return [Integer] Hash code # @!visibility private def hash [_end, error, git, id, job_id, job_name, level, metrics, name, node, parameters, pipeline_name, pipeline_unique_id, stage_id, stage_name, start, status, tags, url].hash end end end