Class: OCI::Devops::Models::SummarizeRepositoryAnalyticsDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/devops/models/summarize_repository_analytics_details.rb

Overview

Details of the user configured settings for viewing the metrics at repository level.

Constant Summary collapse

REPOSITORY_METRICS_ENUM =
[
  REPOSITORY_METRICS_COMMITS = 'COMMITS'.freeze,
  REPOSITORY_METRICS_LINES_ADDED = 'LINES_ADDED'.freeze,
  REPOSITORY_METRICS_LINES_DELETED = 'LINES_DELETED'.freeze,
  REPOSITORY_METRICS_PULL_REQUEST_CREATED = 'PULL_REQUEST_CREATED'.freeze,
  REPOSITORY_METRICS_PULL_REQUEST_MERGED = 'PULL_REQUEST_MERGED'.freeze,
  REPOSITORY_METRICS_PULL_REQUEST_DECLINED = 'PULL_REQUEST_DECLINED'.freeze,
  REPOSITORY_METRICS_PULL_REQUEST_REVIEW_START_DURATION_IN_DAYS = 'PULL_REQUEST_REVIEW_START_DURATION_IN_DAYS'.freeze,
  REPOSITORY_METRICS_PULL_REQUEST_REVIEW_DURATION_IN_DAYS = 'PULL_REQUEST_REVIEW_DURATION_IN_DAYS'.freeze,
  REPOSITORY_METRICS_PULL_REQUEST_APPROVED = 'PULL_REQUEST_APPROVED'.freeze,
  REPOSITORY_METRICS_PULL_REQUEST_REVIEWED = 'PULL_REQUEST_REVIEWED'.freeze,
  REPOSITORY_METRICS_PULL_REQUEST_COMMENTS = 'PULL_REQUEST_COMMENTS'.freeze
].freeze
AGGREGATION_DURATION_ENUM =
[
  AGGREGATION_DURATION_DAILY = 'DAILY'.freeze,
  AGGREGATION_DURATION_WEEKLY = 'WEEKLY'.freeze,
  AGGREGATION_DURATION_MONTHLY = 'MONTHLY'.freeze,
  AGGREGATION_DURATION_YEARLY = 'YEARLY'.freeze
].freeze
GROUP_BY_ENUM =
[
  GROUP_BY_AUTHOR = 'AUTHOR'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SummarizeRepositoryAnalyticsDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :author_email (String)

    The value to assign to the #author_email property

  • :repository_metrics (Array<String>)

    The value to assign to the #repository_metrics property

  • :aggregation_duration (String)

    The value to assign to the #aggregation_duration property

  • :start_time (DateTime)

    The value to assign to the #start_time property

  • :end_time (DateTime)

    The value to assign to the #end_time property

  • :group_by (String)

    The value to assign to the #group_by property



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
133
134
135
136
137
138
# File 'lib/oci/devops/models/summarize_repository_analytics_details.rb', line 100

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

  self.author_email = attributes[:'authorEmail'] if attributes[:'authorEmail']

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

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

  self.repository_metrics = attributes[:'repositoryMetrics'] if attributes[:'repositoryMetrics']

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

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

  self.aggregation_duration = attributes[:'aggregationDuration'] if attributes[:'aggregationDuration']

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

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

  self.start_time = attributes[:'startTime'] if attributes[:'startTime']

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

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

  self.end_time = attributes[:'endTime'] if attributes[:'endTime']

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

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

  self.group_by = attributes[:'groupBy'] if attributes[:'groupBy']

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

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

Instance Attribute Details

#aggregation_durationString

Metrics aggregated for the defined period.

Returns:

  • (String)


46
47
48
# File 'lib/oci/devops/models/summarize_repository_analytics_details.rb', line 46

def aggregation_duration
  @aggregation_duration
end

#author_emailString

Email address of the author.

Returns:

  • (String)


38
39
40
# File 'lib/oci/devops/models/summarize_repository_analytics_details.rb', line 38

def author_email
  @author_email
end

#end_timeDateTime

The end of the metric data query time range.

Returns:

  • (DateTime)


54
55
56
# File 'lib/oci/devops/models/summarize_repository_analytics_details.rb', line 54

def end_time
  @end_time
end

#group_byString

Attribute by which metric data has to be grouped

Returns:

  • (String)


58
59
60
# File 'lib/oci/devops/models/summarize_repository_analytics_details.rb', line 58

def group_by
  @group_by
end

#repository_metricsArray<String>

[Required] The name of the metric to be filtered.

Returns:

  • (Array<String>)


42
43
44
# File 'lib/oci/devops/models/summarize_repository_analytics_details.rb', line 42

def repository_metrics
  @repository_metrics
end

#start_timeDateTime

[Required] The beginning of the metric data query time range.

Returns:

  • (DateTime)


50
51
52
# File 'lib/oci/devops/models/summarize_repository_analytics_details.rb', line 50

def start_time
  @start_time
end

Class Method Details

.attribute_mapObject

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



61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/oci/devops/models/summarize_repository_analytics_details.rb', line 61

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'author_email': :'authorEmail',
    'repository_metrics': :'repositoryMetrics',
    'aggregation_duration': :'aggregationDuration',
    'start_time': :'startTime',
    'end_time': :'endTime',
    'group_by': :'groupBy'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/oci/devops/models/summarize_repository_analytics_details.rb', line 75

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'author_email': :'String',
    'repository_metrics': :'Array<String>',
    'aggregation_duration': :'String',
    'start_time': :'DateTime',
    'end_time': :'DateTime',
    'group_by': :'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



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

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

  self.class == other.class &&
    author_email == other.author_email &&
    repository_metrics == other.repository_metrics &&
    aggregation_duration == other.aggregation_duration &&
    start_time == other.start_time &&
    end_time == other.end_time &&
    group_by == other.group_by
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



213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/oci/devops/models/summarize_repository_analytics_details.rb', line 213

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


193
194
195
# File 'lib/oci/devops/models/summarize_repository_analytics_details.rb', line 193

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



202
203
204
# File 'lib/oci/devops/models/summarize_repository_analytics_details.rb', line 202

def hash
  [author_email, repository_metrics, aggregation_duration, start_time, end_time, group_by].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



246
247
248
249
250
251
252
253
254
255
# File 'lib/oci/devops/models/summarize_repository_analytics_details.rb', line 246

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



240
241
242
# File 'lib/oci/devops/models/summarize_repository_analytics_details.rb', line 240

def to_s
  to_hash.to_s
end