hubspot-api-client 20.0.0.pre.beta.1 → 20.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +33 -1
  3. data/Gemfile.lock +2 -2
  4. data/lib/hubspot/codegen/crm/companies/api/basic_api.rb +91 -22
  5. data/lib/hubspot/codegen/crm/companies/api/batch_api.rb +25 -17
  6. data/lib/hubspot/codegen/crm/companies/api/search_api.rb +4 -0
  7. data/lib/hubspot/codegen/crm/companies/models/association_spec.rb +12 -0
  8. data/lib/hubspot/codegen/crm/companies/models/{batch_input_simple_public_object_input_for_create.rb → batch_input_simple_public_object_batch_input_for_create.rb} +4 -4
  9. data/lib/hubspot/codegen/crm/companies/models/batch_read_input_simple_public_object_id.rb +1 -0
  10. data/lib/hubspot/codegen/crm/companies/models/public_associations_for_object.rb +10 -0
  11. data/lib/hubspot/codegen/crm/companies/models/public_merge_input.rb +2 -0
  12. data/lib/hubspot/codegen/crm/companies/models/public_object_id.rb +6 -0
  13. data/lib/hubspot/codegen/crm/companies/models/simple_public_object.rb +10 -1
  14. data/lib/hubspot/codegen/crm/companies/models/simple_public_object_batch_input.rb +4 -0
  15. data/lib/hubspot/codegen/crm/companies/models/simple_public_object_batch_input_for_create.rb +250 -0
  16. data/lib/hubspot/codegen/crm/companies/models/simple_public_object_batch_input_upsert.rb +4 -0
  17. data/lib/hubspot/codegen/crm/companies/models/simple_public_object_input.rb +2 -10
  18. data/lib/hubspot/codegen/crm/companies/models/simple_public_object_input_for_create.rb +2 -10
  19. data/lib/hubspot/codegen/crm/companies/models/simple_public_object_with_associations.rb +10 -1
  20. data/lib/hubspot/codegen/crm/companies/models/simple_public_upsert_object.rb +10 -1
  21. data/lib/hubspot/codegen/crm/contacts/api/basic_api.rb +163 -26
  22. data/lib/hubspot/codegen/crm/contacts/api/batch_api.rb +27 -19
  23. data/lib/hubspot/codegen/crm/contacts/api/search_api.rb +4 -0
  24. data/lib/hubspot/codegen/crm/contacts/models/association_spec.rb +10 -0
  25. data/lib/hubspot/codegen/crm/contacts/models/{batch_input_simple_public_object_input_for_create.rb → batch_input_simple_public_object_batch_input_for_create.rb} +4 -4
  26. data/lib/hubspot/codegen/crm/contacts/models/batch_read_input_simple_public_object_id.rb +1 -0
  27. data/lib/hubspot/codegen/crm/contacts/models/public_associations_for_object.rb +10 -0
  28. data/lib/hubspot/codegen/crm/contacts/models/public_gdpr_delete_input.rb +2 -0
  29. data/lib/hubspot/codegen/crm/contacts/models/public_object_id.rb +5 -0
  30. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object.rb +10 -1
  31. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_batch_input.rb +2 -0
  32. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_batch_input_for_create.rb +250 -0
  33. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_batch_input_upsert.rb +1 -0
  34. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_input.rb +1 -10
  35. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_input_for_create.rb +1 -10
  36. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_with_associations.rb +13 -1
  37. data/lib/hubspot/codegen/crm/contacts/models/simple_public_upsert_object.rb +10 -1
  38. data/lib/hubspot/codegen/crm/deals/api/basic_api.rb +67 -0
  39. data/lib/hubspot/codegen/crm/deals/api/batch_api.rb +11 -9
  40. data/lib/hubspot/codegen/crm/deals/models/association_spec.rb +10 -0
  41. data/lib/hubspot/codegen/crm/deals/models/{batch_input_simple_public_object_input_for_create.rb → batch_input_simple_public_object_batch_input_for_create.rb} +4 -4
  42. data/lib/hubspot/codegen/crm/deals/models/batch_read_input_simple_public_object_id.rb +1 -0
  43. data/lib/hubspot/codegen/crm/deals/models/public_associations_for_object.rb +10 -0
  44. data/lib/hubspot/codegen/crm/deals/models/public_object_id.rb +5 -0
  45. data/lib/hubspot/codegen/crm/deals/models/simple_public_object.rb +10 -1
  46. data/lib/hubspot/codegen/crm/deals/models/simple_public_object_batch_input.rb +2 -0
  47. data/lib/hubspot/codegen/crm/deals/models/simple_public_object_batch_input_for_create.rb +250 -0
  48. data/lib/hubspot/codegen/crm/deals/models/simple_public_object_batch_input_upsert.rb +1 -0
  49. data/lib/hubspot/codegen/crm/deals/models/simple_public_object_input.rb +1 -10
  50. data/lib/hubspot/codegen/crm/deals/models/simple_public_object_input_for_create.rb +1 -10
  51. data/lib/hubspot/codegen/crm/deals/models/simple_public_object_with_associations.rb +10 -1
  52. data/lib/hubspot/codegen/crm/deals/models/simple_public_upsert_object.rb +10 -1
  53. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/basic_api.rb +3 -2
  54. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/batch_api.rb +2 -0
  55. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/batch_read_input_simple_public_object_id.rb +1 -0
  56. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/simple_public_object.rb +10 -1
  57. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/simple_public_object_with_associations.rb +10 -1
  58. data/lib/hubspot/codegen/crm/objects/goals/api/basic_api.rb +1 -0
  59. data/lib/hubspot/codegen/crm/objects/goals/api/batch_api.rb +11 -9
  60. data/lib/hubspot/codegen/crm/objects/goals/models/{batch_input_simple_public_object_input_for_create.rb → batch_input_simple_public_object_batch_input_for_create.rb} +4 -4
  61. data/lib/hubspot/codegen/crm/objects/goals/models/batch_read_input_simple_public_object_id.rb +1 -0
  62. data/lib/hubspot/codegen/crm/objects/goals/models/simple_public_object.rb +10 -1
  63. data/lib/hubspot/codegen/crm/objects/goals/models/simple_public_object_batch_input.rb +2 -0
  64. data/lib/hubspot/codegen/crm/objects/goals/models/simple_public_object_batch_input_for_create.rb +252 -0
  65. data/lib/hubspot/codegen/crm/objects/goals/models/simple_public_object_batch_input_upsert.rb +1 -0
  66. data/lib/hubspot/codegen/crm/objects/goals/models/simple_public_object_input.rb +1 -10
  67. data/lib/hubspot/codegen/crm/objects/goals/models/simple_public_object_input_for_create.rb +1 -15
  68. data/lib/hubspot/codegen/crm/objects/goals/models/simple_public_object_with_associations.rb +10 -1
  69. data/lib/hubspot/codegen/crm/objects/goals/models/simple_public_upsert_object.rb +10 -1
  70. data/lib/hubspot/codegen/crm/products/api/basic_api.rb +5 -4
  71. data/lib/hubspot/codegen/crm/products/api/batch_api.rb +11 -9
  72. data/lib/hubspot/codegen/crm/products/models/{batch_input_simple_public_object_input_for_create.rb → batch_input_simple_public_object_batch_input_for_create.rb} +4 -4
  73. data/lib/hubspot/codegen/crm/products/models/batch_read_input_simple_public_object_id.rb +1 -1
  74. data/lib/hubspot/codegen/crm/products/models/simple_public_object.rb +10 -1
  75. data/lib/hubspot/codegen/crm/products/models/simple_public_object_batch_input_for_create.rb +250 -0
  76. data/lib/hubspot/codegen/crm/products/models/simple_public_object_input.rb +1 -10
  77. data/lib/hubspot/codegen/crm/products/models/simple_public_object_input_for_create.rb +6 -10
  78. data/lib/hubspot/codegen/crm/products/models/simple_public_object_with_associations.rb +10 -1
  79. data/lib/hubspot/codegen/crm/products/models/simple_public_upsert_object.rb +10 -1
  80. data/lib/hubspot/codegen/crm/tickets/api/basic_api.rb +73 -4
  81. data/lib/hubspot/codegen/crm/tickets/api/batch_api.rb +17 -9
  82. data/lib/hubspot/codegen/crm/tickets/api/search_api.rb +4 -0
  83. data/lib/hubspot/codegen/crm/tickets/models/association_spec.rb +10 -0
  84. data/lib/hubspot/codegen/crm/tickets/models/{batch_input_simple_public_object_input_for_create.rb → batch_input_simple_public_object_batch_input_for_create.rb} +4 -4
  85. data/lib/hubspot/codegen/crm/tickets/models/batch_read_input_simple_public_object_id.rb +1 -0
  86. data/lib/hubspot/codegen/crm/tickets/models/public_associations_for_object.rb +10 -0
  87. data/lib/hubspot/codegen/crm/tickets/models/public_object_id.rb +5 -0
  88. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object.rb +10 -1
  89. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_batch_input.rb +2 -0
  90. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_batch_input_for_create.rb +250 -0
  91. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_batch_input_upsert.rb +1 -0
  92. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_input.rb +1 -10
  93. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_input_for_create.rb +1 -10
  94. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_with_associations.rb +10 -1
  95. data/lib/hubspot/codegen/crm/tickets/models/simple_public_upsert_object.rb +10 -1
  96. data/lib/hubspot/codegen/files/api/files_api.rb +144 -104
  97. data/lib/hubspot/codegen/files/api/folders_api.rb +142 -57
  98. data/lib/hubspot/codegen/files/api_client.rb +1 -1
  99. data/lib/hubspot/codegen/files/api_error.rb +1 -1
  100. data/lib/hubspot/codegen/files/configuration.rb +1 -1
  101. data/lib/hubspot/codegen/files/models/collection_response_file.rb +2 -1
  102. data/lib/hubspot/codegen/files/models/collection_response_folder.rb +1 -1
  103. data/lib/hubspot/codegen/files/models/error.rb +1 -1
  104. data/lib/hubspot/codegen/files/models/error_detail.rb +1 -1
  105. data/lib/hubspot/codegen/files/models/file.rb +33 -14
  106. data/lib/hubspot/codegen/files/models/file_action_response.rb +1 -1
  107. data/lib/hubspot/codegen/files/models/file_stat.rb +1 -1
  108. data/lib/hubspot/codegen/files/models/file_update_input.rb +15 -5
  109. data/lib/hubspot/codegen/files/models/folder.rb +12 -12
  110. data/lib/hubspot/codegen/files/models/folder_action_response.rb +1 -1
  111. data/lib/hubspot/codegen/files/models/folder_input.rb +2 -1
  112. data/lib/hubspot/codegen/files/models/folder_update_input.rb +6 -20
  113. data/lib/hubspot/codegen/files/models/folder_update_input_with_id.rb +244 -0
  114. data/lib/hubspot/codegen/files/models/folder_update_task_locator.rb +2 -1
  115. data/lib/hubspot/codegen/files/models/import_from_url_input.rb +13 -4
  116. data/lib/hubspot/codegen/files/models/import_from_url_task_locator.rb +2 -1
  117. data/lib/hubspot/codegen/files/models/next_page.rb +1 -1
  118. data/lib/hubspot/codegen/files/models/paging.rb +1 -1
  119. data/lib/hubspot/codegen/files/models/previous_page.rb +1 -1
  120. data/lib/hubspot/codegen/files/models/signed_url.rb +18 -17
  121. data/lib/hubspot/codegen/files/models/standard_error.rb +1 -1
  122. data/lib/hubspot/codegen/oauth/api/access_tokens_api.rb +7 -3
  123. data/lib/hubspot/codegen/oauth/api/refresh_tokens_api.rb +13 -5
  124. data/lib/hubspot/codegen/oauth/api/tokens_api.rb +5 -1
  125. data/lib/hubspot/codegen/oauth/api_client.rb +2 -2
  126. data/lib/hubspot/codegen/oauth/api_error.rb +1 -1
  127. data/lib/hubspot/codegen/oauth/configuration.rb +1 -1
  128. data/lib/hubspot/codegen/oauth/models/access_token_info_response.rb +4 -4
  129. data/lib/hubspot/codegen/oauth/models/error.rb +4 -4
  130. data/lib/hubspot/codegen/oauth/models/error_detail.rb +4 -4
  131. data/lib/hubspot/codegen/oauth/models/refresh_token_info_response.rb +4 -4
  132. data/lib/hubspot/codegen/oauth/models/token_response_if.rb +4 -4
  133. data/lib/hubspot/discovery/cms/client.rb +0 -1
  134. data/lib/hubspot/discovery/crm/companies/client.rb +0 -1
  135. data/lib/hubspot/discovery/crm/contacts/client.rb +0 -2
  136. data/lib/hubspot/discovery/crm/deals/client.rb +0 -1
  137. data/lib/hubspot/discovery/crm/tickets/client.rb +0 -1
  138. data/lib/hubspot/discovery/oauth/api/access_tokens_api.rb +1 -1
  139. data/lib/hubspot/discovery/oauth/api/refresh_tokens_api.rb +1 -1
  140. data/lib/hubspot/discovery/oauth/api/tokens_api.rb +1 -1
  141. data/lib/hubspot/discovery/oauth/client.rb +1 -1
  142. data/lib/hubspot/helpers/camel_case.rb +0 -4
  143. data/lib/hubspot/version.rb +1 -1
  144. data/spec/discovery/cms/client_spec.rb +0 -1
  145. data/spec/discovery/crm/companies/basic_api_spec.rb +1 -0
  146. data/spec/discovery/crm/contacts/basic_api_spec.rb +1 -0
  147. data/spec/discovery/crm/deals/basic_api_spec.rb +1 -0
  148. data/spec/discovery/crm/tickets/basic_api_spec.rb +1 -0
  149. data/spec/discovery/files/files_api_spec.rb +2 -1
  150. data/spec/discovery/files/folders_api_spec.rb +1 -0
  151. data/spec/discovery/oauth/access_tokens_api_spec.rb +1 -1
  152. data/spec/discovery/oauth/refresh_tokens_api_spec.rb +1 -1
  153. data/spec/discovery/oauth/tokens_api_spec.rb +1 -1
  154. metadata +17 -42
  155. data/lib/hubspot/codegen/cms/performance/api/public_performance_api.rb +0 -188
  156. data/lib/hubspot/codegen/cms/performance/api_client.rb +0 -410
  157. data/lib/hubspot/codegen/cms/performance/api_error.rb +0 -61
  158. data/lib/hubspot/codegen/cms/performance/configuration.rb +0 -287
  159. data/lib/hubspot/codegen/cms/performance/models/error.rb +0 -305
  160. data/lib/hubspot/codegen/cms/performance/models/error_detail.rb +0 -271
  161. data/lib/hubspot/codegen/cms/performance/models/performance_view.rb +0 -526
  162. data/lib/hubspot/codegen/cms/performance/models/public_performance_response.rb +0 -345
  163. data/lib/hubspot/codegen/crm/companies/api/merge_api.rb +0 -92
  164. data/lib/hubspot/codegen/crm/contacts/api/gdpr_api.rb +0 -94
  165. data/lib/hubspot/codegen/crm/contacts/api/merge_api.rb +0 -92
  166. data/lib/hubspot/codegen/crm/deals/api/merge_api.rb +0 -92
  167. data/lib/hubspot/codegen/crm/tickets/api/merge_api.rb +0 -92
  168. data/lib/hubspot/discovery/cms/performance/api/public_performance_api.rb +0 -13
  169. data/lib/hubspot/discovery/cms/performance/client.rb +0 -19
  170. data/lib/hubspot/discovery/crm/companies/api/merge_api.rb +0 -13
  171. data/lib/hubspot/discovery/crm/contacts/api/gdpr_api.rb +0 -13
  172. data/lib/hubspot/discovery/crm/contacts/api/merge_api.rb +0 -13
  173. data/lib/hubspot/discovery/crm/deals/api/merge_api.rb +0 -13
  174. data/lib/hubspot/discovery/crm/tickets/api/merge_api.rb +0 -13
  175. data/spec/discovery/cms/performance/public_performance_api_spec.rb +0 -8
  176. data/spec/discovery/crm/companies/merge_api_spec.rb +0 -7
  177. data/spec/discovery/crm/contacts/gdpr_api_spec.rb +0 -7
  178. data/spec/discovery/crm/contacts/merge_api_spec.rb +0 -7
  179. data/spec/discovery/crm/deals/merge_api_spec.rb +0 -7
  180. data/spec/discovery/crm/tickets/merge_api_spec.rb +0 -7
