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.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/lib/hubspot-api-client.rb +61 -0
  4. data/lib/hubspot/codegen/cms/audit-logs/api/default_api.rb +106 -0
  5. data/lib/hubspot/codegen/cms/audit-logs/api_client.rb +422 -0
  6. data/lib/hubspot/codegen/cms/audit-logs/api_error.rb +61 -0
  7. data/lib/hubspot/codegen/cms/audit-logs/configuration.rb +258 -0
  8. data/lib/hubspot/codegen/cms/audit-logs/models/collection_response_public_audit_log.rb +226 -0
  9. data/lib/hubspot/codegen/cms/audit-logs/models/error.rb +292 -0
  10. data/lib/hubspot/codegen/cms/audit-logs/models/error_detail.rb +258 -0
  11. data/lib/hubspot/codegen/cms/audit-logs/models/next_page.rb +224 -0
  12. data/lib/hubspot/codegen/cms/audit-logs/models/paging.rb +210 -0
  13. data/lib/hubspot/codegen/cms/audit-logs/models/public_audit_log.rb +352 -0
  14. data/lib/hubspot/codegen/cms/domains/api/domains_api.rb +183 -0
  15. data/lib/hubspot/codegen/cms/domains/api_client.rb +422 -0
  16. data/lib/hubspot/codegen/cms/domains/api_error.rb +61 -0
  17. data/lib/hubspot/codegen/cms/domains/configuration.rb +258 -0
  18. data/lib/hubspot/codegen/cms/domains/models/collection_response_with_total_domain.rb +240 -0
  19. data/lib/hubspot/codegen/cms/domains/models/domain.rb +1091 -0
  20. data/lib/hubspot/codegen/cms/domains/models/domain_cdn_config.rb +497 -0
  21. data/lib/hubspot/codegen/cms/domains/models/domain_setup_info.rb +231 -0
  22. data/lib/hubspot/codegen/cms/domains/models/error.rb +292 -0
  23. data/lib/hubspot/codegen/cms/domains/models/error_detail.rb +258 -0
  24. data/lib/hubspot/codegen/cms/domains/models/next_page.rb +224 -0
  25. data/lib/hubspot/codegen/cms/domains/models/paging.rb +210 -0
  26. data/lib/hubspot/codegen/cms/performance/api/default_api.rb +186 -0
  27. data/lib/hubspot/codegen/cms/performance/api_client.rb +422 -0
  28. data/lib/hubspot/codegen/cms/performance/api_error.rb +61 -0
  29. data/lib/hubspot/codegen/cms/performance/configuration.rb +258 -0
  30. data/lib/hubspot/codegen/cms/performance/models/error.rb +292 -0
  31. data/lib/hubspot/codegen/cms/performance/models/error_detail.rb +258 -0
  32. data/lib/hubspot/codegen/cms/performance/models/performance_view.rb +528 -0
  33. data/lib/hubspot/codegen/cms/performance/models/public_performance_response.rb +332 -0
  34. data/lib/hubspot/codegen/cms/site-search/api/default_api.rb +225 -0
  35. data/lib/hubspot/codegen/cms/site-search/api_client.rb +422 -0
  36. data/lib/hubspot/codegen/cms/site-search/api_error.rb +61 -0
  37. data/lib/hubspot/codegen/cms/site-search/configuration.rb +258 -0
  38. data/lib/hubspot/codegen/cms/site-search/models/content_search_result.rb +427 -0
  39. data/lib/hubspot/codegen/cms/site-search/models/error.rb +292 -0
  40. data/lib/hubspot/codegen/cms/site-search/models/error_detail.rb +258 -0
  41. data/lib/hubspot/codegen/cms/site-search/models/indexed_data.rb +279 -0
  42. data/lib/hubspot/codegen/cms/site-search/models/public_search_results.rb +282 -0
  43. data/lib/hubspot/codegen/cms/site-search/models/search_hit_field.rb +257 -0
  44. data/lib/hubspot/codegen/cms/url-redirects/api/redirects_api.rb +368 -0
  45. data/lib/hubspot/codegen/cms/url-redirects/api_client.rb +422 -0
  46. data/lib/hubspot/codegen/cms/url-redirects/api_error.rb +61 -0
  47. data/lib/hubspot/codegen/cms/url-redirects/configuration.rb +258 -0
  48. data/lib/hubspot/codegen/cms/url-redirects/models/collection_response_with_total_url_mapping.rb +242 -0
  49. data/lib/hubspot/codegen/cms/url-redirects/models/error.rb +292 -0
  50. data/lib/hubspot/codegen/cms/url-redirects/models/error_detail.rb +258 -0
  51. data/lib/hubspot/codegen/cms/url-redirects/models/next_page.rb +224 -0
  52. data/lib/hubspot/codegen/cms/url-redirects/models/paging.rb +210 -0
  53. data/lib/hubspot/codegen/cms/url-redirects/models/url_mapping.rb +596 -0
  54. data/lib/hubspot/codegen/cms/url-redirects/models/url_mapping_create_request_body.rb +306 -0
  55. data/lib/hubspot/version.rb +1 -1
  56. data/sample-apps/search-result-paging-app/.env.template +4 -0
  57. data/sample-apps/search-result-paging-app/.gitignore +35 -0
  58. data/sample-apps/search-result-paging-app/.rspec +1 -0
  59. data/sample-apps/search-result-paging-app/.ruby-version +1 -0
  60. data/sample-apps/search-result-paging-app/Dockerfile +22 -0
  61. data/sample-apps/search-result-paging-app/Gemfile +35 -0
  62. data/sample-apps/search-result-paging-app/Gemfile.lock +279 -0
  63. data/sample-apps/search-result-paging-app/README.md +0 -0
  64. data/sample-apps/search-result-paging-app/Rakefile +6 -0
  65. data/sample-apps/search-result-paging-app/app/assets/config/manifest.js +3 -0
  66. data/sample-apps/search-result-paging-app/app/assets/images/.keep +0 -0
  67. data/sample-apps/search-result-paging-app/app/assets/javascripts/application.js +25 -0
  68. data/sample-apps/search-result-paging-app/app/assets/javascripts/cable.js +13 -0
  69. data/sample-apps/search-result-paging-app/app/assets/javascripts/channels/.keep +0 -0
  70. data/sample-apps/search-result-paging-app/app/assets/stylesheets/application.css +77 -0
  71. data/sample-apps/search-result-paging-app/app/controllers/application_controller.rb +12 -0
  72. data/sample-apps/search-result-paging-app/app/controllers/concerns/.keep +0 -0
  73. data/sample-apps/search-result-paging-app/app/controllers/concerns/exception_handler.rb +12 -0
  74. data/sample-apps/search-result-paging-app/app/controllers/home_controller.rb +14 -0
  75. data/sample-apps/search-result-paging-app/app/controllers/oauth/authorization_controller.rb +19 -0
  76. data/sample-apps/search-result-paging-app/app/helpers/application_helper.rb +2 -0
  77. data/sample-apps/search-result-paging-app/app/lib/services/hubspot/authorization/authorize.rb +17 -0
  78. data/sample-apps/search-result-paging-app/app/lib/services/hubspot/authorization/get_authorization_uri.rb +35 -0
  79. data/sample-apps/search-result-paging-app/app/lib/services/hubspot/authorization/tokens/base.rb +21 -0
  80. data/sample-apps/search-result-paging-app/app/lib/services/hubspot/authorization/tokens/generate.rb +28 -0
  81. data/sample-apps/search-result-paging-app/app/lib/services/hubspot/authorization/tokens/refresh.rb +35 -0
  82. data/sample-apps/search-result-paging-app/app/lib/services/hubspot/contacts/get_page.rb +26 -0
  83. data/sample-apps/search-result-paging-app/app/lib/services/hubspot/contacts/search.rb +35 -0
  84. data/sample-apps/search-result-paging-app/app/lib/services/hubspot/properties/create.rb +23 -0
  85. data/sample-apps/search-result-paging-app/app/lib/services/hubspot/properties/destroy.rb +16 -0
  86. data/sample-apps/search-result-paging-app/app/models/application_record.rb +3 -0
  87. data/sample-apps/search-result-paging-app/app/models/concerns/.keep +0 -0
  88. data/sample-apps/search-result-paging-app/app/views/home/index.html.erb +13 -0
  89. data/sample-apps/search-result-paging-app/app/views/layouts/application.html.erb +23 -0
  90. data/sample-apps/search-result-paging-app/app/views/oauth/authorization/login.html.erb +15 -0
  91. data/sample-apps/search-result-paging-app/app/views/shared/_header.html.erb +18 -0
  92. data/sample-apps/search-result-paging-app/bin/bundle +3 -0
  93. data/sample-apps/search-result-paging-app/bin/rails +9 -0
  94. data/sample-apps/search-result-paging-app/bin/rake +9 -0
  95. data/sample-apps/search-result-paging-app/bin/setup +36 -0
  96. data/sample-apps/search-result-paging-app/bin/spring +17 -0
  97. data/sample-apps/search-result-paging-app/bin/update +31 -0
  98. data/sample-apps/search-result-paging-app/bin/yarn +11 -0
  99. data/sample-apps/search-result-paging-app/config.ru +5 -0
  100. data/sample-apps/search-result-paging-app/config/application.rb +19 -0
  101. data/sample-apps/search-result-paging-app/config/boot.rb +3 -0
  102. data/sample-apps/search-result-paging-app/config/cable.yml +10 -0
  103. data/sample-apps/search-result-paging-app/config/database.yml +25 -0
  104. data/sample-apps/search-result-paging-app/config/environment.rb +5 -0
  105. data/sample-apps/search-result-paging-app/config/environments/development.rb +61 -0
  106. data/sample-apps/search-result-paging-app/config/environments/production.rb +94 -0
  107. data/sample-apps/search-result-paging-app/config/environments/test.rb +46 -0
  108. data/sample-apps/search-result-paging-app/config/initializers/assets.rb +14 -0
  109. data/sample-apps/search-result-paging-app/config/initializers/filter_parameter_logging.rb +4 -0
  110. data/sample-apps/search-result-paging-app/config/initializers/hubspot-api-client.rb +3 -0
  111. data/sample-apps/search-result-paging-app/config/initializers/mime_types.rb +1 -0
  112. data/sample-apps/search-result-paging-app/config/initializers/wrap_parameters.rb +14 -0
  113. data/sample-apps/search-result-paging-app/config/locales/en.yml +33 -0
  114. data/sample-apps/search-result-paging-app/config/puma.rb +34 -0
  115. data/sample-apps/search-result-paging-app/config/routes.rb +7 -0
  116. data/sample-apps/search-result-paging-app/config/spring.rb +6 -0
  117. data/sample-apps/search-result-paging-app/db/seeds.rb +7 -0
  118. data/sample-apps/search-result-paging-app/docker-compose.yml +11 -0
  119. data/sample-apps/search-result-paging-app/docker-entrypoint.sh +8 -0
  120. data/sample-apps/search-result-paging-app/lib/assets/.keep +0 -0
  121. data/sample-apps/search-result-paging-app/lib/tasks/.keep +0 -0
  122. data/sample-apps/search-result-paging-app/lib/tasks/search_contacts.rake +36 -0
  123. data/sample-apps/search-result-paging-app/log/.keep +0 -0
  124. data/sample-apps/search-result-paging-app/package.json +5 -0
  125. data/sample-apps/search-result-paging-app/public/404.html +67 -0
  126. data/sample-apps/search-result-paging-app/public/422.html +67 -0
  127. data/sample-apps/search-result-paging-app/public/500.html +66 -0
  128. data/sample-apps/search-result-paging-app/public/apple-touch-icon-precomposed.png +0 -0
  129. data/sample-apps/search-result-paging-app/public/apple-touch-icon.png +0 -0
  130. data/sample-apps/search-result-paging-app/public/favicon.ico +0 -0
  131. data/sample-apps/search-result-paging-app/public/robots.txt +1 -0
  132. data/sample-apps/search-result-paging-app/tmp/.keep +0 -0
  133. metadata +309 -2
