Skip to content

Commit c92be9d

Browse files
Merge pull request #230 from HubSpot/feature/codegen
Webhooks client regeneration
2 parents c93dd5d + 0cd0934 commit c92be9d

3 files changed

Lines changed: 22 additions & 22 deletions

File tree

lib/hubspot/codegen/webhooks/models/error_category.rb

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
module Hubspot
1717
module Webhooks
1818
class ErrorCategory
19-
attr_accessor :http_status
20-
2119
attr_accessor :name
2220

21+
attr_accessor :http_status
22+
2323
class EnumAttributeValidator
2424
attr_reader :datatype
2525
attr_reader :allowable_values
@@ -45,8 +45,8 @@ def valid?(value)
4545
# Attribute mapping from ruby-style variable name to JSON key.
4646
def self.attribute_map
4747
{
48-
:'http_status' => :'httpStatus',
49-
:'name' => :'name'
48+
:'name' => :'name',
49+
:'http_status' => :'httpStatus'
5050
}
5151
end
5252

@@ -58,8 +58,8 @@ def self.acceptable_attributes
5858
# Attribute type mapping.
5959
def self.openapi_types
6060
{
61-
:'http_status' => :'String',
62-
:'name' => :'String'
61+
:'name' => :'String',
62+
:'http_status' => :'String'
6363
}
6464
end
6565

@@ -84,37 +84,37 @@ def initialize(attributes = {})
8484
h[k.to_sym] = v
8585
}
8686

87-
if attributes.key?(:'http_status')
88-
self.http_status = attributes[:'http_status']
89-
end
90-
9187
if attributes.key?(:'name')
9288
self.name = attributes[:'name']
9389
end
90+
91+
if attributes.key?(:'http_status')
92+
self.http_status = attributes[:'http_status']
93+
end
9494
end
9595

9696
# Show invalid properties with the reasons. Usually used together with valid?
9797
# @return Array for valid properties with the reasons
9898
def list_invalid_properties
9999
invalid_properties = Array.new
100-
if @http_status.nil?
101-
invalid_properties.push('invalid value for "http_status", http_status cannot be nil.')
102-
end
103-
104100
if @name.nil?
105101
invalid_properties.push('invalid value for "name", name cannot be nil.')
106102
end
107103

104+
if @http_status.nil?
105+
invalid_properties.push('invalid value for "http_status", http_status cannot be nil.')
106+
end
107+
108108
invalid_properties
109109
end
110110

111111
# Check to see if the all the properties in the model are valid
112112
# @return true if the model is valid
113113
def valid?
114+
return false if @name.nil?
114115
return false if @http_status.nil?
115116
http_status_validator = EnumAttributeValidator.new('String', ["CONTINUE", "SWITCHING_PROTOCOLS", "PROCESSING", "OK", "CREATED", "ACCEPTED", "NON_AUTHORITATIVE_INFORMATION", "NO_CONTENT", "RESET_CONTENT", "PARTIAL_CONTENT", "MULTI_STATUS", "ALREADY_REPORTED", "IM_USED", "MULTIPLE_CHOICES", "MOVED_PERMANENTLY", "FOUND", "SEE_OTHER", "NOT_MODIFIED", "USE_PROXY", "TEMPORARY_REDIRECT", "PERMANENT_REDIRECT", "BAD_REQUEST", "UNAUTHORIZED", "PAYMENT_REQUIRED", "FORBIDDEN", "NOT_FOUND", "METHOD_NOT_ALLOWED", "NOT_ACCEPTABLE", "PROXY_AUTHENTICATION_REQUIRED", "REQUEST_TIMEOUT", "CONFLICT", "GONE", "LENGTH_REQUIRED", "PRECONDITION_FAILED", "REQUEST_ENTITY_TOO_LARGE", "REQUEST_URI_TOO_LONG", "UNSUPPORTED_MEDIA_TYPE", "REQUESTED_RANGE_NOT_SATISFIABLE", "EXPECTATION_FAILED", "IM_A_TEAPOT", "MISDIRECTED_REQUEST", "UNPROCESSABLE_ENTITY", "LOCKED", "FAILED_DEPENDENCY", "UPGRADE_REQUIRED", "PRECONDITION_REQUIRED", "TOO_MANY_REQUESTS", "REQUEST_HEADERS_FIELDS_TOO_LARGE", "INTERNAL_STALE_SERVICE_DISCOVERY", "UNAVAILABLE_FOR_LEGAL_REASONS", "MIGRATION_IN_PROGRESS", "INTERNAL_SERVER_ERROR", "NOT_IMPLEMENTED", "BAD_GATEWAY", "SERVICE_UNAVAILABLE", "GATEWAY_TIMEOUT", "HTTP_VERSION_NOT_SUPPORTED", "VARIANT_ALSO_NEGOTIATES", "INSUFFICIENT_STORAGE", "LOOP_DETECTED", "NOT_EXTENDED", "NETWORK_AUTHENTICATION_REQUIRED"])
116117
return false unless http_status_validator.valid?(@http_status)
117-
return false if @name.nil?
118118
true
119119
end
120120

