hubspot-api-client 3.3.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/hubspot-api-client.rb +61 -0
- data/lib/hubspot/codegen/cms/audit-logs/api/default_api.rb +106 -0
- data/lib/hubspot/codegen/cms/audit-logs/api_client.rb +422 -0
- data/lib/hubspot/codegen/cms/audit-logs/api_error.rb +61 -0
- data/lib/hubspot/codegen/cms/audit-logs/configuration.rb +258 -0
- data/lib/hubspot/codegen/cms/audit-logs/models/collection_response_public_audit_log.rb +226 -0
- data/lib/hubspot/codegen/cms/audit-logs/models/error.rb +292 -0
- data/lib/hubspot/codegen/cms/audit-logs/models/error_detail.rb +258 -0
- data/lib/hubspot/codegen/cms/audit-logs/models/next_page.rb +224 -0
- data/lib/hubspot/codegen/cms/audit-logs/models/paging.rb +210 -0
- data/lib/hubspot/codegen/cms/audit-logs/models/public_audit_log.rb +352 -0
- data/lib/hubspot/codegen/cms/domains/api/domains_api.rb +183 -0
- data/lib/hubspot/codegen/cms/domains/api_client.rb +422 -0
- data/lib/hubspot/codegen/cms/domains/api_error.rb +61 -0
- data/lib/hubspot/codegen/cms/domains/configuration.rb +258 -0
- data/lib/hubspot/codegen/cms/domains/models/collection_response_with_total_domain.rb +240 -0
- data/lib/hubspot/codegen/cms/domains/models/domain.rb +1091 -0
- data/lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb +497 -0
- data/lib/hubspot/codegen/cms/domains/models/domain_setup_info.rb +231 -0
- data/lib/hubspot/codegen/cms/domains/models/error.rb +292 -0
- data/lib/hubspot/codegen/cms/domains/models/error_detail.rb +258 -0
- data/lib/hubspot/codegen/cms/domains/models/next_page.rb +224 -0
- data/lib/hubspot/codegen/cms/domains/models/paging.rb +210 -0
- data/lib/hubspot/codegen/cms/performance/api/default_api.rb +186 -0
- data/lib/hubspot/codegen/cms/performance/api_client.rb +422 -0
- data/lib/hubspot/codegen/cms/performance/api_error.rb +61 -0
- data/lib/hubspot/codegen/cms/performance/configuration.rb +258 -0
- data/lib/hubspot/codegen/cms/performance/models/error.rb +292 -0
- data/lib/hubspot/codegen/cms/performance/models/error_detail.rb +258 -0
- data/lib/hubspot/codegen/cms/performance/models/performance_view.rb +528 -0
- data/lib/hubspot/codegen/cms/performance/models/public_performance_response.rb +332 -0
- data/lib/hubspot/codegen/cms/site-search/api/default_api.rb +225 -0
- data/lib/hubspot/codegen/cms/site-search/api_client.rb +422 -0
- data/lib/hubspot/codegen/cms/site-search/api_error.rb +61 -0
- data/lib/hubspot/codegen/cms/site-search/configuration.rb +258 -0
- data/lib/hubspot/codegen/cms/site-search/models/content_search_result.rb +427 -0
- data/lib/hubspot/codegen/cms/site-search/models/error.rb +292 -0
- data/lib/hubspot/codegen/cms/site-search/models/error_detail.rb +258 -0
- data/lib/hubspot/codegen/cms/site-search/models/indexed_data.rb +279 -0
- data/lib/hubspot/codegen/cms/site-search/models/public_search_results.rb +282 -0
- data/lib/hubspot/codegen/cms/site-search/models/search_hit_field.rb +257 -0
- data/lib/hubspot/codegen/cms/url-redirects/api/redirects_api.rb +368 -0
- data/lib/hubspot/codegen/cms/url-redirects/api_client.rb +422 -0
- data/lib/hubspot/codegen/cms/url-redirects/api_error.rb +61 -0
- data/lib/hubspot/codegen/cms/url-redirects/configuration.rb +258 -0
- data/lib/hubspot/codegen/cms/url-redirects/models/collection_response_with_total_url_mapping.rb +242 -0
- data/lib/hubspot/codegen/cms/url-redirects/models/error.rb +292 -0
- data/lib/hubspot/codegen/cms/url-redirects/models/error_detail.rb +258 -0
- data/lib/hubspot/codegen/cms/url-redirects/models/next_page.rb +224 -0
- data/lib/hubspot/codegen/cms/url-redirects/models/paging.rb +210 -0
- data/lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb +596 -0
- data/lib/hubspot/codegen/cms/url-redirects/models/url_mapping_create_request_body.rb +306 -0
- data/lib/hubspot/version.rb +1 -1
- data/sample-apps/search-result-paging-app/.env.template +4 -0
- data/sample-apps/search-result-paging-app/.gitignore +35 -0
- data/sample-apps/search-result-paging-app/.rspec +1 -0
- data/sample-apps/search-result-paging-app/.ruby-version +1 -0
- data/sample-apps/search-result-paging-app/Dockerfile +22 -0
- data/sample-apps/search-result-paging-app/Gemfile +35 -0
- data/sample-apps/search-result-paging-app/Gemfile.lock +279 -0
- data/sample-apps/search-result-paging-app/README.md +0 -0
- data/sample-apps/search-result-paging-app/Rakefile +6 -0
- data/sample-apps/search-result-paging-app/app/assets/config/manifest.js +3 -0
- data/sample-apps/search-result-paging-app/app/assets/images/.keep +0 -0
- data/sample-apps/search-result-paging-app/app/assets/javascripts/application.js +25 -0
- data/sample-apps/search-result-paging-app/app/assets/javascripts/cable.js +13 -0
- data/sample-apps/search-result-paging-app/app/assets/javascripts/channels/.keep +0 -0
- data/sample-apps/search-result-paging-app/app/assets/stylesheets/application.css +77 -0
- data/sample-apps/search-result-paging-app/app/controllers/application_controller.rb +12 -0
- data/sample-apps/search-result-paging-app/app/controllers/concerns/.keep +0 -0
- data/sample-apps/search-result-paging-app/app/controllers/concerns/exception_handler.rb +12 -0
- data/sample-apps/search-result-paging-app/app/controllers/home_controller.rb +14 -0
- data/sample-apps/search-result-paging-app/app/controllers/oauth/authorization_controller.rb +19 -0
- data/sample-apps/search-result-paging-app/app/helpers/application_helper.rb +2 -0
- data/sample-apps/search-result-paging-app/app/lib/services/hubspot/authorization/authorize.rb +17 -0
- data/sample-apps/search-result-paging-app/app/lib/services/hubspot/authorization/get_authorization_uri.rb +35 -0
- data/sample-apps/search-result-paging-app/app/lib/services/hubspot/authorization/tokens/base.rb +21 -0
- data/sample-apps/search-result-paging-app/app/lib/services/hubspot/authorization/tokens/generate.rb +28 -0
- data/sample-apps/search-result-paging-app/app/lib/services/hubspot/authorization/tokens/refresh.rb +35 -0
- data/sample-apps/search-result-paging-app/app/lib/services/hubspot/contacts/get_page.rb +26 -0
- data/sample-apps/search-result-paging-app/app/lib/services/hubspot/contacts/search.rb +35 -0
- data/sample-apps/search-result-paging-app/app/lib/services/hubspot/properties/create.rb +23 -0
- data/sample-apps/search-result-paging-app/app/lib/services/hubspot/properties/destroy.rb +16 -0
- data/sample-apps/search-result-paging-app/app/models/application_record.rb +3 -0
- data/sample-apps/search-result-paging-app/app/models/concerns/.keep +0 -0
- data/sample-apps/search-result-paging-app/app/views/home/index.html.erb +13 -0
- data/sample-apps/search-result-paging-app/app/views/layouts/application.html.erb +23 -0
- data/sample-apps/search-result-paging-app/app/views/oauth/authorization/login.html.erb +15 -0
- data/sample-apps/search-result-paging-app/app/views/shared/_header.html.erb +18 -0
- data/sample-apps/search-result-paging-app/bin/bundle +3 -0
- data/sample-apps/search-result-paging-app/bin/rails +9 -0
- data/sample-apps/search-result-paging-app/bin/rake +9 -0
- data/sample-apps/search-result-paging-app/bin/setup +36 -0
- data/sample-apps/search-result-paging-app/bin/spring +17 -0
- data/sample-apps/search-result-paging-app/bin/update +31 -0
- data/sample-apps/search-result-paging-app/bin/yarn +11 -0
- data/sample-apps/search-result-paging-app/config.ru +5 -0
- data/sample-apps/search-result-paging-app/config/application.rb +19 -0
- data/sample-apps/search-result-paging-app/config/boot.rb +3 -0
- data/sample-apps/search-result-paging-app/config/cable.yml +10 -0
- data/sample-apps/search-result-paging-app/config/database.yml +25 -0
- data/sample-apps/search-result-paging-app/config/environment.rb +5 -0
- data/sample-apps/search-result-paging-app/config/environments/development.rb +61 -0
- data/sample-apps/search-result-paging-app/config/environments/production.rb +94 -0
- data/sample-apps/search-result-paging-app/config/environments/test.rb +46 -0
- data/sample-apps/search-result-paging-app/config/initializers/assets.rb +14 -0
- data/sample-apps/search-result-paging-app/config/initializers/filter_parameter_logging.rb +4 -0
- data/sample-apps/search-result-paging-app/config/initializers/hubspot-api-client.rb +3 -0
- data/sample-apps/search-result-paging-app/config/initializers/mime_types.rb +1 -0
- data/sample-apps/search-result-paging-app/config/initializers/wrap_parameters.rb +14 -0
- data/sample-apps/search-result-paging-app/config/locales/en.yml +33 -0
- data/sample-apps/search-result-paging-app/config/puma.rb +34 -0
- data/sample-apps/search-result-paging-app/config/routes.rb +7 -0
- data/sample-apps/search-result-paging-app/config/spring.rb +6 -0
- data/sample-apps/search-result-paging-app/db/seeds.rb +7 -0
- data/sample-apps/search-result-paging-app/docker-compose.yml +11 -0
- data/sample-apps/search-result-paging-app/docker-entrypoint.sh +8 -0
- data/sample-apps/search-result-paging-app/lib/assets/.keep +0 -0
- data/sample-apps/search-result-paging-app/lib/tasks/.keep +0 -0
- data/sample-apps/search-result-paging-app/lib/tasks/search_contacts.rake +36 -0
- data/sample-apps/search-result-paging-app/log/.keep +0 -0
- data/sample-apps/search-result-paging-app/package.json +5 -0
- data/sample-apps/search-result-paging-app/public/404.html +67 -0
- data/sample-apps/search-result-paging-app/public/422.html +67 -0
- data/sample-apps/search-result-paging-app/public/500.html +66 -0
- data/sample-apps/search-result-paging-app/public/apple-touch-icon-precomposed.png +0 -0
- data/sample-apps/search-result-paging-app/public/apple-touch-icon.png +0 -0
- data/sample-apps/search-result-paging-app/public/favicon.ico +0 -0
- data/sample-apps/search-result-paging-app/public/robots.txt +1 -0
- data/sample-apps/search-result-paging-app/tmp/.keep +0 -0
- metadata +309 -2
@@ -0,0 +1,224 @@
|
|
1
|
+
=begin
|
2
|
+
#URL redirects
|
3
|
+
|
4
|
+
#URL redirect operations
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Hubspot
|
16
|
+
module Cms
|
17
|
+
module UrlRedirects
|
18
|
+
class NextPage
|
19
|
+
attr_accessor :after
|
20
|
+
|
21
|
+
attr_accessor :link
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'after' => :'after',
|
27
|
+
:'link' => :'link'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Attribute type mapping.
|
32
|
+
def self.openapi_types
|
33
|
+
{
|
34
|
+
:'after' => :'String',
|
35
|
+
:'link' => :'String'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Cms::UrlRedirects::NextPage` initialize method"
|
50
|
+
end
|
51
|
+
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Cms::UrlRedirects::NextPage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:'after')
|
61
|
+
self.after = attributes[:'after']
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.key?(:'link')
|
65
|
+
self.link = attributes[:'link']
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
70
|
+
# @return Array for valid properties with the reasons
|
71
|
+
def list_invalid_properties
|
72
|
+
invalid_properties = Array.new
|
73
|
+
if @after.nil?
|
74
|
+
invalid_properties.push('invalid value for "after", after cannot be nil.')
|
75
|
+
end
|
76
|
+
|
77
|
+
invalid_properties
|
78
|
+
end
|
79
|
+
|
80
|
+
# Check to see if the all the properties in the model are valid
|
81
|
+
# @return true if the model is valid
|
82
|
+
def valid?
|
83
|
+
return false if @after.nil?
|
84
|
+
true
|
85
|
+
end
|
86
|
+
|
87
|
+
# Checks equality by comparing each attribute.
|
88
|
+
# @param [Object] Object to be compared
|
89
|
+
def ==(o)
|
90
|
+
return true if self.equal?(o)
|
91
|
+
self.class == o.class &&
|
92
|
+
after == o.after &&
|
93
|
+
link == o.link
|
94
|
+
end
|
95
|
+
|
96
|
+
# @see the `==` method
|
97
|
+
# @param [Object] Object to be compared
|
98
|
+
def eql?(o)
|
99
|
+
self == o
|
100
|
+
end
|
101
|
+
|
102
|
+
# Calculates hash code according to all attributes.
|
103
|
+
# @return [Integer] Hash code
|
104
|
+
def hash
|
105
|
+
[after, link].hash
|
106
|
+
end
|
107
|
+
|
108
|
+
# Builds the object from hash
|
109
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
110
|
+
# @return [Object] Returns the model itself
|
111
|
+
def self.build_from_hash(attributes)
|
112
|
+
new.build_from_hash(attributes)
|
113
|
+
end
|
114
|
+
|
115
|
+
# Builds the object from hash
|
116
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
117
|
+
# @return [Object] Returns the model itself
|
118
|
+
def build_from_hash(attributes)
|
119
|
+
return nil unless attributes.is_a?(Hash)
|
120
|
+
self.class.openapi_types.each_pair do |key, type|
|
121
|
+
if type =~ /\AArray<(.*)>/i
|
122
|
+
# check to ensure the input is an array given that the attribute
|
123
|
+
# is documented as an array but the input is not
|
124
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
125
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
126
|
+
end
|
127
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
128
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
129
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
130
|
+
end
|
131
|
+
|
132
|
+
self
|
133
|
+
end
|
134
|
+
|
135
|
+
# Deserializes the data based on type
|
136
|
+
# @param string type Data type
|
137
|
+
# @param string value Value to be deserialized
|
138
|
+
# @return [Object] Deserialized data
|
139
|
+
def _deserialize(type, value)
|
140
|
+
case type.to_sym
|
141
|
+
when :DateTime
|
142
|
+
DateTime.parse(value)
|
143
|
+
when :Date
|
144
|
+
Date.parse(value)
|
145
|
+
when :String
|
146
|
+
value.to_s
|
147
|
+
when :Integer
|
148
|
+
value.to_i
|
149
|
+
when :Float
|
150
|
+
value.to_f
|
151
|
+
when :Boolean
|
152
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
153
|
+
true
|
154
|
+
else
|
155
|
+
false
|
156
|
+
end
|
157
|
+
when :Object
|
158
|
+
# generic object (usually a Hash), return directly
|
159
|
+
value
|
160
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
161
|
+
inner_type = Regexp.last_match[:inner_type]
|
162
|
+
value.map { |v| _deserialize(inner_type, v) }
|
163
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
164
|
+
k_type = Regexp.last_match[:k_type]
|
165
|
+
v_type = Regexp.last_match[:v_type]
|
166
|
+
{}.tap do |hash|
|
167
|
+
value.each do |k, v|
|
168
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
else # model
|
172
|
+
Hubspot::Cms::UrlRedirects.const_get(type).build_from_hash(value)
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
# Returns the string representation of the object
|
177
|
+
# @return [String] String presentation of the object
|
178
|
+
def to_s
|
179
|
+
to_hash.to_s
|
180
|
+
end
|
181
|
+
|
182
|
+
# to_body is an alias to to_hash (backward compatibility)
|
183
|
+
# @return [Hash] Returns the object in the form of hash
|
184
|
+
def to_body
|
185
|
+
to_hash
|
186
|
+
end
|
187
|
+
|
188
|
+
# Returns the object in the form of hash
|
189
|
+
# @return [Hash] Returns the object in the form of hash
|
190
|
+
def to_hash
|
191
|
+
hash = {}
|
192
|
+
self.class.attribute_map.each_pair do |attr, param|
|
193
|
+
value = self.send(attr)
|
194
|
+
if value.nil?
|
195
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
196
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
197
|
+
end
|
198
|
+
|
199
|
+
hash[param] = _to_hash(value)
|
200
|
+
end
|
201
|
+
hash
|
202
|
+
end
|
203
|
+
|
204
|
+
# Outputs non-array value in the form of hash
|
205
|
+
# For object, use to_hash. Otherwise, just return the value
|
206
|
+
# @param [Object] value Any valid value
|
207
|
+
# @return [Hash] Returns the value in the form of hash
|
208
|
+
def _to_hash(value)
|
209
|
+
if value.is_a?(Array)
|
210
|
+
value.compact.map { |v| _to_hash(v) }
|
211
|
+
elsif value.is_a?(Hash)
|
212
|
+
{}.tap do |hash|
|
213
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
214
|
+
end
|
215
|
+
elsif value.respond_to? :to_hash
|
216
|
+
value.to_hash
|
217
|
+
else
|
218
|
+
value
|
219
|
+
end
|
220
|
+
end
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|
@@ -0,0 +1,210 @@
|
|
1
|
+
=begin
|
2
|
+
#URL redirects
|
3
|
+
|
4
|
+
#URL redirect operations
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Hubspot
|
16
|
+
module Cms
|
17
|
+
module UrlRedirects
|
18
|
+
class Paging
|
19
|
+
attr_accessor :_next
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'_next' => :'next'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# Attribute type mapping.
|
29
|
+
def self.openapi_types
|
30
|
+
{
|
31
|
+
:'_next' => :'NextPage'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# List of attributes with nullable: true
|
36
|
+
def self.openapi_nullable
|
37
|
+
Set.new([
|
38
|
+
])
|
39
|
+
end
|
40
|
+
|
41
|
+
# Initializes the object
|
42
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
43
|
+
def initialize(attributes = {})
|
44
|
+
if (!attributes.is_a?(Hash))
|
45
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Cms::UrlRedirects::Paging` initialize method"
|
46
|
+
end
|
47
|
+
|
48
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
49
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
50
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
51
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Cms::UrlRedirects::Paging`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
52
|
+
end
|
53
|
+
h[k.to_sym] = v
|
54
|
+
}
|
55
|
+
|
56
|
+
if attributes.key?(:'_next')
|
57
|
+
self._next = attributes[:'_next']
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
62
|
+
# @return Array for valid properties with the reasons
|
63
|
+
def list_invalid_properties
|
64
|
+
invalid_properties = Array.new
|
65
|
+
invalid_properties
|
66
|
+
end
|
67
|
+
|
68
|
+
# Check to see if the all the properties in the model are valid
|
69
|
+
# @return true if the model is valid
|
70
|
+
def valid?
|
71
|
+
true
|
72
|
+
end
|
73
|
+
|
74
|
+
# Checks equality by comparing each attribute.
|
75
|
+
# @param [Object] Object to be compared
|
76
|
+
def ==(o)
|
77
|
+
return true if self.equal?(o)
|
78
|
+
self.class == o.class &&
|
79
|
+
_next == o._next
|
80
|
+
end
|
81
|
+
|
82
|
+
# @see the `==` method
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def eql?(o)
|
85
|
+
self == o
|
86
|
+
end
|
87
|
+
|
88
|
+
# Calculates hash code according to all attributes.
|
89
|
+
# @return [Integer] Hash code
|
90
|
+
def hash
|
91
|
+
[_next].hash
|
92
|
+
end
|
93
|
+
|
94
|
+
# Builds the object from hash
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
96
|
+
# @return [Object] Returns the model itself
|
97
|
+
def self.build_from_hash(attributes)
|
98
|
+
new.build_from_hash(attributes)
|
99
|
+
end
|
100
|
+
|
101
|
+
# Builds the object from hash
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
103
|
+
# @return [Object] Returns the model itself
|
104
|
+
def build_from_hash(attributes)
|
105
|
+
return nil unless attributes.is_a?(Hash)
|
106
|
+
self.class.openapi_types.each_pair do |key, type|
|
107
|
+
if type =~ /\AArray<(.*)>/i
|
108
|
+
# check to ensure the input is an array given that the attribute
|
109
|
+
# is documented as an array but the input is not
|
110
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
111
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
112
|
+
end
|
113
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
114
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
115
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
116
|
+
end
|
117
|
+
|
118
|
+
self
|
119
|
+
end
|
120
|
+
|
121
|
+
# Deserializes the data based on type
|
122
|
+
# @param string type Data type
|
123
|
+
# @param string value Value to be deserialized
|
124
|
+
# @return [Object] Deserialized data
|
125
|
+
def _deserialize(type, value)
|
126
|
+
case type.to_sym
|
127
|
+
when :DateTime
|
128
|
+
DateTime.parse(value)
|
129
|
+
when :Date
|
130
|
+
Date.parse(value)
|
131
|
+
when :String
|
132
|
+
value.to_s
|
133
|
+
when :Integer
|
134
|
+
value.to_i
|
135
|
+
when :Float
|
136
|
+
value.to_f
|
137
|
+
when :Boolean
|
138
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
139
|
+
true
|
140
|
+
else
|
141
|
+
false
|
142
|
+
end
|
143
|
+
when :Object
|
144
|
+
# generic object (usually a Hash), return directly
|
145
|
+
value
|
146
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
147
|
+
inner_type = Regexp.last_match[:inner_type]
|
148
|
+
value.map { |v| _deserialize(inner_type, v) }
|
149
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
150
|
+
k_type = Regexp.last_match[:k_type]
|
151
|
+
v_type = Regexp.last_match[:v_type]
|
152
|
+
{}.tap do |hash|
|
153
|
+
value.each do |k, v|
|
154
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
else # model
|
158
|
+
Hubspot::Cms::UrlRedirects.const_get(type).build_from_hash(value)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
# Returns the string representation of the object
|
163
|
+
# @return [String] String presentation of the object
|
164
|
+
def to_s
|
165
|
+
to_hash.to_s
|
166
|
+
end
|
167
|
+
|
168
|
+
# to_body is an alias to to_hash (backward compatibility)
|
169
|
+
# @return [Hash] Returns the object in the form of hash
|
170
|
+
def to_body
|
171
|
+
to_hash
|
172
|
+
end
|
173
|
+
|
174
|
+
# Returns the object in the form of hash
|
175
|
+
# @return [Hash] Returns the object in the form of hash
|
176
|
+
def to_hash
|
177
|
+
hash = {}
|
178
|
+
self.class.attribute_map.each_pair do |attr, param|
|
179
|
+
value = self.send(attr)
|
180
|
+
if value.nil?
|
181
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
182
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
183
|
+
end
|
184
|
+
|
185
|
+
hash[param] = _to_hash(value)
|
186
|
+
end
|
187
|
+
hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Outputs non-array value in the form of hash
|
191
|
+
# For object, use to_hash. Otherwise, just return the value
|
192
|
+
# @param [Object] value Any valid value
|
193
|
+
# @return [Hash] Returns the value in the form of hash
|
194
|
+
def _to_hash(value)
|
195
|
+
if value.is_a?(Array)
|
196
|
+
value.compact.map { |v| _to_hash(v) }
|
197
|
+
elsif value.is_a?(Hash)
|
198
|
+
{}.tap do |hash|
|
199
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
200
|
+
end
|
201
|
+
elsif value.respond_to? :to_hash
|
202
|
+
value.to_hash
|
203
|
+
else
|
204
|
+
value
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
@@ -0,0 +1,596 @@
|
|
1
|
+
=begin
|
2
|
+
#URL redirects
|
3
|
+
|
4
|
+
#URL redirect operations
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Hubspot
|
16
|
+
module Cms
|
17
|
+
module UrlRedirects
|
18
|
+
class UrlMapping
|
19
|
+
# The unique ID of this URL redirect.
|
20
|
+
attr_accessor :id
|
21
|
+
|
22
|
+
attr_accessor :portal_id
|
23
|
+
|
24
|
+
attr_accessor :created
|
25
|
+
|
26
|
+
attr_accessor :updated
|
27
|
+
|
28
|
+
attr_accessor :created_by_id
|
29
|
+
|
30
|
+
attr_accessor :updated_by_id
|
31
|
+
|
32
|
+
# The target incoming URL, path, or pattern to match for redirection.
|
33
|
+
attr_accessor :route_prefix
|
34
|
+
|
35
|
+
# The destination URL, where the target URL should be redirected if it matches the `routePrefix`.
|
36
|
+
attr_accessor :destination
|
37
|
+
|
38
|
+
# The type of redirect to create. Options include: 301 (permanent), 302 (temporary), or 305 (proxy). Find more details [here](https://knowledge.hubspot.com/cos-general/how-to-redirect-a-hubspot-page).
|
39
|
+
attr_accessor :redirect_style
|
40
|
+
|
41
|
+
attr_accessor :content_group_id
|
42
|
+
|
43
|
+
# Whether the URL redirect mapping should apply only if a live page on the URL isn't found. If False, the URL redirect mapping will take precedence over any existing page.
|
44
|
+
attr_accessor :is_only_after_not_found
|
45
|
+
|
46
|
+
attr_accessor :is_regex
|
47
|
+
|
48
|
+
# Whether the `routePrefix` should match on the entire URL, including the domain.
|
49
|
+
attr_accessor :is_match_full_url
|
50
|
+
|
51
|
+
# Whether the `routePrefix` should match on the entire URL path, including the query string.
|
52
|
+
attr_accessor :is_match_query_string
|
53
|
+
|
54
|
+
# Whether the `routePrefix` should match based on pattern.
|
55
|
+
attr_accessor :is_pattern
|
56
|
+
|
57
|
+
# Whether a trailing slash will be ignored.
|
58
|
+
attr_accessor :is_trailing_slash_optional
|
59
|
+
|
60
|
+
# Whether the `routePrefix` should match both HTTP and HTTPS protocols.
|
61
|
+
attr_accessor :is_protocol_agnostic
|
62
|
+
|
63
|
+
attr_accessor :name
|
64
|
+
|
65
|
+
# Used to prioritize URL redirection. If a given URL matches more than one redirect, the one with the **lower** precedence will be used.
|
66
|
+
attr_accessor :precedence
|
67
|
+
|
68
|
+
attr_accessor :deleted_at
|
69
|
+
|
70
|
+
attr_accessor :note
|
71
|
+
|
72
|
+
attr_accessor :label
|
73
|
+
|
74
|
+
attr_accessor :internally_created
|
75
|
+
|
76
|
+
attr_accessor :cos_object_type
|
77
|
+
|
78
|
+
attr_accessor :cdn_purge_embargo_time
|
79
|
+
|
80
|
+
class EnumAttributeValidator
|
81
|
+
attr_reader :datatype
|
82
|
+
attr_reader :allowable_values
|
83
|
+
|
84
|
+
def initialize(datatype, allowable_values)
|
85
|
+
@allowable_values = allowable_values.map do |value|
|
86
|
+
case datatype.to_s
|
87
|
+
when /Integer/i
|
88
|
+
value.to_i
|
89
|
+
when /Float/i
|
90
|
+
value.to_f
|
91
|
+
else
|
92
|
+
value
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def valid?(value)
|
98
|
+
!value || allowable_values.include?(value)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
103
|
+
def self.attribute_map
|
104
|
+
{
|
105
|
+
:'id' => :'id',
|
106
|
+
:'portal_id' => :'portalId',
|
107
|
+
:'created' => :'created',
|
108
|
+
:'updated' => :'updated',
|
109
|
+
:'created_by_id' => :'createdById',
|
110
|
+
:'updated_by_id' => :'updatedById',
|
111
|
+
:'route_prefix' => :'routePrefix',
|
112
|
+
:'destination' => :'destination',
|
113
|
+
:'redirect_style' => :'redirectStyle',
|
114
|
+
:'content_group_id' => :'contentGroupId',
|
115
|
+
:'is_only_after_not_found' => :'isOnlyAfterNotFound',
|
116
|
+
:'is_regex' => :'isRegex',
|
117
|
+
:'is_match_full_url' => :'isMatchFullUrl',
|
118
|
+
:'is_match_query_string' => :'isMatchQueryString',
|
119
|
+
:'is_pattern' => :'isPattern',
|
120
|
+
:'is_trailing_slash_optional' => :'isTrailingSlashOptional',
|
121
|
+
:'is_protocol_agnostic' => :'isProtocolAgnostic',
|
122
|
+
:'name' => :'name',
|
123
|
+
:'precedence' => :'precedence',
|
124
|
+
:'deleted_at' => :'deletedAt',
|
125
|
+
:'note' => :'note',
|
126
|
+
:'label' => :'label',
|
127
|
+
:'internally_created' => :'internallyCreated',
|
128
|
+
:'cos_object_type' => :'cosObjectType',
|
129
|
+
:'cdn_purge_embargo_time' => :'cdnPurgeEmbargoTime'
|
130
|
+
}
|
131
|
+
end
|
132
|
+
|
133
|
+
# Attribute type mapping.
|
134
|
+
def self.openapi_types
|
135
|
+
{
|
136
|
+
:'id' => :'Integer',
|
137
|
+
:'portal_id' => :'Integer',
|
138
|
+
:'created' => :'Integer',
|
139
|
+
:'updated' => :'Integer',
|
140
|
+
:'created_by_id' => :'Integer',
|
141
|
+
:'updated_by_id' => :'Integer',
|
142
|
+
:'route_prefix' => :'String',
|
143
|
+
:'destination' => :'String',
|
144
|
+
:'redirect_style' => :'Integer',
|
145
|
+
:'content_group_id' => :'Integer',
|
146
|
+
:'is_only_after_not_found' => :'Boolean',
|
147
|
+
:'is_regex' => :'Boolean',
|
148
|
+
:'is_match_full_url' => :'Boolean',
|
149
|
+
:'is_match_query_string' => :'Boolean',
|
150
|
+
:'is_pattern' => :'Boolean',
|
151
|
+
:'is_trailing_slash_optional' => :'Boolean',
|
152
|
+
:'is_protocol_agnostic' => :'Boolean',
|
153
|
+
:'name' => :'String',
|
154
|
+
:'precedence' => :'Integer',
|
155
|
+
:'deleted_at' => :'Integer',
|
156
|
+
:'note' => :'String',
|
157
|
+
:'label' => :'String',
|
158
|
+
:'internally_created' => :'Boolean',
|
159
|
+
:'cos_object_type' => :'String',
|
160
|
+
:'cdn_purge_embargo_time' => :'Integer'
|
161
|
+
}
|
162
|
+
end
|
163
|
+
|
164
|
+
# List of attributes with nullable: true
|
165
|
+
def self.openapi_nullable
|
166
|
+
Set.new([
|
167
|
+
])
|
168
|
+
end
|
169
|
+
|
170
|
+
# Initializes the object
|
171
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
172
|
+
def initialize(attributes = {})
|
173
|
+
if (!attributes.is_a?(Hash))
|
174
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Cms::UrlRedirects::UrlMapping` initialize method"
|
175
|
+
end
|
176
|
+
|
177
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
178
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
179
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
180
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Cms::UrlRedirects::UrlMapping`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
181
|
+
end
|
182
|
+
h[k.to_sym] = v
|
183
|
+
}
|
184
|
+
|
185
|
+
if attributes.key?(:'id')
|
186
|
+
self.id = attributes[:'id']
|
187
|
+
end
|
188
|
+
|
189
|
+
if attributes.key?(:'portal_id')
|
190
|
+
self.portal_id = attributes[:'portal_id']
|
191
|
+
end
|
192
|
+
|
193
|
+
if attributes.key?(:'created')
|
194
|
+
self.created = attributes[:'created']
|
195
|
+
end
|
196
|
+
|
197
|
+
if attributes.key?(:'updated')
|
198
|
+
self.updated = attributes[:'updated']
|
199
|
+
end
|
200
|
+
|
201
|
+
if attributes.key?(:'created_by_id')
|
202
|
+
self.created_by_id = attributes[:'created_by_id']
|
203
|
+
end
|
204
|
+
|
205
|
+
if attributes.key?(:'updated_by_id')
|
206
|
+
self.updated_by_id = attributes[:'updated_by_id']
|
207
|
+
end
|
208
|
+
|
209
|
+
if attributes.key?(:'route_prefix')
|
210
|
+
self.route_prefix = attributes[:'route_prefix']
|
211
|
+
end
|
212
|
+
|
213
|
+
if attributes.key?(:'destination')
|
214
|
+
self.destination = attributes[:'destination']
|
215
|
+
end
|
216
|
+
|
217
|
+
if attributes.key?(:'redirect_style')
|
218
|
+
self.redirect_style = attributes[:'redirect_style']
|
219
|
+
end
|
220
|
+
|
221
|
+
if attributes.key?(:'content_group_id')
|
222
|
+
self.content_group_id = attributes[:'content_group_id']
|
223
|
+
end
|
224
|
+
|
225
|
+
if attributes.key?(:'is_only_after_not_found')
|
226
|
+
self.is_only_after_not_found = attributes[:'is_only_after_not_found']
|
227
|
+
end
|
228
|
+
|
229
|
+
if attributes.key?(:'is_regex')
|
230
|
+
self.is_regex = attributes[:'is_regex']
|
231
|
+
end
|
232
|
+
|
233
|
+
if attributes.key?(:'is_match_full_url')
|
234
|
+
self.is_match_full_url = attributes[:'is_match_full_url']
|
235
|
+
end
|
236
|
+
|
237
|
+
if attributes.key?(:'is_match_query_string')
|
238
|
+
self.is_match_query_string = attributes[:'is_match_query_string']
|
239
|
+
end
|
240
|
+
|
241
|
+
if attributes.key?(:'is_pattern')
|
242
|
+
self.is_pattern = attributes[:'is_pattern']
|
243
|
+
end
|
244
|
+
|
245
|
+
if attributes.key?(:'is_trailing_slash_optional')
|
246
|
+
self.is_trailing_slash_optional = attributes[:'is_trailing_slash_optional']
|
247
|
+
end
|
248
|
+
|
249
|
+
if attributes.key?(:'is_protocol_agnostic')
|
250
|
+
self.is_protocol_agnostic = attributes[:'is_protocol_agnostic']
|
251
|
+
end
|
252
|
+
|
253
|
+
if attributes.key?(:'name')
|
254
|
+
self.name = attributes[:'name']
|
255
|
+
end
|
256
|
+
|
257
|
+
if attributes.key?(:'precedence')
|
258
|
+
self.precedence = attributes[:'precedence']
|
259
|
+
end
|
260
|
+
|
261
|
+
if attributes.key?(:'deleted_at')
|
262
|
+
self.deleted_at = attributes[:'deleted_at']
|
263
|
+
end
|
264
|
+
|
265
|
+
if attributes.key?(:'note')
|
266
|
+
self.note = attributes[:'note']
|
267
|
+
end
|
268
|
+
|
269
|
+
if attributes.key?(:'label')
|
270
|
+
self.label = attributes[:'label']
|
271
|
+
end
|
272
|
+
|
273
|
+
if attributes.key?(:'internally_created')
|
274
|
+
self.internally_created = attributes[:'internally_created']
|
275
|
+
end
|
276
|
+
|
277
|
+
if attributes.key?(:'cos_object_type')
|
278
|
+
self.cos_object_type = attributes[:'cos_object_type']
|
279
|
+
end
|
280
|
+
|
281
|
+
if attributes.key?(:'cdn_purge_embargo_time')
|
282
|
+
self.cdn_purge_embargo_time = attributes[:'cdn_purge_embargo_time']
|
283
|
+
end
|
284
|
+
end
|
285
|
+
|
286
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
287
|
+
# @return Array for valid properties with the reasons
|
288
|
+
def list_invalid_properties
|
289
|
+
invalid_properties = Array.new
|
290
|
+
if @id.nil?
|
291
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
292
|
+
end
|
293
|
+
|
294
|
+
if @portal_id.nil?
|
295
|
+
invalid_properties.push('invalid value for "portal_id", portal_id cannot be nil.')
|
296
|
+
end
|
297
|
+
|
298
|
+
if @created.nil?
|
299
|
+
invalid_properties.push('invalid value for "created", created cannot be nil.')
|
300
|
+
end
|
301
|
+
|
302
|
+
if @updated.nil?
|
303
|
+
invalid_properties.push('invalid value for "updated", updated cannot be nil.')
|
304
|
+
end
|
305
|
+
|
306
|
+
if @created_by_id.nil?
|
307
|
+
invalid_properties.push('invalid value for "created_by_id", created_by_id cannot be nil.')
|
308
|
+
end
|
309
|
+
|
310
|
+
if @updated_by_id.nil?
|
311
|
+
invalid_properties.push('invalid value for "updated_by_id", updated_by_id cannot be nil.')
|
312
|
+
end
|
313
|
+
|
314
|
+
if @route_prefix.nil?
|
315
|
+
invalid_properties.push('invalid value for "route_prefix", route_prefix cannot be nil.')
|
316
|
+
end
|
317
|
+
|
318
|
+
if @destination.nil?
|
319
|
+
invalid_properties.push('invalid value for "destination", destination cannot be nil.')
|
320
|
+
end
|
321
|
+
|
322
|
+
if @redirect_style.nil?
|
323
|
+
invalid_properties.push('invalid value for "redirect_style", redirect_style cannot be nil.')
|
324
|
+
end
|
325
|
+
|
326
|
+
if @content_group_id.nil?
|
327
|
+
invalid_properties.push('invalid value for "content_group_id", content_group_id cannot be nil.')
|
328
|
+
end
|
329
|
+
|
330
|
+
if @is_only_after_not_found.nil?
|
331
|
+
invalid_properties.push('invalid value for "is_only_after_not_found", is_only_after_not_found cannot be nil.')
|
332
|
+
end
|
333
|
+
|
334
|
+
if @is_regex.nil?
|
335
|
+
invalid_properties.push('invalid value for "is_regex", is_regex cannot be nil.')
|
336
|
+
end
|
337
|
+
|
338
|
+
if @is_match_full_url.nil?
|
339
|
+
invalid_properties.push('invalid value for "is_match_full_url", is_match_full_url cannot be nil.')
|
340
|
+
end
|
341
|
+
|
342
|
+
if @is_match_query_string.nil?
|
343
|
+
invalid_properties.push('invalid value for "is_match_query_string", is_match_query_string cannot be nil.')
|
344
|
+
end
|
345
|
+
|
346
|
+
if @is_pattern.nil?
|
347
|
+
invalid_properties.push('invalid value for "is_pattern", is_pattern cannot be nil.')
|
348
|
+
end
|
349
|
+
|
350
|
+
if @is_trailing_slash_optional.nil?
|
351
|
+
invalid_properties.push('invalid value for "is_trailing_slash_optional", is_trailing_slash_optional cannot be nil.')
|
352
|
+
end
|
353
|
+
|
354
|
+
if @is_protocol_agnostic.nil?
|
355
|
+
invalid_properties.push('invalid value for "is_protocol_agnostic", is_protocol_agnostic cannot be nil.')
|
356
|
+
end
|
357
|
+
|
358
|
+
if @name.nil?
|
359
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
360
|
+
end
|
361
|
+
|
362
|
+
if @precedence.nil?
|
363
|
+
invalid_properties.push('invalid value for "precedence", precedence cannot be nil.')
|
364
|
+
end
|
365
|
+
|
366
|
+
if @deleted_at.nil?
|
367
|
+
invalid_properties.push('invalid value for "deleted_at", deleted_at cannot be nil.')
|
368
|
+
end
|
369
|
+
|
370
|
+
if @note.nil?
|
371
|
+
invalid_properties.push('invalid value for "note", note cannot be nil.')
|
372
|
+
end
|
373
|
+
|
374
|
+
if @label.nil?
|
375
|
+
invalid_properties.push('invalid value for "label", label cannot be nil.')
|
376
|
+
end
|
377
|
+
|
378
|
+
if @internally_created.nil?
|
379
|
+
invalid_properties.push('invalid value for "internally_created", internally_created cannot be nil.')
|
380
|
+
end
|
381
|
+
|
382
|
+
if @cos_object_type.nil?
|
383
|
+
invalid_properties.push('invalid value for "cos_object_type", cos_object_type cannot be nil.')
|
384
|
+
end
|
385
|
+
|
386
|
+
if @cdn_purge_embargo_time.nil?
|
387
|
+
invalid_properties.push('invalid value for "cdn_purge_embargo_time", cdn_purge_embargo_time cannot be nil.')
|
388
|
+
end
|
389
|
+
|
390
|
+
invalid_properties
|
391
|
+
end
|
392
|
+
|
393
|
+
# Check to see if the all the properties in the model are valid
|
394
|
+
# @return true if the model is valid
|
395
|
+
def valid?
|
396
|
+
return false if @id.nil?
|
397
|
+
return false if @portal_id.nil?
|
398
|
+
return false if @created.nil?
|
399
|
+
return false if @updated.nil?
|
400
|
+
return false if @created_by_id.nil?
|
401
|
+
return false if @updated_by_id.nil?
|
402
|
+
return false if @route_prefix.nil?
|
403
|
+
return false if @destination.nil?
|
404
|
+
return false if @redirect_style.nil?
|
405
|
+
return false if @content_group_id.nil?
|
406
|
+
return false if @is_only_after_not_found.nil?
|
407
|
+
return false if @is_regex.nil?
|
408
|
+
return false if @is_match_full_url.nil?
|
409
|
+
return false if @is_match_query_string.nil?
|
410
|
+
return false if @is_pattern.nil?
|
411
|
+
return false if @is_trailing_slash_optional.nil?
|
412
|
+
return false if @is_protocol_agnostic.nil?
|
413
|
+
return false if @name.nil?
|
414
|
+
return false if @precedence.nil?
|
415
|
+
return false if @deleted_at.nil?
|
416
|
+
return false if @note.nil?
|
417
|
+
return false if @label.nil?
|
418
|
+
return false if @internally_created.nil?
|
419
|
+
return false if @cos_object_type.nil?
|
420
|
+
cos_object_type_validator = EnumAttributeValidator.new('String', ["CONTENT", "EXTENSION_RESOURCE", "LAYOUT", "CUSTOM_WIDGET", "WIDGET", "FORM", "PLACEMENT", "IMAGE", "DOMAIN_SETTINGS", "SITE_SETTINGS", "EMAIL_ADDRESS", "WORKFLOW", "HUBDB_TABLE", "REDIRECT_URL", "DESIGN_FOLDER", "SITE_MAP", "DOMAIN", "BLOG", "FILE", "FOLDER", "SITE_MENU", "THEME", "CONTENT_GROUP", "FOLLOW_ME", "KNOWLEDGE_BASE", "LIST_MEMBERSHIP", "CONTACT_MEMBERSHIP", "PASSWORD_PROTECTED", "UNRESTRICTED_ACCESS", "MARKETPLACE_LISTING", "LAYOUT_SECTION", "THEME_SETTINGS", "VIDEO_PLAYER", "URL_MAPPING", "KNOWLEDGE_CATEGORY", "KNOWLEDGE_HOMEPAGE_CATEGORY", "RAW_ASSET", "GLOBAL_CONTENT", "HUBDB_TABLE_ROW", "BLOG_AUTHOR", "SERVERLESS_FUNCTION", "KNOWLEDGE_CATEGORY_TRANSLATION"])
|
421
|
+
return false unless cos_object_type_validator.valid?(@cos_object_type)
|
422
|
+
return false if @cdn_purge_embargo_time.nil?
|
423
|
+
true
|
424
|
+
end
|
425
|
+
|
426
|
+
# Custom attribute writer method checking allowed values (enum).
|
427
|
+
# @param [Object] cos_object_type Object to be assigned
|
428
|
+
def cos_object_type=(cos_object_type)
|
429
|
+
validator = EnumAttributeValidator.new('String', ["CONTENT", "EXTENSION_RESOURCE", "LAYOUT", "CUSTOM_WIDGET", "WIDGET", "FORM", "PLACEMENT", "IMAGE", "DOMAIN_SETTINGS", "SITE_SETTINGS", "EMAIL_ADDRESS", "WORKFLOW", "HUBDB_TABLE", "REDIRECT_URL", "DESIGN_FOLDER", "SITE_MAP", "DOMAIN", "BLOG", "FILE", "FOLDER", "SITE_MENU", "THEME", "CONTENT_GROUP", "FOLLOW_ME", "KNOWLEDGE_BASE", "LIST_MEMBERSHIP", "CONTACT_MEMBERSHIP", "PASSWORD_PROTECTED", "UNRESTRICTED_ACCESS", "MARKETPLACE_LISTING", "LAYOUT_SECTION", "THEME_SETTINGS", "VIDEO_PLAYER", "URL_MAPPING", "KNOWLEDGE_CATEGORY", "KNOWLEDGE_HOMEPAGE_CATEGORY", "RAW_ASSET", "GLOBAL_CONTENT", "HUBDB_TABLE_ROW", "BLOG_AUTHOR", "SERVERLESS_FUNCTION", "KNOWLEDGE_CATEGORY_TRANSLATION"])
|
430
|
+
unless validator.valid?(cos_object_type)
|
431
|
+
fail ArgumentError, "invalid value for \"cos_object_type\", must be one of #{validator.allowable_values}."
|
432
|
+
end
|
433
|
+
@cos_object_type = cos_object_type
|
434
|
+
end
|
435
|
+
|
436
|
+
# Checks equality by comparing each attribute.
|
437
|
+
# @param [Object] Object to be compared
|
438
|
+
def ==(o)
|
439
|
+
return true if self.equal?(o)
|
440
|
+
self.class == o.class &&
|
441
|
+
id == o.id &&
|
442
|
+
portal_id == o.portal_id &&
|
443
|
+
created == o.created &&
|
444
|
+
updated == o.updated &&
|
445
|
+
created_by_id == o.created_by_id &&
|
446
|
+
updated_by_id == o.updated_by_id &&
|
447
|
+
route_prefix == o.route_prefix &&
|
448
|
+
destination == o.destination &&
|
449
|
+
redirect_style == o.redirect_style &&
|
450
|
+
content_group_id == o.content_group_id &&
|
451
|
+
is_only_after_not_found == o.is_only_after_not_found &&
|
452
|
+
is_regex == o.is_regex &&
|
453
|
+
is_match_full_url == o.is_match_full_url &&
|
454
|
+
is_match_query_string == o.is_match_query_string &&
|
455
|
+
is_pattern == o.is_pattern &&
|
456
|
+
is_trailing_slash_optional == o.is_trailing_slash_optional &&
|
457
|
+
is_protocol_agnostic == o.is_protocol_agnostic &&
|
458
|
+
name == o.name &&
|
459
|
+
precedence == o.precedence &&
|
460
|
+
deleted_at == o.deleted_at &&
|
461
|
+
note == o.note &&
|
462
|
+
label == o.label &&
|
463
|
+
internally_created == o.internally_created &&
|
464
|
+
cos_object_type == o.cos_object_type &&
|
465
|
+
cdn_purge_embargo_time == o.cdn_purge_embargo_time
|
466
|
+
end
|
467
|
+
|
468
|
+
# @see the `==` method
|
469
|
+
# @param [Object] Object to be compared
|
470
|
+
def eql?(o)
|
471
|
+
self == o
|
472
|
+
end
|
473
|
+
|
474
|
+
# Calculates hash code according to all attributes.
|
475
|
+
# @return [Integer] Hash code
|
476
|
+
def hash
|
477
|
+
[id, portal_id, created, updated, created_by_id, updated_by_id, route_prefix, destination, redirect_style, content_group_id, is_only_after_not_found, is_regex, is_match_full_url, is_match_query_string, is_pattern, is_trailing_slash_optional, is_protocol_agnostic, name, precedence, deleted_at, note, label, internally_created, cos_object_type, cdn_purge_embargo_time].hash
|
478
|
+
end
|
479
|
+
|
480
|
+
# Builds the object from hash
|
481
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
482
|
+
# @return [Object] Returns the model itself
|
483
|
+
def self.build_from_hash(attributes)
|
484
|
+
new.build_from_hash(attributes)
|
485
|
+
end
|
486
|
+
|
487
|
+
# Builds the object from hash
|
488
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
489
|
+
# @return [Object] Returns the model itself
|
490
|
+
def build_from_hash(attributes)
|
491
|
+
return nil unless attributes.is_a?(Hash)
|
492
|
+
self.class.openapi_types.each_pair do |key, type|
|
493
|
+
if type =~ /\AArray<(.*)>/i
|
494
|
+
# check to ensure the input is an array given that the attribute
|
495
|
+
# is documented as an array but the input is not
|
496
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
497
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
498
|
+
end
|
499
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
500
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
501
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
502
|
+
end
|
503
|
+
|
504
|
+
self
|
505
|
+
end
|
506
|
+
|
507
|
+
# Deserializes the data based on type
|
508
|
+
# @param string type Data type
|
509
|
+
# @param string value Value to be deserialized
|
510
|
+
# @return [Object] Deserialized data
|
511
|
+
def _deserialize(type, value)
|
512
|
+
case type.to_sym
|
513
|
+
when :DateTime
|
514
|
+
DateTime.parse(value)
|
515
|
+
when :Date
|
516
|
+
Date.parse(value)
|
517
|
+
when :String
|
518
|
+
value.to_s
|
519
|
+
when :Integer
|
520
|
+
value.to_i
|
521
|
+
when :Float
|
522
|
+
value.to_f
|
523
|
+
when :Boolean
|
524
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
525
|
+
true
|
526
|
+
else
|
527
|
+
false
|
528
|
+
end
|
529
|
+
when :Object
|
530
|
+
# generic object (usually a Hash), return directly
|
531
|
+
value
|
532
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
533
|
+
inner_type = Regexp.last_match[:inner_type]
|
534
|
+
value.map { |v| _deserialize(inner_type, v) }
|
535
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
536
|
+
k_type = Regexp.last_match[:k_type]
|
537
|
+
v_type = Regexp.last_match[:v_type]
|
538
|
+
{}.tap do |hash|
|
539
|
+
value.each do |k, v|
|
540
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
541
|
+
end
|
542
|
+
end
|
543
|
+
else # model
|
544
|
+
Hubspot::Cms::UrlRedirects.const_get(type).build_from_hash(value)
|
545
|
+
end
|
546
|
+
end
|
547
|
+
|
548
|
+
# Returns the string representation of the object
|
549
|
+
# @return [String] String presentation of the object
|
550
|
+
def to_s
|
551
|
+
to_hash.to_s
|
552
|
+
end
|
553
|
+
|
554
|
+
# to_body is an alias to to_hash (backward compatibility)
|
555
|
+
# @return [Hash] Returns the object in the form of hash
|
556
|
+
def to_body
|
557
|
+
to_hash
|
558
|
+
end
|
559
|
+
|
560
|
+
# Returns the object in the form of hash
|
561
|
+
# @return [Hash] Returns the object in the form of hash
|
562
|
+
def to_hash
|
563
|
+
hash = {}
|
564
|
+
self.class.attribute_map.each_pair do |attr, param|
|
565
|
+
value = self.send(attr)
|
566
|
+
if value.nil?
|
567
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
568
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
569
|
+
end
|
570
|
+
|
571
|
+
hash[param] = _to_hash(value)
|
572
|
+
end
|
573
|
+
hash
|
574
|
+
end
|
575
|
+
|
576
|
+
# Outputs non-array value in the form of hash
|
577
|
+
# For object, use to_hash. Otherwise, just return the value
|
578
|
+
# @param [Object] value Any valid value
|
579
|
+
# @return [Hash] Returns the value in the form of hash
|
580
|
+
def _to_hash(value)
|
581
|
+
if value.is_a?(Array)
|
582
|
+
value.compact.map { |v| _to_hash(v) }
|
583
|
+
elsif value.is_a?(Hash)
|
584
|
+
{}.tap do |hash|
|
585
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
586
|
+
end
|
587
|
+
elsif value.respond_to? :to_hash
|
588
|
+
value.to_hash
|
589
|
+
else
|
590
|
+
value
|
591
|
+
end
|
592
|
+
end
|
593
|
+
end
|
594
|
+
end
|
595
|
+
end
|
596
|
+
end
|