@@ -1,287 +0,0 @@
1
- =begin
2
- #CMS Performance
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: 6.2.1
10
-
11
- =end
12
-
13
- module Hubspot
14
- module Cms
15
- module Performance
16
- class Configuration
17
- # Defines url scheme
18
- attr_accessor :scheme
19
-
20
- # Defines url host
21
- attr_accessor :host
22
-
23
- # Defines url base path
24
- attr_accessor :base_path
25
-
26
- # Define server configuration index
27
- attr_accessor :server_index
28
-
29
- # Define server operation configuration index
30
- attr_accessor :server_operation_index
31
-
32
- # Default server variables
33
- attr_accessor :server_variables
34
-
35
- # Default server operation variables
36
- attr_accessor :server_operation_variables
37
-
38
- # Defines API keys used with API Key authentications.
39
- #
40
- # @return [Hash] key: parameter name, value: parameter value (API key)
41
- #
42
- # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
43
- # config.api_key['api_key'] = 'xxx'
44
- attr_accessor :api_key
45
-
46
- # Defines API key prefixes used with API Key authentications.
47
- #
48
- # @return [Hash] key: parameter name, value: API key prefix
49
- #
50
- # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
51
- # config.api_key_prefix['api_key'] = 'Token'
52
- attr_accessor :api_key_prefix
53
-
54
- # Defines the username used with HTTP basic authentication.
55
- #
56
- # @return [String]
57
- attr_accessor :username
58
-
59
- # Defines the password used with HTTP basic authentication.
60
- #
61
- # @return [String]
62
- attr_accessor :password
63
-
64
- # Defines the access token (Bearer) used with OAuth2.
65
- attr_accessor :access_token
66
-
67
- # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
68
- # details will be logged with `logger.debug` (see the `logger` attribute).
69
- # Default to false.
70
- #
71
- # @return [true, false]
72
- attr_accessor :debugging
73
-
74
- # Defines the logger used for debugging.
75
- # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
76
- #
77
- # @return [#debug]
78
- attr_accessor :logger
79
-
80
- # Defines the temporary folder to store downloaded files
81
- # (for API endpoints that have file response).
82
- # Default to use `Tempfile`.
83
- #
84
- # @return [String]
85
- attr_accessor :temp_folder_path
86
-
87
- # The time limit for HTTP request in seconds.
88
- # Default to 0 (never times out).
89
- attr_accessor :timeout
90
-
91
- # Set this to false to skip client side validation in the operation.
92
- # Default to true.
93
- # @return [true, false]
94
- attr_accessor :client_side_validation
95
-
96
- ### TLS/SSL setting
97
- # Set this to false to skip verifying SSL certificate when calling API from https server.
98
- # Default to true.
99
- #
100
- # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
101
- #
102
- # @return [true, false]
103
- attr_accessor :verify_ssl
104
-
105
- ### TLS/SSL setting
106
- # Set this to false to skip verifying SSL host name
107
- # Default to true.
108
- #
109
- # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
110
- #
111
- # @return [true, false]
112
- attr_accessor :verify_ssl_host
113
-
114
- ### TLS/SSL setting
115
- # Set this to customize the certificate file to verify the peer.
116
- #
117
- # @return [String] the path to the certificate file
118
- #
119
- # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
120
- # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
121
- attr_accessor :ssl_ca_cert
122
-
123
- ### TLS/SSL setting
124
- # Client certificate file (for client certificate)
125
- attr_accessor :cert_file
126
-
127
- ### TLS/SSL setting
128
- # Client private key file (for client certificate)
129
- attr_accessor :key_file
130
-
131
- # Set this to customize parameters encoding of array parameter with multi collectionFormat.
132
- # Default to nil.
133
- #
134
- # @see The params_encoding option of Ethon. Related source code:
135
- # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
136
- attr_accessor :params_encoding
137
-
138
-
139
- attr_accessor :inject_format
140
-
141
- attr_accessor :force_ending_format
142
-
143
- attr_accessor :error_handler
144
-
145
- def initialize
146
- @scheme = 'https'
147
- @host = 'api.hubapi.com'
148
- @base_path = ''
149
- @server_index = 0
150
- @server_operation_index = {}
151
- @server_variables = {}
152
- @server_operation_variables = {}
153
- @api_key = {}
154
- @api_key_prefix = {}
155
- @client_side_validation = true
156
- @verify_ssl = true
157
- @verify_ssl_host = true
158
- @cert_file = nil
159
- @key_file = nil
160
- @timeout = 0
161
- @params_encoding = nil
162
- @debugging = false
163
- @inject_format = false
164
- @force_ending_format = false
165
- @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
166
- # error_handler params: { 'status_code': { max_retries: ..., seconds_delay: ... }, ... }
167
- @error_handler = {}
168
-
169
- yield(self) if block_given?
170
- end
171
-
172
- # The default Configuration object.
173
- def self.default
174
- @@default ||= Configuration.new
175
- end
176
-
177
- def configure
178
- yield(self) if block_given?
179
- end
180
-
181
- def scheme=(scheme)
182
- # remove :// from scheme
183
- @scheme = scheme.sub(/:\/\//, '')
184
- end
185
-
186
- def host=(host)
187
- # remove http(s):// and anything after a slash
188
- @host = host.sub(/https?:\/\//, '').split('/').first
189
- end
190
-
191
- def base_path=(base_path)
192
- # Add leading and trailing slashes to base_path
193
- @base_path = "/#{base_path}".gsub(/\/+/, '/')
194
- @base_path = '' if @base_path == '/'
195
- end
196
-
197
- # Returns base URL for specified operation based on server settings
198
- def base_url(operation = nil)
199
- index = server_operation_index.fetch(operation, server_index)
200
- return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil
201
-
202
- server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
203
- end
204
-
205
- # Gets API key (with prefix if set).
206
- # @param [String] param_name the parameter name of API key auth
207
- def api_key_with_prefix(param_name, param_alias = nil)
208
- key = @api_key[param_name]
209
- key = @api_key.fetch(param_alias, key) unless param_alias.nil?
210
- if @api_key_prefix[param_name]
211
- "#{@api_key_prefix[param_name]} #{key}"
212
- else
213
- key
214
- end
215
- end
216
-
217
- # Gets Basic Auth token string
218
- def basic_auth_token
219
- 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
220
- end
221
-
222
- # Returns Auth Settings hash for api client.
223
- def auth_settings
224
- {
225
- 'oauth2' =>
226
- {
227
- type: 'oauth2',
228
- in: 'header',
229
- key: 'Authorization',
230
- value: "Bearer #{access_token}"
231
- },
232
- }
233
- end
234
-
235
- # Returns an array of Server setting
236
- def server_settings
237
- [
238
- {
239
- url: "https://api.hubapi.com",
240
- description: "No description provided",
241
- }
242
- ]
243
- end
244
-
245
- def operation_server_settings
246
- {
247
- }
248
- end
249
-
250
- # Returns URL based on server settings
251
- #
252
- # @param index array index of the server settings
253
- # @param variables hash of variable and the corresponding value
254
- def server_url(index, variables = {}, servers = nil)
255
- servers = server_settings if servers == nil
256
-
257
- # check array index out of bound
258
- if (index < 0 || index >= servers.size)
259
- fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
260
- end
261
-
262
- server = servers[index]
263
- url = server[:url]
264
-
265
- return url unless server.key? :variables
266
-
267
- # go through variable and assign a value
268
- server[:variables].each do |name, variable|
269
- if variables.key?(name)
270
- if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
271
- url.gsub! "{" + name.to_s + "}", variables[name]
272
- else
273
- fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
274
- end
275
- else
276
- # use default value
277
- url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
278
- end
279
- end
280
-
281
- url
282
- end
283
-
284
- end
285
- end
286
- end
287
- end
@@ -1,305 +0,0 @@
1
- =begin
2
- #CMS Performance
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: 6.2.1
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module Hubspot
17
- module Cms
18
- module Performance
19
- class Error
20
- # A specific category that contains more specific detail about the error
21
- attr_accessor :sub_category
22
-
23
- # Context about the error condition
24
- attr_accessor :context
25
-
26
- # A unique identifier for the request. Include this value with any error reports or support tickets
27
- attr_accessor :correlation_id
28
-
29
- # A map of link names to associated URIs containing documentation about the error or recommended remediation steps
30
- attr_accessor :links
31
-
32
- # A human readable message describing the error along with remediation steps where appropriate
33
- attr_accessor :message
34
-
35
- # The error category
36
- attr_accessor :category
37
-
38
- # further information about the error
39
- attr_accessor :errors
40
-
41
- # Attribute mapping from ruby-style variable name to JSON key.
42
- def self.attribute_map
43
- {
44
- :'sub_category' => :'subCategory',
45
- :'context' => :'context',
46
- :'correlation_id' => :'correlationId',
47
- :'links' => :'links',
48
- :'message' => :'message',
49
- :'category' => :'category',
50
- :'errors' => :'errors'
51
- }
52
- end
53
-
54
- # Returns all the JSON keys this model knows about
55
- def self.acceptable_attributes
56
- attribute_map.values
57
- end
58
-
59
- # Attribute type mapping.
60
- def self.openapi_types
61
- {
62
- :'sub_category' => :'String',
63
- :'context' => :'Hash<String, Array<String>>',
64
- :'correlation_id' => :'String',
65
- :'links' => :'Hash<String, String>',
66
- :'message' => :'String',
67
- :'category' => :'String',
68
- :'errors' => :'Array<ErrorDetail>'
69
- }
70
- end
71
-
72
- # List of attributes with nullable: true
73
- def self.openapi_nullable
74
- Set.new([
75
- ])
76
- end
77
-
78
- # Initializes the object
79
- # @param [Hash] attributes Model attributes in the form of hash
80
- def initialize(attributes = {})
81
- if (!attributes.is_a?(Hash))
82
- fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Cms::Performance::Error` initialize method"
83
- end
84
-
85
- # check to see if the attribute exists and convert string to symbol for hash key
86
- attributes = attributes.each_with_object({}) { |(k, v), h|
87
- if (!self.class.attribute_map.key?(k.to_sym))
88
- fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Cms::Performance::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
89
- end
90
- h[k.to_sym] = v
91
- }
92
-
93
- if attributes.key?(:'sub_category')
94
- self.sub_category = attributes[:'sub_category']
95
- end
96
-
97
- if attributes.key?(:'context')
98
- if (value = attributes[:'context']).is_a?(Hash)
99
- self.context = value
100
- end
101
- end
102
-
103
- if attributes.key?(:'correlation_id')
104
- self.correlation_id = attributes[:'correlation_id']
105
- end
106
-
107
- if attributes.key?(:'links')
108
- if (value = attributes[:'links']).is_a?(Hash)
109
- self.links = value
110
- end
111
- end
112
-
113
- if attributes.key?(:'message')
114
- self.message = attributes[:'message']
115
- end
116
-
117
- if attributes.key?(:'category')
118
- self.category = attributes[:'category']
119
- end
120
-
121
- if attributes.key?(:'errors')
122
- if (value = attributes[:'errors']).is_a?(Array)
123
- self.errors = value
124
- end
125
- end
126
- end
127
-
128
- # Show invalid properties with the reasons. Usually used together with valid?
129
- # @return Array for valid properties with the reasons
130
- def list_invalid_properties
131
- invalid_properties = Array.new
132
- if @correlation_id.nil?
133
- invalid_properties.push('invalid value for "correlation_id", correlation_id cannot be nil.')
134
- end
135
-
136
- if @message.nil?
137
- invalid_properties.push('invalid value for "message", message cannot be nil.')
138
- end
139
-
140
- if @category.nil?
141
- invalid_properties.push('invalid value for "category", category cannot be nil.')
142
- end
143
-
144
- invalid_properties
145
- end
146
-
147
- # Check to see if the all the properties in the model are valid
148
- # @return true if the model is valid
149
- def valid?
150
- return false if @correlation_id.nil?
151
- return false if @message.nil?
152
- return false if @category.nil?
153
- true
154
- end
155
-
156
- # Checks equality by comparing each attribute.
157
- # @param [Object] Object to be compared
158
- def ==(o)
159
- return true if self.equal?(o)
160
- self.class == o.class &&
161
- sub_category == o.sub_category &&
162
- context == o.context &&
163
- correlation_id == o.correlation_id &&
164
- links == o.links &&
165
- message == o.message &&
166
- category == o.category &&
167
- errors == o.errors
168
- end
169
-
170
- # @see the `==` method
171
- # @param [Object] Object to be compared
172
- def eql?(o)
173
- self == o
174
- end
175
-
176
- # Calculates hash code according to all attributes.
177
- # @return [Integer] Hash code
178
- def hash
179
- [sub_category, context, correlation_id, links, message, category, errors].hash
180
- end
181
-
182
- # Builds the object from hash
183
- # @param [Hash] attributes Model attributes in the form of hash
184
- # @return [Object] Returns the model itself
185
- def self.build_from_hash(attributes)
186
- new.build_from_hash(attributes)
187
- end
188
-
189
- # Builds the object from hash
190
- # @param [Hash] attributes Model attributes in the form of hash
191
- # @return [Object] Returns the model itself
192
- def build_from_hash(attributes)
193
- return nil unless attributes.is_a?(Hash)
194
- attributes = attributes.transform_keys(&:to_sym)
195
- self.class.openapi_types.each_pair do |key, type|
196
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
197
- self.send("#{key}=", nil)
198
- elsif type =~ /\AArray<(.*)>/i
199
- # check to ensure the input is an array given that the attribute
200
- # is documented as an array but the input is not
201
- if attributes[self.class.attribute_map[key]].is_a?(Array)
202
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
203
- end
204
- elsif !attributes[self.class.attribute_map[key]].nil?
205
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
206
- end
207
- end
208
-
209
- self
210
- end
211
-
212
- # Deserializes the data based on type
213
- # @param string type Data type
214
- # @param string value Value to be deserialized
215
- # @return [Object] Deserialized data
216
- def _deserialize(type, value)
217
- case type.to_sym
218
- when :Time
219
- Time.parse(value)
220
- when :Date
221
- Date.parse(value)
222
- when :String
223
- value.to_s
224
- when :Integer
225
- value.to_i
226
- when :Float
227
- value.to_f
228
- when :Boolean
229
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
230
- true
231
- else
232
- false
233
- end
234
- when :Object
235
- # generic object (usually a Hash), return directly
236
- value
237
- when /\AArray<(?<inner_type>.+)>\z/
238
- inner_type = Regexp.last_match[:inner_type]
239
- value.map { |v| _deserialize(inner_type, v) }
240
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
241
- k_type = Regexp.last_match[:k_type]
242
- v_type = Regexp.last_match[:v_type]
243
- {}.tap do |hash|
244
- value.each do |k, v|
245
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
246
- end
247
- end
248
- else # model
249
- # models (e.g. Pet) or oneOf
250
- klass = Hubspot::Cms::Performance.const_get(type)
251
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
252
- end
253
- end
254
-
255
- # Returns the string representation of the object
256
- # @return [String] String presentation of the object
257
- def to_s
258
- to_hash.to_s
259
- end
260
-
261
- # to_body is an alias to to_hash (backward compatibility)
262
- # @return [Hash] Returns the object in the form of hash
263
- def to_body
264
- to_hash
265
- end
266
-
267
- # Returns the object in the form of hash
268
- # @return [Hash] Returns the object in the form of hash
269
- def to_hash
270
- hash = {}
271
- self.class.attribute_map.each_pair do |attr, param|
272
- value = self.send(attr)
273
- if value.nil?
274
- is_nullable = self.class.openapi_nullable.include?(attr)
275
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
276
- end
277
-
278
- hash[param] = _to_hash(value)
279
- end
280
- hash
281
- end
282
-
283
- # Outputs non-array value in the form of hash
284
- # For object, use to_hash. Otherwise, just return the value
285
- # @param [Object] value Any valid value
286
- # @return [Hash] Returns the value in the form of hash
287
- def _to_hash(value)
288
- if value.is_a?(Array)
289
- value.compact.map { |v| _to_hash(v) }
290
- elsif value.is_a?(Hash)
291
- {}.tap do |hash|
292
- value.each { |k, v| hash[k] = _to_hash(v) }
293
- end
294
- elsif value.respond_to? :to_hash
295
- value.to_hash
296
- else
297
- value
298
- end
299
- end
300
-
301
- end
302
-
303
- end
304
- end
305
- end