@@ -133,8 +133,8 @@ def http_status=(http_status)
133133
def ==(o)
134134
return true if self.equal?(o)
135135
self.class == o.class &&
136-
http_status == o.http_status &&
137-
name == o.name
136+
name == o.name &&
137+
http_status == o.http_status
138138
end
139139

140140
# @see the `==` method
@@ -146,7 +146,7 @@ def eql?(o)
146146
# Calculates hash code according to all attributes.
147147
# @return [Integer] Hash code
148148
def hash
149-
[http_status, name].hash
149+
[name, http_status].hash
150150
end
151151

152152
# Builds the object from hash

lib/hubspot/codegen/webhooks/models/subscription_create_request.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,15 @@ def list_invalid_properties
119119
# @return true if the model is valid
120120
def valid?
121121
return false if @event_type.nil?
122-
event_type_validator = EnumAttributeValidator.new('String', ["contact.propertyChange", "company.propertyChange", "deal.propertyChange", "ticket.propertyChange", "product.propertyChange", "line_item.propertyChange", "contact.creation", "contact.deletion", "contact.privacyDeletion", "company.creation", "company.deletion", "deal.creation", "deal.deletion", "ticket.creation", "ticket.deletion", "product.creation", "product.deletion", "line_item.creation", "line_item.deletion", "conversation.creation", "conversation.deletion", "conversation.newMessage", "conversation.privacyDeletion", "conversation.propertyChange"])
122+
event_type_validator = EnumAttributeValidator.new('String', ["contact.propertyChange", "company.propertyChange", "deal.propertyChange", "ticket.propertyChange", "product.propertyChange", "line_item.propertyChange", "contact.creation", "contact.deletion", "contact.privacyDeletion", "company.creation", "company.deletion", "deal.creation", "deal.deletion", "ticket.creation", "ticket.deletion", "product.creation", "product.deletion", "line_item.creation", "line_item.deletion", "conversation.creation", "conversation.deletion", "conversation.newMessage", "conversation.privacyDeletion", "conversation.propertyChange", "contact.merge", "company.merge", "deal.merge", "ticket.merge", "product.merge", "line_item.merge", "contact.restore", "company.restore", "deal.restore", "ticket.restore", "product.restore", "line_item.restore", "contact.associationChange", "company.associationChange", "deal.associationChange", "ticket.associationChange", "line_item.associationChange"])
123123
return false unless event_type_validator.valid?(@event_type)
124124
true
125125
end
126126

127127
# Custom attribute writer method checking allowed values (enum).
128128
# @param [Object] event_type Object to be assigned
129129
def event_type=(event_type)
130-
validator = EnumAttributeValidator.new('String', ["contact.propertyChange", "company.propertyChange", "deal.propertyChange", "ticket.propertyChange", "product.propertyChange", "line_item.propertyChange", "contact.creation", "contact.deletion", "contact.privacyDeletion", "company.creation", "company.deletion", "deal.creation", "deal.deletion", "ticket.creation", "ticket.deletion", "product.creation", "product.deletion", "line_item.creation", "line_item.deletion", "conversation.creation", "conversation.deletion", "conversation.newMessage", "conversation.privacyDeletion", "conversation.propertyChange"])
130+
validator = EnumAttributeValidator.new('String', ["contact.propertyChange", "company.propertyChange", "deal.propertyChange", "ticket.propertyChange", "product.propertyChange", "line_item.propertyChange", "contact.creation", "contact.deletion", "contact.privacyDeletion", "company.creation", "company.deletion", "deal.creation", "deal.deletion", "ticket.creation", "ticket.deletion", "product.creation", "product.deletion", "line_item.creation", "line_item.deletion", "conversation.creation", "conversation.deletion", "conversation.newMessage", "conversation.privacyDeletion", "conversation.propertyChange", "contact.merge", "company.merge", "deal.merge", "ticket.merge", "product.merge", "line_item.merge", "contact.restore", "company.restore", "deal.restore", "ticket.restore", "product.restore", "line_item.restore", "contact.associationChange", "company.associationChange", "deal.associationChange", "ticket.associationChange", "line_item.associationChange"])
131131
unless validator.valid?(event_type)
132132
fail ArgumentError, "invalid value for \"event_type\", must be one of #{validator.allowable_values}."
133133
end