@@ -0,0 +1,257 @@
1
+ =begin
2
+ #CMS Site Search
3
+
4
+ #Use these endpoints for searching content on your HubSpot hosted CMS website(s).
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 SiteSearch
18
+ class SearchHitField
19
+ attr_accessor :metadata_field
20
+
21
+ attr_accessor :values
22
+
23
+ attr_accessor :name
24
+
25
+ attr_accessor :value
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'metadata_field' => :'metadataField',
31
+ :'values' => :'values',
32
+ :'name' => :'name',
33
+ :'value' => :'value'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'metadata_field' => :'Boolean',
41
+ :'values' => :'Array',
42
+ :'name' => :'String',
43
+ :'value' => :'Object'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Cms::SiteSearch::SearchHitField` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Cms::SiteSearch::SearchHitField`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'metadata_field')
69
+ self.metadata_field = attributes[:'metadata_field']
70
+ end
71
+
72
+ if attributes.key?(:'values')
73
+ self.values = attributes[:'values']
74
+ end
75
+
76
+ if attributes.key?(:'name')
77
+ self.name = attributes[:'name']
78
+ end
79
+
80
+ if attributes.key?(:'value')
81
+ self.value = attributes[:'value']
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ invalid_properties = Array.new
89
+ if @metadata_field.nil?
90
+ invalid_properties.push('invalid value for "metadata_field", metadata_field cannot be nil.')
91
+ end
92
+
93
+ if @values.nil?
94
+ invalid_properties.push('invalid value for "values", values cannot be nil.')
95
+ end
96
+
97
+ if @name.nil?
98
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
99
+ end
100
+
101
+ if @value.nil?
102
+ invalid_properties.push('invalid value for "value", value cannot be nil.')
103
+ end
104
+
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ return false if @metadata_field.nil?
112
+ return false if @values.nil?
113
+ return false if @name.nil?
114
+ return false if @value.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
+ metadata_field == o.metadata_field &&
124
+ values == o.values &&
125
+ name == o.name &&
126
+ value == o.value
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param [Object] Object to be compared
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Integer] Hash code
137
+ def hash
138
+ [metadata_field, values, name, value].hash
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def self.build_from_hash(attributes)
145
+ new.build_from_hash(attributes)
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def build_from_hash(attributes)
152
+ return nil unless attributes.is_a?(Hash)
153
+ self.class.openapi_types.each_pair do |key, type|
154
+ if type =~ /\AArray<(.*)>/i
155
+ # check to ensure the input is an array given that the attribute
156
+ # is documented as an array but the input is not
157
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
158
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
159
+ end
160
+ elsif !attributes[self.class.attribute_map[key]].nil?
161
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
162
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
163
+ end
164
+
165
+ self
166
+ end
167
+
168
+ # Deserializes the data based on type
169
+ # @param string type Data type
170
+ # @param string value Value to be deserialized
171
+ # @return [Object] Deserialized data
172
+ def _deserialize(type, value)
173
+ case type.to_sym
174
+ when :DateTime
175
+ DateTime.parse(value)
176
+ when :Date
177
+ Date.parse(value)
178
+ when :String
179
+ value.to_s
180
+ when :Integer
181
+ value.to_i
182
+ when :Float
183
+ value.to_f
184
+ when :Boolean
185
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
186
+ true
187
+ else
188
+ false
189
+ end
190
+ when :Object
191
+ # generic object (usually a Hash), return directly
192
+ value
193
+ when /\AArray<(?<inner_type>.+)>\z/
194
+ inner_type = Regexp.last_match[:inner_type]
195
+ value.map { |v| _deserialize(inner_type, v) }
196
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
197
+ k_type = Regexp.last_match[:k_type]
198
+ v_type = Regexp.last_match[:v_type]
199
+ {}.tap do |hash|
200
+ value.each do |k, v|
201
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
202
+ end
203
+ end
204
+ else # model
205
+ Hubspot::Cms::SiteSearch.const_get(type).build_from_hash(value)
206
+ end
207
+ end
208
+
209
+ # Returns the string representation of the object
210
+ # @return [String] String presentation of the object
211
+ def to_s
212
+ to_hash.to_s
213
+ end
214
+
215
+ # to_body is an alias to to_hash (backward compatibility)
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_body
218
+ to_hash
219
+ end
220
+
221
+ # Returns the object in the form of hash
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_hash
224
+ hash = {}
225
+ self.class.attribute_map.each_pair do |attr, param|
226
+ value = self.send(attr)
227
+ if value.nil?
228
+ is_nullable = self.class.openapi_nullable.include?(attr)
229
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
230
+ end
231
+
232
+ hash[param] = _to_hash(value)
233
+ end
234
+ hash
235
+ end
236
+
237
+ # Outputs non-array value in the form of hash
238
+ # For object, use to_hash. Otherwise, just return the value
239
+ # @param [Object] value Any valid value
240
+ # @return [Hash] Returns the value in the form of hash
241
+ def _to_hash(value)
242
+ if value.is_a?(Array)
243
+ value.compact.map { |v| _to_hash(v) }
244
+ elsif value.is_a?(Hash)
245
+ {}.tap do |hash|
246
+ value.each { |k, v| hash[k] = _to_hash(v) }
247
+ end
248
+ elsif value.respond_to? :to_hash
249
+ value.to_hash
250
+ else
251
+ value
252
+ end
253
+ end
254
+ end
255
+ end
256
+ end
257
+ end
@@ -0,0 +1,368 @@
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 'cgi'
14
+
15
+ module Hubspot
16
+ module Cms
17
+ module UrlRedirects
18
+ class RedirectsApi
19
+ attr_accessor :api_client
20
+
21
+ def initialize(api_client = ApiClient.default)
22
+ @api_client = api_client
23
+ end
24
+ # Delete a redirect
25
+ # Delete one existing redirect, so it is no longer mapped.
26
+ # @param url_redirect_id [String] The ID of the target redirect.
27
+ # @param [Hash] opts the optional parameters
28
+ # @return [nil]
29
+ def archive(url_redirect_id, opts = {})
30
+ archive_with_http_info(url_redirect_id, opts)
31
+ nil
32
+ end
33
+
34
+ # Delete a redirect
35
+ # Delete one existing redirect, so it is no longer mapped.
36
+ # @param url_redirect_id [String] The ID of the target redirect.
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
39
+ def archive_with_http_info(url_redirect_id, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: RedirectsApi.archive ...'
42
+ end
43
+ # verify the required parameter 'url_redirect_id' is set
44
+ if @api_client.config.client_side_validation && url_redirect_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'url_redirect_id' when calling RedirectsApi.archive"
46
+ end
47
+ # resource path
48
+ local_var_path = '/cms/v3/url-redirects/{urlRedirectId}'.sub('{' + 'urlRedirectId' + '}', CGI.escape(url_redirect_id.to_s))
49
+
50
+ # query parameters
51
+ query_params = opts[:query_params] || {}
52
+
53
+ # header parameters
54
+ header_params = opts[:header_params] || {}
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
57
+
58
+ # form parameters
59
+ form_params = opts[:form_params] || {}
60
+
61
+ # http body (model)
62
+ post_body = opts[:body]
63
+
64
+ # return_type
65
+ return_type = opts[:return_type]
66
+
67
+ # auth_names
68
+ auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
69
+
70
+ new_options = opts.merge(
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body,
75
+ :auth_names => auth_names,
76
+ :return_type => return_type
77
+ )
78
+
79
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: RedirectsApi#archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ return data, status_code, headers
84
+ end
85
+
86
+ # Create a redirect
87
+ # Creates and configures a new URL redirect.
88
+ # @param [Hash] opts the optional parameters
89
+ # @option opts [UrlMappingCreateRequestBody] :url_mapping_create_request_body
90
+ # @return [UrlMapping]
91
+ def create(opts = {})
92
+ data, _status_code, _headers = create_with_http_info(opts)
93
+ data
94
+ end
95
+
96
+ # Create a redirect
97
+ # Creates and configures a new URL redirect.
98
+ # @param [Hash] opts the optional parameters
99
+ # @option opts [UrlMappingCreateRequestBody] :url_mapping_create_request_body
100
+ # @return [Array<(UrlMapping, Integer, Hash)>] UrlMapping data, response status code and response headers
101
+ def create_with_http_info(opts = {})
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: RedirectsApi.create ...'
104
+ end
105
+ # resource path
106
+ local_var_path = '/cms/v3/url-redirects/'
107
+
108
+ # query parameters
109
+ query_params = opts[:query_params] || {}
110
+
111
+ # header parameters
112
+ header_params = opts[:header_params] || {}
113
+ # HTTP header 'Accept' (if needed)
114
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
115
+ # HTTP header 'Content-Type'
116
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
117
+
118
+ # form parameters
119
+ form_params = opts[:form_params] || {}
120
+
121
+ # http body (model)
122
+ post_body = opts[:body] || @api_client.object_to_http_body(opts[:'url_mapping_create_request_body'])
123
+
124
+ # return_type
125
+ return_type = opts[:return_type] || 'UrlMapping'
126
+
127
+ # auth_names
128
+ auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
129
+
130
+ new_options = opts.merge(
131
+ :header_params => header_params,
132
+ :query_params => query_params,
133
+ :form_params => form_params,
134
+ :body => post_body,
135
+ :auth_names => auth_names,
136
+ :return_type => return_type
137
+ )
138
+
139
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
140
+ if @api_client.config.debugging
141
+ @api_client.config.logger.debug "API called: RedirectsApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
142
+ end
143
+ return data, status_code, headers
144
+ end
145
+
146
+ # Get details for a redirect
147
+ # Returns the details for a single existing URL redirect by ID.
148
+ # @param url_redirect_id [String] The ID of the target redirect.
149
+ # @param [Hash] opts the optional parameters
150
+ # @return [UrlMapping]
151
+ def get_by_id(url_redirect_id, opts = {})
152
+ data, _status_code, _headers = get_by_id_with_http_info(url_redirect_id, opts)
153
+ data
154
+ end
155
+
156
+ # Get details for a redirect
157
+ # Returns the details for a single existing URL redirect by ID.
158
+ # @param url_redirect_id [String] The ID of the target redirect.
159
+ # @param [Hash] opts the optional parameters
160
+ # @return [Array<(UrlMapping, Integer, Hash)>] UrlMapping data, response status code and response headers
161
+ def get_by_id_with_http_info(url_redirect_id, opts = {})
162
+ if @api_client.config.debugging
163
+ @api_client.config.logger.debug 'Calling API: RedirectsApi.get_by_id ...'
164
+ end
165
+ # verify the required parameter 'url_redirect_id' is set
166
+ if @api_client.config.client_side_validation && url_redirect_id.nil?
167
+ fail ArgumentError, "Missing the required parameter 'url_redirect_id' when calling RedirectsApi.get_by_id"
168
+ end
169
+ # resource path
170
+ local_var_path = '/cms/v3/url-redirects/{urlRedirectId}'.sub('{' + 'urlRedirectId' + '}', CGI.escape(url_redirect_id.to_s))
171
+
172
+ # query parameters
173
+ query_params = opts[:query_params] || {}
174
+
175
+ # header parameters
176
+ header_params = opts[:header_params] || {}
177
+ # HTTP header 'Accept' (if needed)
178
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
179
+
180
+ # form parameters
181
+ form_params = opts[:form_params] || {}
182
+
183
+ # http body (model)
184
+ post_body = opts[:body]
185
+
186
+ # return_type
187
+ return_type = opts[:return_type] || 'UrlMapping'
188
+
189
+ # auth_names
190
+ auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
191
+
192
+ new_options = opts.merge(
193
+ :header_params => header_params,
194
+ :query_params => query_params,
195
+ :form_params => form_params,
196
+ :body => post_body,
197
+ :auth_names => auth_names,
198
+ :return_type => return_type
199
+ )
200
+
201
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
202
+ if @api_client.config.debugging
203
+ @api_client.config.logger.debug "API called: RedirectsApi#get_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
204
+ end
205
+ return data, status_code, headers
206
+ end
207
+
208
+ # Get current redirects
209
+ # Returns all existing URL redirects. Results can be limited and filtered by creation or updated date.
210
+ # @param [Hash] opts the optional parameters
211
+ # @option opts [DateTime] :created_at Only return redirects created on exactly this date.
212
+ # @option opts [DateTime] :created_after Only return redirects created after this date.
213
+ # @option opts [DateTime] :created_before Only return redirects created before this date.
214
+ # @option opts [DateTime] :updated_at Only return redirects last updated on exactly this date.
215
+ # @option opts [DateTime] :updated_after Only return redirects last updated after this date.
216
+ # @option opts [DateTime] :updated_before Only return redirects last updated before this date.
217
+ # @option opts [Array<String>] :sort
218
+ # @option opts [Array<String>] :properties
219
+ # @option opts [String] :after The paging cursor token of the last successfully read resource will be returned as the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.
220
+ # @option opts [String] :before
221
+ # @option opts [Integer] :limit Maximum number of result per page
222
+ # @option opts [Boolean] :archived Whether to return only results that have been archived.
223
+ # @return [CollectionResponseWithTotalUrlMapping]
224
+ def get_page(opts = {})
225
+ data, _status_code, _headers = get_page_with_http_info(opts)
226
+ data
227
+ end
228
+
229
+ # Get current redirects
230
+ # Returns all existing URL redirects. Results can be limited and filtered by creation or updated date.
231
+ # @param [Hash] opts the optional parameters
232
+ # @option opts [DateTime] :created_at Only return redirects created on exactly this date.
233
+ # @option opts [DateTime] :created_after Only return redirects created after this date.
234
+ # @option opts [DateTime] :created_before Only return redirects created before this date.
235
+ # @option opts [DateTime] :updated_at Only return redirects last updated on exactly this date.
236
+ # @option opts [DateTime] :updated_after Only return redirects last updated after this date.
237
+ # @option opts [DateTime] :updated_before Only return redirects last updated before this date.
238
+ # @option opts [Array<String>] :sort
239
+ # @option opts [Array<String>] :properties
240
+ # @option opts [String] :after The paging cursor token of the last successfully read resource will be returned as the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.
241
+ # @option opts [String] :before
242
+ # @option opts [Integer] :limit Maximum number of result per page
243
+ # @option opts [Boolean] :archived Whether to return only results that have been archived.
244
+ # @return [Array<(CollectionResponseWithTotalUrlMapping, Integer, Hash)>] CollectionResponseWithTotalUrlMapping data, response status code and response headers
245
+ def get_page_with_http_info(opts = {})
246
+ if @api_client.config.debugging
247
+ @api_client.config.logger.debug 'Calling API: RedirectsApi.get_page ...'
248
+ end
249
+ # resource path
250
+ local_var_path = '/cms/v3/url-redirects/'
251
+
252
+ # query parameters
253
+ query_params = opts[:query_params] || {}
254
+ query_params[:'createdAt'] = opts[:'created_at'] if !opts[:'created_at'].nil?
255
+ query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil?
256
+ query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil?
257
+ query_params[:'updatedAt'] = opts[:'updated_at'] if !opts[:'updated_at'].nil?
258
+ query_params[:'updatedAfter'] = opts[:'updated_after'] if !opts[:'updated_after'].nil?
259
+ query_params[:'updatedBefore'] = opts[:'updated_before'] if !opts[:'updated_before'].nil?
260
+ query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil?
261
+ query_params[:'properties'] = @api_client.build_collection_param(opts[:'properties'], :multi) if !opts[:'properties'].nil?
262
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
263
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
264
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
265
+ query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?
266
+
267
+ # header parameters
268
+ header_params = opts[:header_params] || {}
269
+ # HTTP header 'Accept' (if needed)
270
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
271
+
272
+ # form parameters
273
+ form_params = opts[:form_params] || {}
274
+
275
+ # http body (model)
276
+ post_body = opts[:body]
277
+
278
+ # return_type
279
+ return_type = opts[:return_type] || 'CollectionResponseWithTotalUrlMapping'
280
+
281
+ # auth_names
282
+ auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
283
+
284
+ new_options = opts.merge(
285
+ :header_params => header_params,
286
+ :query_params => query_params,
287
+ :form_params => form_params,
288
+ :body => post_body,
289
+ :auth_names => auth_names,
290
+ :return_type => return_type
291
+ )
292
+
293
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
294
+ if @api_client.config.debugging
295
+ @api_client.config.logger.debug "API called: RedirectsApi#get_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
296
+ end
297
+ return data, status_code, headers
298
+ end
299
+
300
+ # Update a redirect
301
+ # Updates the settings for an existing URL redirect.
302
+ # @param url_redirect_id [String]
303
+ # @param [Hash] opts the optional parameters
304
+ # @option opts [UrlMapping] :url_mapping
305
+ # @return [UrlMapping]
306
+ def update(url_redirect_id, opts = {})
307
+ data, _status_code, _headers = update_with_http_info(url_redirect_id, opts)
308
+ data
309
+ end
310
+
311
+ # Update a redirect
312
+ # Updates the settings for an existing URL redirect.
313
+ # @param url_redirect_id [String]
314
+ # @param [Hash] opts the optional parameters
315
+ # @option opts [UrlMapping] :url_mapping
316
+ # @return [Array<(UrlMapping, Integer, Hash)>] UrlMapping data, response status code and response headers
317
+ def update_with_http_info(url_redirect_id, opts = {})
318
+ if @api_client.config.debugging
319
+ @api_client.config.logger.debug 'Calling API: RedirectsApi.update ...'
320
+ end
321
+ # verify the required parameter 'url_redirect_id' is set
322
+ if @api_client.config.client_side_validation && url_redirect_id.nil?
323
+ fail ArgumentError, "Missing the required parameter 'url_redirect_id' when calling RedirectsApi.update"
324
+ end
325
+ # resource path
326
+ local_var_path = '/cms/v3/url-redirects/{urlRedirectId}'.sub('{' + 'urlRedirectId' + '}', CGI.escape(url_redirect_id.to_s))
327
+
328
+ # query parameters
329
+ query_params = opts[:query_params] || {}
330
+
331
+ # header parameters
332
+ header_params = opts[:header_params] || {}
333
+ # HTTP header 'Accept' (if needed)
334
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
335
+ # HTTP header 'Content-Type'
336
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
337
+
338
+ # form parameters
339
+ form_params = opts[:form_params] || {}
340
+
341
+ # http body (model)
342
+ post_body = opts[:body] || @api_client.object_to_http_body(opts[:'url_mapping'])
343
+
344
+ # return_type
345
+ return_type = opts[:return_type] || 'UrlMapping'
346
+
347
+ # auth_names
348
+ auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
349
+
350
+ new_options = opts.merge(
351
+ :header_params => header_params,
352
+ :query_params => query_params,
353
+ :form_params => form_params,
354
+ :body => post_body,
355
+ :auth_names => auth_names,
356
+ :return_type => return_type
357
+ )
358
+
359
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
360
+ if @api_client.config.debugging
361
+ @api_client.config.logger.debug "API called: RedirectsApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
362
+ end
363
+ return data, status_code, headers
364
+ end
365
+ end
366
+ end
367
+ end
368
+ end