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,258 @@
|
|
1
|
+
=begin
|
2
|
+
#CMS Performance API
|
3
|
+
|
4
|
+
#Use these endpoints to get a time series view of your website's performance.
|
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 Performance
|
18
|
+
class ErrorDetail
|
19
|
+
# A human readable message describing the error along with remediation steps where appropriate
|
20
|
+
attr_accessor :message
|
21
|
+
|
22
|
+
# The name of the field or parameter in which the error was found.
|
23
|
+
attr_accessor :_in
|
24
|
+
|
25
|
+
# The status code associated with the error detail
|
26
|
+
attr_accessor :code
|
27
|
+
|
28
|
+
# A specific category that contains more specific detail about the error
|
29
|
+
attr_accessor :sub_category
|
30
|
+
|
31
|
+
# Context about the error condition
|
32
|
+
attr_accessor :context
|
33
|
+
|
34
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
35
|
+
def self.attribute_map
|
36
|
+
{
|
37
|
+
:'message' => :'message',
|
38
|
+
:'_in' => :'in',
|
39
|
+
:'code' => :'code',
|
40
|
+
:'sub_category' => :'subCategory',
|
41
|
+
:'context' => :'context'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Attribute type mapping.
|
46
|
+
def self.openapi_types
|
47
|
+
{
|
48
|
+
:'message' => :'String',
|
49
|
+
:'_in' => :'String',
|
50
|
+
:'code' => :'String',
|
51
|
+
:'sub_category' => :'String',
|
52
|
+
:'context' => :'Hash<String, Array<String>>'
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# List of attributes with nullable: true
|
57
|
+
def self.openapi_nullable
|
58
|
+
Set.new([
|
59
|
+
])
|
60
|
+
end
|
61
|
+
|
62
|
+
# Initializes the object
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
64
|
+
def initialize(attributes = {})
|
65
|
+
if (!attributes.is_a?(Hash))
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Cms::Performance::ErrorDetail` initialize method"
|
67
|
+
end
|
68
|
+
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
71
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Cms::Performance::ErrorDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
73
|
+
end
|
74
|
+
h[k.to_sym] = v
|
75
|
+
}
|
76
|
+
|
77
|
+
if attributes.key?(:'message')
|
78
|
+
self.message = attributes[:'message']
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes.key?(:'_in')
|
82
|
+
self._in = attributes[:'_in']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.key?(:'code')
|
86
|
+
self.code = attributes[:'code']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.key?(:'sub_category')
|
90
|
+
self.sub_category = attributes[:'sub_category']
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.key?(:'context')
|
94
|
+
if (value = attributes[:'context']).is_a?(Hash)
|
95
|
+
self.context = value
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
101
|
+
# @return Array for valid properties with the reasons
|
102
|
+
def list_invalid_properties
|
103
|
+
invalid_properties = Array.new
|
104
|
+
if @message.nil?
|
105
|
+
invalid_properties.push('invalid value for "message", message cannot be nil.')
|
106
|
+
end
|
107
|
+
|
108
|
+
invalid_properties
|
109
|
+
end
|
110
|
+
|
111
|
+
# Check to see if the all the properties in the model are valid
|
112
|
+
# @return true if the model is valid
|
113
|
+
def valid?
|
114
|
+
return false if @message.nil?
|
115
|
+
true
|
116
|
+
end
|
117
|
+
|
118
|
+
# Checks equality by comparing each attribute.
|
119
|
+
# @param [Object] Object to be compared
|
120
|
+
def ==(o)
|
121
|
+
return true if self.equal?(o)
|
122
|
+
self.class == o.class &&
|
123
|
+
message == o.message &&
|
124
|
+
_in == o._in &&
|
125
|
+
code == o.code &&
|
126
|
+
sub_category == o.sub_category &&
|
127
|
+
context == o.context
|
128
|
+
end
|
129
|
+
|
130
|
+
# @see the `==` method
|
131
|
+
# @param [Object] Object to be compared
|
132
|
+
def eql?(o)
|
133
|
+
self == o
|
134
|
+
end
|
135
|
+
|
136
|
+
# Calculates hash code according to all attributes.
|
137
|
+
# @return [Integer] Hash code
|
138
|
+
def hash
|
139
|
+
[message, _in, code, sub_category, context].hash
|
140
|
+
end
|
141
|
+
|
142
|
+
# Builds the object from hash
|
143
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
144
|
+
# @return [Object] Returns the model itself
|
145
|
+
def self.build_from_hash(attributes)
|
146
|
+
new.build_from_hash(attributes)
|
147
|
+
end
|
148
|
+
|
149
|
+
# Builds the object from hash
|
150
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
151
|
+
# @return [Object] Returns the model itself
|
152
|
+
def build_from_hash(attributes)
|
153
|
+
return nil unless attributes.is_a?(Hash)
|
154
|
+
self.class.openapi_types.each_pair do |key, type|
|
155
|
+
if type =~ /\AArray<(.*)>/i
|
156
|
+
# check to ensure the input is an array given that the attribute
|
157
|
+
# is documented as an array but the input is not
|
158
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
159
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
160
|
+
end
|
161
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
162
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
163
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
164
|
+
end
|
165
|
+
|
166
|
+
self
|
167
|
+
end
|
168
|
+
|
169
|
+
# Deserializes the data based on type
|
170
|
+
# @param string type Data type
|
171
|
+
# @param string value Value to be deserialized
|
172
|
+
# @return [Object] Deserialized data
|
173
|
+
def _deserialize(type, value)
|
174
|
+
case type.to_sym
|
175
|
+
when :DateTime
|
176
|
+
DateTime.parse(value)
|
177
|
+
when :Date
|
178
|
+
Date.parse(value)
|
179
|
+
when :String
|
180
|
+
value.to_s
|
181
|
+
when :Integer
|
182
|
+
value.to_i
|
183
|
+
when :Float
|
184
|
+
value.to_f
|
185
|
+
when :Boolean
|
186
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
187
|
+
true
|
188
|
+
else
|
189
|
+
false
|
190
|
+
end
|
191
|
+
when :Object
|
192
|
+
# generic object (usually a Hash), return directly
|
193
|
+
value
|
194
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
195
|
+
inner_type = Regexp.last_match[:inner_type]
|
196
|
+
value.map { |v| _deserialize(inner_type, v) }
|
197
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
198
|
+
k_type = Regexp.last_match[:k_type]
|
199
|
+
v_type = Regexp.last_match[:v_type]
|
200
|
+
{}.tap do |hash|
|
201
|
+
value.each do |k, v|
|
202
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
203
|
+
end
|
204
|
+
end
|
205
|
+
else # model
|
206
|
+
Hubspot::Cms::Performance.const_get(type).build_from_hash(value)
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
# Returns the string representation of the object
|
211
|
+
# @return [String] String presentation of the object
|
212
|
+
def to_s
|
213
|
+
to_hash.to_s
|
214
|
+
end
|
215
|
+
|
216
|
+
# to_body is an alias to to_hash (backward compatibility)
|
217
|
+
# @return [Hash] Returns the object in the form of hash
|
218
|
+
def to_body
|
219
|
+
to_hash
|
220
|
+
end
|
221
|
+
|
222
|
+
# Returns the object in the form of hash
|
223
|
+
# @return [Hash] Returns the object in the form of hash
|
224
|
+
def to_hash
|
225
|
+
hash = {}
|
226
|
+
self.class.attribute_map.each_pair do |attr, param|
|
227
|
+
value = self.send(attr)
|
228
|
+
if value.nil?
|
229
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
230
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
231
|
+
end
|
232
|
+
|
233
|
+
hash[param] = _to_hash(value)
|
234
|
+
end
|
235
|
+
hash
|
236
|
+
end
|
237
|
+
|
238
|
+
# Outputs non-array value in the form of hash
|
239
|
+
# For object, use to_hash. Otherwise, just return the value
|
240
|
+
# @param [Object] value Any valid value
|
241
|
+
# @return [Hash] Returns the value in the form of hash
|
242
|
+
def _to_hash(value)
|
243
|
+
if value.is_a?(Array)
|
244
|
+
value.compact.map { |v| _to_hash(v) }
|
245
|
+
elsif value.is_a?(Hash)
|
246
|
+
{}.tap do |hash|
|
247
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
248
|
+
end
|
249
|
+
elsif value.respond_to? :to_hash
|
250
|
+
value.to_hash
|
251
|
+
else
|
252
|
+
value
|
253
|
+
end
|
254
|
+
end
|
255
|
+
end
|
256
|
+
end
|
257
|
+
end
|
258
|
+
end
|
@@ -0,0 +1,528 @@
|
|
1
|
+
=begin
|
2
|
+
#CMS Performance API
|
3
|
+
|
4
|
+
#Use these endpoints to get a time series view of your website's performance.
|
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 Performance
|
18
|
+
class PerformanceView
|
19
|
+
# The number of responses that had an http status code of 403.
|
20
|
+
attr_accessor :_403
|
21
|
+
|
22
|
+
# The number of responses that had an http status code of 404.
|
23
|
+
attr_accessor :_404
|
24
|
+
|
25
|
+
# The number of responses that had an http status code of 500.
|
26
|
+
attr_accessor :_500
|
27
|
+
|
28
|
+
# The number of responses that had an http status code of 504.
|
29
|
+
attr_accessor :_504
|
30
|
+
|
31
|
+
# The timestamp in milliseconds of the start of this interval.
|
32
|
+
attr_accessor :start_timestamp
|
33
|
+
|
34
|
+
# The timestamp in milliseconds of the end of this interval.
|
35
|
+
attr_accessor :end_timestamp
|
36
|
+
|
37
|
+
attr_accessor :start_datetime
|
38
|
+
|
39
|
+
attr_accessor :end_datetime
|
40
|
+
|
41
|
+
# The total number of requests received in this period.
|
42
|
+
attr_accessor :total_requests
|
43
|
+
|
44
|
+
# The total number of requests that were served cached responses.
|
45
|
+
attr_accessor :cache_hits
|
46
|
+
|
47
|
+
# The percentage of requests that were served cached responses.
|
48
|
+
attr_accessor :cache_hit_rate
|
49
|
+
|
50
|
+
attr_accessor :total_request_time
|
51
|
+
|
52
|
+
# The average response time in milliseconds from the origin to the edge.
|
53
|
+
attr_accessor :avg_origin_response_time
|
54
|
+
|
55
|
+
# The average response time in milliseconds.
|
56
|
+
attr_accessor :response_time_ms
|
57
|
+
|
58
|
+
# The number of responses that had an http status code between 1000-1999.
|
59
|
+
attr_accessor :_100_x
|
60
|
+
|
61
|
+
# The number of responses that had an http status code between 200-299.
|
62
|
+
attr_accessor :_20_x
|
63
|
+
|
64
|
+
# The number of responses that had an http status code between 300-399.
|
65
|
+
attr_accessor :_30_x
|
66
|
+
|
67
|
+
# The number of responses that had an http status code between 400-499.
|
68
|
+
attr_accessor :_40_x
|
69
|
+
|
70
|
+
# The number of responses that had an http status code between 500-599.
|
71
|
+
attr_accessor :_50_x
|
72
|
+
|
73
|
+
# The 50th percentile response time.
|
74
|
+
attr_accessor :_50th
|
75
|
+
|
76
|
+
# The 95th percentile response time.
|
77
|
+
attr_accessor :_95th
|
78
|
+
|
79
|
+
# The 99th percentile response time.
|
80
|
+
attr_accessor :_99th
|
81
|
+
|
82
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
83
|
+
def self.attribute_map
|
84
|
+
{
|
85
|
+
:'_403' => :'403',
|
86
|
+
:'_404' => :'404',
|
87
|
+
:'_500' => :'500',
|
88
|
+
:'_504' => :'504',
|
89
|
+
:'start_timestamp' => :'startTimestamp',
|
90
|
+
:'end_timestamp' => :'endTimestamp',
|
91
|
+
:'start_datetime' => :'startDatetime',
|
92
|
+
:'end_datetime' => :'endDatetime',
|
93
|
+
:'total_requests' => :'totalRequests',
|
94
|
+
:'cache_hits' => :'cacheHits',
|
95
|
+
:'cache_hit_rate' => :'cacheHitRate',
|
96
|
+
:'total_request_time' => :'totalRequestTime',
|
97
|
+
:'avg_origin_response_time' => :'avgOriginResponseTime',
|
98
|
+
:'response_time_ms' => :'responseTimeMs',
|
99
|
+
:'_100_x' => :'100X',
|
100
|
+
:'_20_x' => :'20X',
|
101
|
+
:'_30_x' => :'30X',
|
102
|
+
:'_40_x' => :'40X',
|
103
|
+
:'_50_x' => :'50X',
|
104
|
+
:'_50th' => :'50th',
|
105
|
+
:'_95th' => :'95th',
|
106
|
+
:'_99th' => :'99th'
|
107
|
+
}
|
108
|
+
end
|
109
|
+
|
110
|
+
# Attribute type mapping.
|
111
|
+
def self.openapi_types
|
112
|
+
{
|
113
|
+
:'_403' => :'Integer',
|
114
|
+
:'_404' => :'Integer',
|
115
|
+
:'_500' => :'Integer',
|
116
|
+
:'_504' => :'Integer',
|
117
|
+
:'start_timestamp' => :'Integer',
|
118
|
+
:'end_timestamp' => :'Integer',
|
119
|
+
:'start_datetime' => :'String',
|
120
|
+
:'end_datetime' => :'String',
|
121
|
+
:'total_requests' => :'Integer',
|
122
|
+
:'cache_hits' => :'Integer',
|
123
|
+
:'cache_hit_rate' => :'Float',
|
124
|
+
:'total_request_time' => :'Integer',
|
125
|
+
:'avg_origin_response_time' => :'Integer',
|
126
|
+
:'response_time_ms' => :'Integer',
|
127
|
+
:'_100_x' => :'Integer',
|
128
|
+
:'_20_x' => :'Integer',
|
129
|
+
:'_30_x' => :'Integer',
|
130
|
+
:'_40_x' => :'Integer',
|
131
|
+
:'_50_x' => :'Integer',
|
132
|
+
:'_50th' => :'Integer',
|
133
|
+
:'_95th' => :'Integer',
|
134
|
+
:'_99th' => :'Integer'
|
135
|
+
}
|
136
|
+
end
|
137
|
+
|
138
|
+
# List of attributes with nullable: true
|
139
|
+
def self.openapi_nullable
|
140
|
+
Set.new([
|
141
|
+
])
|
142
|
+
end
|
143
|
+
|
144
|
+
# Initializes the object
|
145
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
146
|
+
def initialize(attributes = {})
|
147
|
+
if (!attributes.is_a?(Hash))
|
148
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Cms::Performance::PerformanceView` initialize method"
|
149
|
+
end
|
150
|
+
|
151
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
152
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
153
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
154
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Cms::Performance::PerformanceView`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
155
|
+
end
|
156
|
+
h[k.to_sym] = v
|
157
|
+
}
|
158
|
+
|
159
|
+
if attributes.key?(:'_403')
|
160
|
+
self._403 = attributes[:'_403']
|
161
|
+
end
|
162
|
+
|
163
|
+
if attributes.key?(:'_404')
|
164
|
+
self._404 = attributes[:'_404']
|
165
|
+
end
|
166
|
+
|
167
|
+
if attributes.key?(:'_500')
|
168
|
+
self._500 = attributes[:'_500']
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.key?(:'_504')
|
172
|
+
self._504 = attributes[:'_504']
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.key?(:'start_timestamp')
|
176
|
+
self.start_timestamp = attributes[:'start_timestamp']
|
177
|
+
end
|
178
|
+
|
179
|
+
if attributes.key?(:'end_timestamp')
|
180
|
+
self.end_timestamp = attributes[:'end_timestamp']
|
181
|
+
end
|
182
|
+
|
183
|
+
if attributes.key?(:'start_datetime')
|
184
|
+
self.start_datetime = attributes[:'start_datetime']
|
185
|
+
end
|
186
|
+
|
187
|
+
if attributes.key?(:'end_datetime')
|
188
|
+
self.end_datetime = attributes[:'end_datetime']
|
189
|
+
end
|
190
|
+
|
191
|
+
if attributes.key?(:'total_requests')
|
192
|
+
self.total_requests = attributes[:'total_requests']
|
193
|
+
end
|
194
|
+
|
195
|
+
if attributes.key?(:'cache_hits')
|
196
|
+
self.cache_hits = attributes[:'cache_hits']
|
197
|
+
end
|
198
|
+
|
199
|
+
if attributes.key?(:'cache_hit_rate')
|
200
|
+
self.cache_hit_rate = attributes[:'cache_hit_rate']
|
201
|
+
end
|
202
|
+
|
203
|
+
if attributes.key?(:'total_request_time')
|
204
|
+
self.total_request_time = attributes[:'total_request_time']
|
205
|
+
end
|
206
|
+
|
207
|
+
if attributes.key?(:'avg_origin_response_time')
|
208
|
+
self.avg_origin_response_time = attributes[:'avg_origin_response_time']
|
209
|
+
end
|
210
|
+
|
211
|
+
if attributes.key?(:'response_time_ms')
|
212
|
+
self.response_time_ms = attributes[:'response_time_ms']
|
213
|
+
end
|
214
|
+
|
215
|
+
if attributes.key?(:'_100_x')
|
216
|
+
self._100_x = attributes[:'_100_x']
|
217
|
+
end
|
218
|
+
|
219
|
+
if attributes.key?(:'_20_x')
|
220
|
+
self._20_x = attributes[:'_20_x']
|
221
|
+
end
|
222
|
+
|
223
|
+
if attributes.key?(:'_30_x')
|
224
|
+
self._30_x = attributes[:'_30_x']
|
225
|
+
end
|
226
|
+
|
227
|
+
if attributes.key?(:'_40_x')
|
228
|
+
self._40_x = attributes[:'_40_x']
|
229
|
+
end
|
230
|
+
|
231
|
+
if attributes.key?(:'_50_x')
|
232
|
+
self._50_x = attributes[:'_50_x']
|
233
|
+
end
|
234
|
+
|
235
|
+
if attributes.key?(:'_50th')
|
236
|
+
self._50th = attributes[:'_50th']
|
237
|
+
end
|
238
|
+
|
239
|
+
if attributes.key?(:'_95th')
|
240
|
+
self._95th = attributes[:'_95th']
|
241
|
+
end
|
242
|
+
|
243
|
+
if attributes.key?(:'_99th')
|
244
|
+
self._99th = attributes[:'_99th']
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
249
|
+
# @return Array for valid properties with the reasons
|
250
|
+
def list_invalid_properties
|
251
|
+
invalid_properties = Array.new
|
252
|
+
if @_403.nil?
|
253
|
+
invalid_properties.push('invalid value for "_403", _403 cannot be nil.')
|
254
|
+
end
|
255
|
+
|
256
|
+
if @_404.nil?
|
257
|
+
invalid_properties.push('invalid value for "_404", _404 cannot be nil.')
|
258
|
+
end
|
259
|
+
|
260
|
+
if @_500.nil?
|
261
|
+
invalid_properties.push('invalid value for "_500", _500 cannot be nil.')
|
262
|
+
end
|
263
|
+
|
264
|
+
if @_504.nil?
|
265
|
+
invalid_properties.push('invalid value for "_504", _504 cannot be nil.')
|
266
|
+
end
|
267
|
+
|
268
|
+
if @start_timestamp.nil?
|
269
|
+
invalid_properties.push('invalid value for "start_timestamp", start_timestamp cannot be nil.')
|
270
|
+
end
|
271
|
+
|
272
|
+
if @end_timestamp.nil?
|
273
|
+
invalid_properties.push('invalid value for "end_timestamp", end_timestamp cannot be nil.')
|
274
|
+
end
|
275
|
+
|
276
|
+
if @start_datetime.nil?
|
277
|
+
invalid_properties.push('invalid value for "start_datetime", start_datetime cannot be nil.')
|
278
|
+
end
|
279
|
+
|
280
|
+
if @end_datetime.nil?
|
281
|
+
invalid_properties.push('invalid value for "end_datetime", end_datetime cannot be nil.')
|
282
|
+
end
|
283
|
+
|
284
|
+
if @total_requests.nil?
|
285
|
+
invalid_properties.push('invalid value for "total_requests", total_requests cannot be nil.')
|
286
|
+
end
|
287
|
+
|
288
|
+
if @cache_hits.nil?
|
289
|
+
invalid_properties.push('invalid value for "cache_hits", cache_hits cannot be nil.')
|
290
|
+
end
|
291
|
+
|
292
|
+
if @cache_hit_rate.nil?
|
293
|
+
invalid_properties.push('invalid value for "cache_hit_rate", cache_hit_rate cannot be nil.')
|
294
|
+
end
|
295
|
+
|
296
|
+
if @total_request_time.nil?
|
297
|
+
invalid_properties.push('invalid value for "total_request_time", total_request_time cannot be nil.')
|
298
|
+
end
|
299
|
+
|
300
|
+
if @avg_origin_response_time.nil?
|
301
|
+
invalid_properties.push('invalid value for "avg_origin_response_time", avg_origin_response_time cannot be nil.')
|
302
|
+
end
|
303
|
+
|
304
|
+
if @response_time_ms.nil?
|
305
|
+
invalid_properties.push('invalid value for "response_time_ms", response_time_ms cannot be nil.')
|
306
|
+
end
|
307
|
+
|
308
|
+
if @_100_x.nil?
|
309
|
+
invalid_properties.push('invalid value for "_100_x", _100_x cannot be nil.')
|
310
|
+
end
|
311
|
+
|
312
|
+
if @_20_x.nil?
|
313
|
+
invalid_properties.push('invalid value for "_20_x", _20_x cannot be nil.')
|
314
|
+
end
|
315
|
+
|
316
|
+
if @_30_x.nil?
|
317
|
+
invalid_properties.push('invalid value for "_30_x", _30_x cannot be nil.')
|
318
|
+
end
|
319
|
+
|
320
|
+
if @_40_x.nil?
|
321
|
+
invalid_properties.push('invalid value for "_40_x", _40_x cannot be nil.')
|
322
|
+
end
|
323
|
+
|
324
|
+
if @_50_x.nil?
|
325
|
+
invalid_properties.push('invalid value for "_50_x", _50_x cannot be nil.')
|
326
|
+
end
|
327
|
+
|
328
|
+
if @_50th.nil?
|
329
|
+
invalid_properties.push('invalid value for "_50th", _50th cannot be nil.')
|
330
|
+
end
|
331
|
+
|
332
|
+
if @_95th.nil?
|
333
|
+
invalid_properties.push('invalid value for "_95th", _95th cannot be nil.')
|
334
|
+
end
|
335
|
+
|
336
|
+
if @_99th.nil?
|
337
|
+
invalid_properties.push('invalid value for "_99th", _99th cannot be nil.')
|
338
|
+
end
|
339
|
+
|
340
|
+
invalid_properties
|
341
|
+
end
|
342
|
+
|
343
|
+
# Check to see if the all the properties in the model are valid
|
344
|
+
# @return true if the model is valid
|
345
|
+
def valid?
|
346
|
+
return false if @_403.nil?
|
347
|
+
return false if @_404.nil?
|
348
|
+
return false if @_500.nil?
|
349
|
+
return false if @_504.nil?
|
350
|
+
return false if @start_timestamp.nil?
|
351
|
+
return false if @end_timestamp.nil?
|
352
|
+
return false if @start_datetime.nil?
|
353
|
+
return false if @end_datetime.nil?
|
354
|
+
return false if @total_requests.nil?
|
355
|
+
return false if @cache_hits.nil?
|
356
|
+
return false if @cache_hit_rate.nil?
|
357
|
+
return false if @total_request_time.nil?
|
358
|
+
return false if @avg_origin_response_time.nil?
|
359
|
+
return false if @response_time_ms.nil?
|
360
|
+
return false if @_100_x.nil?
|
361
|
+
return false if @_20_x.nil?
|
362
|
+
return false if @_30_x.nil?
|
363
|
+
return false if @_40_x.nil?
|
364
|
+
return false if @_50_x.nil?
|
365
|
+
return false if @_50th.nil?
|
366
|
+
return false if @_95th.nil?
|
367
|
+
return false if @_99th.nil?
|
368
|
+
true
|
369
|
+
end
|
370
|
+
|
371
|
+
# Checks equality by comparing each attribute.
|
372
|
+
# @param [Object] Object to be compared
|
373
|
+
def ==(o)
|
374
|
+
return true if self.equal?(o)
|
375
|
+
self.class == o.class &&
|
376
|
+
_403 == o._403 &&
|
377
|
+
_404 == o._404 &&
|
378
|
+
_500 == o._500 &&
|
379
|
+
_504 == o._504 &&
|
380
|
+
start_timestamp == o.start_timestamp &&
|
381
|
+
end_timestamp == o.end_timestamp &&
|
382
|
+
start_datetime == o.start_datetime &&
|
383
|
+
end_datetime == o.end_datetime &&
|
384
|
+
total_requests == o.total_requests &&
|
385
|
+
cache_hits == o.cache_hits &&
|
386
|
+
cache_hit_rate == o.cache_hit_rate &&
|
387
|
+
total_request_time == o.total_request_time &&
|
388
|
+
avg_origin_response_time == o.avg_origin_response_time &&
|
389
|
+
response_time_ms == o.response_time_ms &&
|
390
|
+
_100_x == o._100_x &&
|
391
|
+
_20_x == o._20_x &&
|
392
|
+
_30_x == o._30_x &&
|
393
|
+
_40_x == o._40_x &&
|
394
|
+
_50_x == o._50_x &&
|
395
|
+
_50th == o._50th &&
|
396
|
+
_95th == o._95th &&
|
397
|
+
_99th == o._99th
|
398
|
+
end
|
399
|
+
|
400
|
+
# @see the `==` method
|
401
|
+
# @param [Object] Object to be compared
|
402
|
+
def eql?(o)
|
403
|
+
self == o
|
404
|
+
end
|
405
|
+
|
406
|
+
# Calculates hash code according to all attributes.
|
407
|
+
# @return [Integer] Hash code
|
408
|
+
def hash
|
409
|
+
[_403, _404, _500, _504, start_timestamp, end_timestamp, start_datetime, end_datetime, total_requests, cache_hits, cache_hit_rate, total_request_time, avg_origin_response_time, response_time_ms, _100_x, _20_x, _30_x, _40_x, _50_x, _50th, _95th, _99th].hash
|
410
|
+
end
|
411
|
+
|
412
|
+
# Builds the object from hash
|
413
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
414
|
+
# @return [Object] Returns the model itself
|
415
|
+
def self.build_from_hash(attributes)
|
416
|
+
new.build_from_hash(attributes)
|
417
|
+
end
|
418
|
+
|
419
|
+
# Builds the object from hash
|
420
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
421
|
+
# @return [Object] Returns the model itself
|
422
|
+
def build_from_hash(attributes)
|
423
|
+
return nil unless attributes.is_a?(Hash)
|
424
|
+
self.class.openapi_types.each_pair do |key, type|
|
425
|
+
if type =~ /\AArray<(.*)>/i
|
426
|
+
# check to ensure the input is an array given that the attribute
|
427
|
+
# is documented as an array but the input is not
|
428
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
429
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
430
|
+
end
|
431
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
432
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
433
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
434
|
+
end
|
435
|
+
|
436
|
+
self
|
437
|
+
end
|
438
|
+
|
439
|
+
# Deserializes the data based on type
|
440
|
+
# @param string type Data type
|
441
|
+
# @param string value Value to be deserialized
|
442
|
+
# @return [Object] Deserialized data
|
443
|
+
def _deserialize(type, value)
|
444
|
+
case type.to_sym
|
445
|
+
when :DateTime
|
446
|
+
DateTime.parse(value)
|
447
|
+
when :Date
|
448
|
+
Date.parse(value)
|
449
|
+
when :String
|
450
|
+
value.to_s
|
451
|
+
when :Integer
|
452
|
+
value.to_i
|
453
|
+
when :Float
|
454
|
+
value.to_f
|
455
|
+
when :Boolean
|
456
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
457
|
+
true
|
458
|
+
else
|
459
|
+
false
|
460
|
+
end
|
461
|
+
when :Object
|
462
|
+
# generic object (usually a Hash), return directly
|
463
|
+
value
|
464
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
465
|
+
inner_type = Regexp.last_match[:inner_type]
|
466
|
+
value.map { |v| _deserialize(inner_type, v) }
|
467
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
468
|
+
k_type = Regexp.last_match[:k_type]
|
469
|
+
v_type = Regexp.last_match[:v_type]
|
470
|
+
{}.tap do |hash|
|
471
|
+
value.each do |k, v|
|
472
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
473
|
+
end
|
474
|
+
end
|
475
|
+
else # model
|
476
|
+
Hubspot::Cms::Performance.const_get(type).build_from_hash(value)
|
477
|
+
end
|
478
|
+
end
|
479
|
+
|
480
|
+
# Returns the string representation of the object
|
481
|
+
# @return [String] String presentation of the object
|
482
|
+
def to_s
|
483
|
+
to_hash.to_s
|
484
|
+
end
|
485
|
+
|
486
|
+
# to_body is an alias to to_hash (backward compatibility)
|
487
|
+
# @return [Hash] Returns the object in the form of hash
|
488
|
+
def to_body
|
489
|
+
to_hash
|
490
|
+
end
|
491
|
+
|
492
|
+
# Returns the object in the form of hash
|
493
|
+
# @return [Hash] Returns the object in the form of hash
|
494
|
+
def to_hash
|
495
|
+
hash = {}
|
496
|
+
self.class.attribute_map.each_pair do |attr, param|
|
497
|
+
value = self.send(attr)
|
498
|
+
if value.nil?
|
499
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
500
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
501
|
+
end
|
502
|
+
|
503
|
+
hash[param] = _to_hash(value)
|
504
|
+
end
|
505
|
+
hash
|
506
|
+
end
|
507
|
+
|
508
|
+
# Outputs non-array value in the form of hash
|
509
|
+
# For object, use to_hash. Otherwise, just return the value
|
510
|
+
# @param [Object] value Any valid value
|
511
|
+
# @return [Hash] Returns the value in the form of hash
|
512
|
+
def _to_hash(value)
|
513
|
+
if value.is_a?(Array)
|
514
|
+
value.compact.map { |v| _to_hash(v) }
|
515
|
+
elsif value.is_a?(Hash)
|
516
|
+
{}.tap do |hash|
|
517
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
518
|
+
end
|
519
|
+
elsif value.respond_to? :to_hash
|
520
|
+
value.to_hash
|
521
|
+
else
|
522
|
+
value
|
523
|
+
end
|
524
|
+
end
|
525
|
+
end
|
526
|
+
end
|
527
|
+
end
|
528
|
+
end
|