lib/hubspot/codegen/webhooks/models/subscription_response.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def list_invalid_properties
158158
# @return true if the model is valid
159159
def valid?
160160
return false if @event_type.nil?
161-
event_type_validator = EnumAttributeValidator.new('String', ["contact.propertyChange", "company.propertyChange", "deal.propertyChange", "ticket.propertyChange", "product.propertyChange", "line_item.propertyChange", "contact.creation", "contact.deletion", "contact.privacyDeletion", "company.creation", "company.deletion", "deal.creation", "deal.deletion", "ticket.creation", "ticket.deletion", "product.creation", "product.deletion", "line_item.creation", "line_item.deletion", "conversation.creation", "conversation.deletion", "conversation.newMessage", "conversation.privacyDeletion", "conversation.propertyChange"])
161+
event_type_validator = EnumAttributeValidator.new('String', ["contact.propertyChange", "company.propertyChange", "deal.propertyChange", "ticket.propertyChange", "product.propertyChange", "line_item.propertyChange", "contact.creation", "contact.deletion", "contact.privacyDeletion", "company.creation", "company.deletion", "deal.creation", "deal.deletion", "ticket.creation", "ticket.deletion", "product.creation", "product.deletion", "line_item.creation", "line_item.deletion", "conversation.creation", "conversation.deletion", "conversation.newMessage", "conversation.privacyDeletion", "conversation.propertyChange", "contact.merge", "company.merge", "deal.merge", "ticket.merge", "product.merge", "line_item.merge", "contact.restore", "company.restore", "deal.restore", "ticket.restore", "product.restore", "line_item.restore", "contact.associationChange", "company.associationChange", "deal.associationChange", "ticket.associationChange", "line_item.associationChange"])
162162
return false unless event_type_validator.valid?(@event_type)
163163
return false if @active.nil?
164164
return false if @id.nil?
@@ -169,7 +169,7 @@ def valid?
169169
# Custom attribute writer method checking allowed values (enum).
170170
# @param [Object] event_type Object to be assigned
171171
def event_type=(event_type)
172-
validator = EnumAttributeValidator.new('String', ["contact.propertyChange", "company.propertyChange", "deal.propertyChange", "ticket.propertyChange", "product.propertyChange", "line_item.propertyChange", "contact.creation", "contact.deletion", "contact.privacyDeletion", "company.creation", "company.deletion", "deal.creation", "deal.deletion", "ticket.creation", "ticket.deletion", "product.creation", "product.deletion", "line_item.creation", "line_item.deletion", "conversation.creation", "conversation.deletion", "conversation.newMessage", "conversation.privacyDeletion", "conversation.propertyChange"])
172+
validator = EnumAttributeValidator.new('String', ["contact.propertyChange", "company.propertyChange", "deal.propertyChange", "ticket.propertyChange", "product.propertyChange", "line_item.propertyChange", "contact.creation", "contact.deletion", "contact.privacyDeletion", "company.creation", "company.deletion", "deal.creation", "deal.deletion", "ticket.creation", "ticket.deletion", "product.creation", "product.deletion", "line_item.creation", "line_item.deletion", "conversation.creation", "conversation.deletion", "conversation.newMessage", "conversation.privacyDeletion", "conversation.propertyChange", "contact.merge", "company.merge", "deal.merge", "ticket.merge", "product.merge", "line_item.merge", "contact.restore", "company.restore", "deal.restore", "ticket.restore", "product.restore", "line_item.restore", "contact.associationChange", "company.associationChange", "deal.associationChange", "ticket.associationChange", "line_item.associationChange"])
173173
unless validator.valid?(event_type)
174174
fail ArgumentError, "invalid value for \"event_type\", must be one of #{validator.allowable_values}."
175175
end

0 commit comments

Comments
 (0)