lib/hubspot/codegen/oauth/models/error.rb in hubspot-api-client-2.0.0 vs lib/hubspot/codegen/oauth/models/error.rb in hubspot-api-client-2.1.0
- old
+ new
@@ -4,28 +4,31 @@
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: v1
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 4.2.2
+OpenAPI Generator version: 4.2.3
=end
require 'date'
module Hubspot
module OAuth
- class Error
+ class Error
# A human readable message describing the error along with remediation steps where appropriate
attr_accessor :message
# A unique identifier for the request. Include this value with any error reports or support tickets
attr_accessor :correlation_id
# The error category
attr_accessor :category
+ # A specific category that contains more specific detail about the error
+ attr_accessor :sub_category
+
# further information about the error
attr_accessor :errors
# Context about the error condition
attr_accessor :context
@@ -37,10 +40,11 @@
def self.attribute_map
{
:'message' => :'message',
:'correlation_id' => :'correlationId',
:'category' => :'category',
+ :'sub_category' => :'subCategory',
:'errors' => :'errors',
:'context' => :'context',
:'links' => :'links'
}
end
@@ -49,10 +53,11 @@
def self.openapi_types
{
:'message' => :'String',
:'correlation_id' => :'String',
:'category' => :'String',
+ :'sub_category' => :'String',
:'errors' => :'Array<ErrorDetail>',
:'context' => :'Hash<String, Array<String>>',
:'links' => :'Hash<String, String>'
}
end
@@ -88,10 +93,14 @@
if attributes.key?(:'category')
self.category = attributes[:'category']
end
+ if attributes.key?(:'sub_category')
+ self.sub_category = attributes[:'sub_category']
+ end
+
if attributes.key?(:'errors')
if (value = attributes[:'errors']).is_a?(Array)
self.errors = value
end
end
@@ -119,15 +128,10 @@
if @correlation_id.nil?
invalid_properties.push('invalid value for "correlation_id", correlation_id cannot be nil.')
end
- pattern = Regexp.new(/[a-zA-Z0-9]{32}/)
- if @correlation_id !~ pattern
- invalid_properties.push("invalid value for \"correlation_id\", must conform to the pattern #{pattern}.")
- end
-
if @category.nil?
invalid_properties.push('invalid value for "category", category cannot be nil.')
end
invalid_properties
@@ -136,38 +140,23 @@
# Check to see if the all the properties in the model are valid
# @return true if the model is valid
def valid?
return false if @message.nil?
return false if @correlation_id.nil?
- return false if @correlation_id !~ Regexp.new(/[a-zA-Z0-9]{32}/)
return false if @category.nil?
true
end
- # Custom attribute writer method with validation
- # @param [Object] correlation_id Value to be assigned
- def correlation_id=(correlation_id)
- if correlation_id.nil?
- fail ArgumentError, 'correlation_id cannot be nil'
- end
-
- pattern = Regexp.new(/[a-zA-Z0-9]{32}/)
- if correlation_id !~ pattern
- fail ArgumentError, "invalid value for \"correlation_id\", must conform to the pattern #{pattern}."
- end
-
- @correlation_id = correlation_id
- end
-
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
message == o.message &&
correlation_id == o.correlation_id &&
category == o.category &&
+ sub_category == o.sub_category &&
errors == o.errors &&
context == o.context &&
links == o.links
end
@@ -178,11 +167,11 @@
end
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [message, correlation_id, category, errors, context, links].hash
+ [message, correlation_id, category, sub_category, errors, context, links].hash
end
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself
@@ -296,6 +285,6 @@
value
end
end
end
end
-end
\ No newline at end of file
+end