reacon-sdk 0.2.0.beta.1 → 0.4.0.beta.1

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 (30) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -5
  3. data/lib/reacon-sdk/http_policy.rb +15 -0
  4. data/lib/reacon-sdk/models/batch_verification_request_only_if_free.rb +1 -0
  5. data/lib/reacon-sdk/models/integration_capability_response.rb +5 -7
  6. data/lib/reacon-sdk/models/integration_capability_response_output.rb +9 -11
  7. data/lib/reacon-sdk/models/integration_capability_response_output_non_null.rb +105 -0
  8. data/lib/reacon-sdk/models/mail_cadence_node.rb +1 -0
  9. data/lib/reacon-sdk/models/mail_conversation_entry_last_error.rb +1 -0
  10. data/lib/reacon-sdk/models/mail_experiment_report_decision.rb +1 -0
  11. data/lib/reacon-sdk/models/mail_experiment_variant.rb +1 -0
  12. data/lib/reacon-sdk/models/mail_get_portfolio_response200.rb +1 -0
  13. data/lib/reacon-sdk/models/mail_get_portfolio_response200_portfolio.rb +1 -0
  14. data/lib/reacon-sdk/models/mail_get_tracking_domain_response200_domain.rb +1 -0
  15. data/lib/reacon-sdk/models/mail_mailbox_provider_kind.rb +1 -0
  16. data/lib/reacon-sdk/models/mail_post_analytics_export_response200.rb +1 -15
  17. data/lib/reacon-sdk/models/mail_post_analytics_export_response200_next_cursor.rb +160 -73
  18. data/lib/reacon-sdk/models/mail_post_cadence_campaigns_by_campaign_id_state_response200.rb +1 -0
  19. data/lib/reacon-sdk/models/mail_post_cadences_request_nodes_inner.rb +1 -0
  20. data/lib/reacon-sdk/models/mail_post_campaigns_by_campaign_id_launch_response200.rb +1 -0
  21. data/lib/reacon-sdk/models/mail_post_campaigns_by_campaign_id_launch_response200_campaign.rb +1 -0
  22. data/lib/reacon-sdk/models/mail_post_inbox_by_message_id_response200_message.rb +1 -0
  23. data/lib/reacon-sdk/models/mail_post_portfolio_suppressions_request.rb +1 -0
  24. data/lib/reacon-sdk/models/mail_post_suppressions_request.rb +1 -0
  25. data/lib/reacon-sdk/models/mail_provider_failure.rb +1 -0
  26. data/lib/reacon-sdk/models/product_tool_request_input.rb +1 -0
  27. data/lib/reacon-sdk/version.rb +1 -1
  28. data/lib/reacon-sdk.rb +1 -1
  29. metadata +3 -3
  30. data/lib/reacon-sdk/models/mail_post_analytics_export_response200_next_cursor_any_of.rb +0 -190
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39ae79e4ecfce5a741d80459094c38d5b661da882f1d37c7a1992a0043be8948
4
- data.tar.gz: ba0e2ece6303277cb70f27e5c5daa46dfe3547eb11b828214e8a1750df445520
3
+ metadata.gz: 13f1bd64f6305766b62c2a0af00e9aae0c630c4f53cc4328064558bf766887cf
4
+ data.tar.gz: 9487c0848eea948629f7f8ce43e4300bfccd3def83b35b899cf29b19b492fd1a
5
5
  SHA512:
6
- metadata.gz: 1807c9ddbca2ddc07b35bf3c7b15ce71811874225dbf337f8c5c78617a1064388336b3fb93931ad89c00cc6ee909e6d3a4365cec7d9a0b9df3c039681520ad4b
7
- data.tar.gz: bb705f7c263e2bfefb6bd76429896393fd5fb00b8bfd086e8ec7622de50f9f2b8ffafe578652902bae6d2b8b83275de4212a68c74a1e0d3372f7946f282e7e8f
6
+ metadata.gz: 422685de7d0a9f6f40676ecc59673852c4a9197ebce67e3eaa466c9fa2bd6dc6680635aae670f295d1899b93d4bfebfee30de053382b2f1afdd693d11df6415f
7
+ data.tar.gz: 99d582518accfcf9ffe5b0ed0d201b4f8af5ed4ccb4a646a1a94c659538e131445fddf1dca5b9e65f48d95633f9cf0da8da03b02c32d6061c1cb1a1cc3b32c3d
data/README.md CHANGED
@@ -7,7 +7,7 @@ No description provided (generated by Openapi Generator https://github.com/opena
7
7
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
8
 
9
9
  - API version: 0.1.0
10
- - Package version: 0.2.0.beta.1
10
+ - Package version: 0.4.0.beta.1
11
11
  - Generator version: 7.25.0
12
12
  - Build package: org.openapitools.codegen.languages.RubyClientCodegen
13
13
 
@@ -24,16 +24,16 @@ gem build reacon-sdk.gemspec
24
24
  Then either install the gem locally:
25
25
 
26
26
  ```shell
27
- gem install ./reacon-sdk-0.2.0.beta.1.gem
27
+ gem install ./reacon-sdk-0.4.0.beta.1.gem
28
28
  ```
29
29
 
30
- (for development, run `gem install --dev ./reacon-sdk-0.2.0.beta.1.gem` to install the development dependencies)
30
+ (for development, run `gem install --dev ./reacon-sdk-0.4.0.beta.1.gem` to install the development dependencies)
31
31
 
32
32
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
33
33
 
34
34
  Finally add this to the Gemfile:
35
35
 
36
- gem 'reacon-sdk', '~> 0.2.0.beta.1'
36
+ gem 'reacon-sdk', '~> 0.4.0.beta.1'
37
37
 
38
38
  ### Install from Git
39
39
 
@@ -397,6 +397,7 @@ Class | Method | HTTP request | Description
397
397
  - [Reacon::InspectGoogleSheetRequest](docs/InspectGoogleSheetRequest.md)
398
398
  - [Reacon::IntegrationCapabilityResponse](docs/IntegrationCapabilityResponse.md)
399
399
  - [Reacon::IntegrationCapabilityResponseOutput](docs/IntegrationCapabilityResponseOutput.md)
400
+ - [Reacon::IntegrationCapabilityResponseOutputNonNull](docs/IntegrationCapabilityResponseOutputNonNull.md)
400
401
  - [Reacon::IntegrationConnection](docs/IntegrationConnection.md)
401
402
  - [Reacon::IntegrationConnectionHealth](docs/IntegrationConnectionHealth.md)
402
403
  - [Reacon::IntegrationConnectionList](docs/IntegrationConnectionList.md)
@@ -560,7 +561,6 @@ Class | Method | HTTP request | Description
560
561
  - [Reacon::MailPostAnalyticsExportRequestAfter](docs/MailPostAnalyticsExportRequestAfter.md)
561
562
  - [Reacon::MailPostAnalyticsExportResponse200](docs/MailPostAnalyticsExportResponse200.md)
562
563
  - [Reacon::MailPostAnalyticsExportResponse200NextCursor](docs/MailPostAnalyticsExportResponse200NextCursor.md)
563
- - [Reacon::MailPostAnalyticsExportResponse200NextCursorAnyOf](docs/MailPostAnalyticsExportResponse200NextCursorAnyOf.md)
564
564
  - [Reacon::MailPostCadenceCampaignsByCampaignIdStateRequest](docs/MailPostCadenceCampaignsByCampaignIdStateRequest.md)
565
565
  - [Reacon::MailPostCadenceCampaignsByCampaignIdStateResponse200](docs/MailPostCadenceCampaignsByCampaignIdStateResponse200.md)
566
566
  - [Reacon::MailPostCadenceCampaignsByCampaignIdStateResponse200AnyOf](docs/MailPostCadenceCampaignsByCampaignIdStateResponse200AnyOf.md)
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
  # Copyright Reacon contributors. Licensed under Apache-2.0.
3
3
  require 'timeout'
4
+ require 'date'
5
+ require 'time'
4
6
 
5
7
  module Reacon
6
8
  class RequestTimeoutError < StandardError
@@ -112,6 +114,19 @@ module Reacon
112
114
  end
113
115
 
114
116
  module HttpClientPolicy
117
+ # JSON's default Time encoder emits a human-readable, non-RFC3339 string.
118
+ # Traverse nested generated models/maps so every date uses its wire format.
119
+ def object_to_hash(value)
120
+ case value
121
+ when Time then value.getutc.iso8601(9).sub(/\.0+Z$/, 'Z').sub(/(\.\d*?[1-9])0+Z$/, '\\1Z')
122
+ when DateTime then value.new_offset(0).iso8601(9).sub('+00:00', 'Z').sub(/\.0+Z$/, 'Z').sub(/(\.\d*?[1-9])0+Z$/, '\\1Z')
123
+ when Date then value.iso8601
124
+ when Array then value.map { |item| object_to_hash(item) }
125
+ when Hash then value.transform_values { |item| object_to_hash(item) }
126
+ else value.respond_to?(:to_hash) ? object_to_hash(value.to_hash) : value
127
+ end
128
+ end
129
+
115
130
  def call_api(http_method, path, opts = {})
116
131
  seconds = HttpPolicy.seconds(opts.fetch(:request_timeout, config.timeout))
117
132
  stream = nil
@@ -28,6 +28,7 @@ module Reacon
28
28
  # @param [Mixed] Data to be matched against the list of anyOf items
29
29
  # @return [Object] Returns the model or the data itself
30
30
  def build(data)
31
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
31
32
  # Go through the list of anyOf items and attempt to identify the appropriate one.
32
33
  # Note:
33
34
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -70,7 +70,7 @@ module Reacon
70
70
  :'estimated_credits' => :'Integer',
71
71
  :'execution_id' => :'String',
72
72
  :'mode' => :'String',
73
- :'output' => :'IntegrationCapabilityResponseOutput',
73
+ :'output' => :'IntegrationCapabilityResponseOutputNonNull',
74
74
  :'replay' => :'Boolean'
75
75
  }
76
76
  end
@@ -78,6 +78,7 @@ module Reacon
78
78
  # List of attributes with nullable: true
79
79
  def self.openapi_nullable
80
80
  Set.new([
81
+ :'output',
81
82
  ])
82
83
  end
83
84
 
@@ -142,7 +143,7 @@ module Reacon
142
143
  if attributes.key?(:'output')
143
144
  self.output = attributes[:'output']
144
145
  else
145
- self.output = nil
146
+ fail ArgumentError, 'output is required'
146
147
  end
147
148
 
148
149
  if attributes.key?(:'replay')
@@ -185,7 +186,7 @@ module Reacon
185
186
  invalid_properties.push('invalid value for "mode", mode cannot be nil.')
186
187
  end
187
188
 
188
- if @output.nil?
189
+ unless instance_variable_defined?(:@output)
189
190
  invalid_properties.push('invalid value for "output", output cannot be nil.')
190
191
  end
191
192
 
@@ -207,7 +208,7 @@ module Reacon
207
208
  return false if @estimated_credits.nil?
208
209
  return false if @execution_id.nil?
209
210
  return false if @mode.nil?
210
- return false if @output.nil?
211
+ return false unless instance_variable_defined?(:@output)
211
212
  return false if @replay.nil?
212
213
  true
213
214
  end
@@ -285,9 +286,6 @@ module Reacon
285
286
  # Custom attribute writer method with validation
286
287
  # @param [Object] output Value to be assigned
287
288
  def output=(output)
288
- if output.nil?
289
- fail ArgumentError, 'output cannot be nil'
290
- end
291
289
 
292
290
  @output = output
293
291
  end
@@ -17,28 +17,26 @@ module Reacon
17
17
  # Null in preview mode; otherwise the result for the selected capability.
18
18
  module IntegrationCapabilityResponseOutput
19
19
  class << self
20
- # List of class defined in oneOf (OpenAPI v3)
21
- def openapi_one_of
20
+ # List of class defined in anyOf (OpenAPI v3)
21
+ def openapi_any_of
22
22
  [
23
- :'CapabilityDomainSearch',
24
- :'CapabilityEmailFound',
25
- :'CapabilityEmailVerified',
23
+ :'IntegrationCapabilityResponseOutputNonNull',
26
24
  :'Object'
27
25
  ]
28
26
  end
29
27
 
30
28
  # Builds the object
31
- # @param [Mixed] Data to be matched against the list of oneOf items
29
+ # @param [Mixed] Data to be matched against the list of anyOf items
32
30
  # @return [Object] Returns the model or the data itself
33
31
  def build(data)
34
- # Go through the list of oneOf items and attempt to identify the appropriate one.
32
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
33
+ # Go through the list of anyOf items and attempt to identify the appropriate one.
35
34
  # Note:
36
- # - We do not attempt to check whether exactly one item matches.
37
35
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
38
36
  # due to the way the deserialization is made in the base_object template (it just casts without verifying).
39
37
  # - TODO: scalar values are de facto behaving as if they were nullable.
40
38
  # - TODO: logging when debugging is set.
41
- openapi_one_of.each do |klass|
39
+ openapi_any_of.each do |klass|
42
40
  begin
43
41
  next if klass == :AnyType # "nullable: true"
44
42
  return find_and_cast_into_type(klass, data)
@@ -46,7 +44,7 @@ module Reacon
46
44
  end
47
45
  end
48
46
 
49
- openapi_one_of.include?(:AnyType) ? data : nil
47
+ openapi_any_of.include?(:AnyType) ? data : nil
50
48
  end
51
49
 
52
50
  private
@@ -85,7 +83,7 @@ module Reacon
85
83
  else # model
86
84
  const = Reacon.const_get(klass)
87
85
  if const
88
- if const.respond_to?(:openapi_one_of) # nested oneOf model
86
+ if const.respond_to?(:openapi_any_of) # nested anyOf model
89
87
  model = const.build(data)
90
88
  return model if model
91
89
  else
@@ -0,0 +1,105 @@
1
+ =begin
2
+ #Reacon API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Reacon
17
+ module IntegrationCapabilityResponseOutputNonNull
18
+ class << self
19
+ # List of class defined in oneOf (OpenAPI v3)
20
+ def openapi_one_of
21
+ [
22
+ :'CapabilityDomainSearch',
23
+ :'CapabilityEmailFound',
24
+ :'CapabilityEmailVerified'
25
+ ]
26
+ end
27
+
28
+ # Builds the object
29
+ # @param [Mixed] Data to be matched against the list of oneOf items
30
+ # @return [Object] Returns the model or the data itself
31
+ def build(data)
32
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
33
+ # Note:
34
+ # - We do not attempt to check whether exactly one item matches.
35
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
36
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
37
+ # - TODO: scalar values are de facto behaving as if they were nullable.
38
+ # - TODO: logging when debugging is set.
39
+ openapi_one_of.each do |klass|
40
+ begin
41
+ next if klass == :AnyType # "nullable: true"
42
+ return find_and_cast_into_type(klass, data)
43
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
44
+ end
45
+ end
46
+
47
+ openapi_one_of.include?(:AnyType) ? data : nil
48
+ end
49
+
50
+ private
51
+
52
+ SchemaMismatchError = Class.new(StandardError)
53
+
54
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
55
+ def find_and_cast_into_type(klass, data)
56
+ return if data.nil?
57
+
58
+ case klass.to_s
59
+ when 'Boolean'
60
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
61
+ when 'Float'
62
+ return data if data.instance_of?(Float)
63
+ when 'Integer'
64
+ return data if data.instance_of?(Integer)
65
+ when 'Time'
66
+ return Time.parse(data)
67
+ when 'Date'
68
+ return Date.iso8601(data)
69
+ when 'String'
70
+ return data if data.instance_of?(String)
71
+ when 'Object' # "type: object"
72
+ return data if data.instance_of?(Hash)
73
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
74
+ if data.instance_of?(Array)
75
+ sub_type = Regexp.last_match[:sub_type]
76
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
77
+ end
78
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
79
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
80
+ sub_type = Regexp.last_match[:sub_type]
81
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
82
+ end
83
+ else # model
84
+ const = Reacon.const_get(klass)
85
+ if const
86
+ if const.respond_to?(:openapi_one_of) # nested oneOf model
87
+ model = const.build(data)
88
+ return model if model
89
+ else
90
+ # raise if data contains keys that are not known to the model
91
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
92
+ model = const.build_from_hash(data)
93
+ return model if model
94
+ end
95
+ end
96
+ end
97
+
98
+ raise # if no match by now, raise
99
+ rescue
100
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
101
+ end
102
+ end
103
+ end
104
+
105
+ end
@@ -33,6 +33,7 @@ module Reacon
33
33
  # @param [Mixed] Data to be matched against the list of anyOf items
34
34
  # @return [Object] Returns the model or the data itself
35
35
  def build(data)
36
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
36
37
  # Go through the list of anyOf items and attempt to identify the appropriate one.
37
38
  # Note:
38
39
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -29,6 +29,7 @@ module Reacon
29
29
  # @param [Mixed] Data to be matched against the list of anyOf items
30
30
  # @return [Object] Returns the model or the data itself
31
31
  def build(data)
32
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
32
33
  # Go through the list of anyOf items and attempt to identify the appropriate one.
33
34
  # Note:
34
35
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -28,6 +28,7 @@ module Reacon
28
28
  # @param [Mixed] Data to be matched against the list of anyOf items
29
29
  # @return [Object] Returns the model or the data itself
30
30
  def build(data)
31
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
31
32
  # Go through the list of anyOf items and attempt to identify the appropriate one.
32
33
  # Note:
33
34
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -28,6 +28,7 @@ module Reacon
28
28
  # @param [Mixed] Data to be matched against the list of anyOf items
29
29
  # @return [Object] Returns the model or the data itself
30
30
  def build(data)
31
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
31
32
  # Go through the list of anyOf items and attempt to identify the appropriate one.
32
33
  # Note:
33
34
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -28,6 +28,7 @@ module Reacon
28
28
  # @param [Mixed] Data to be matched against the list of anyOf items
29
29
  # @return [Object] Returns the model or the data itself
30
30
  def build(data)
31
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
31
32
  # Go through the list of anyOf items and attempt to identify the appropriate one.
32
33
  # Note:
33
34
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -28,6 +28,7 @@ module Reacon
28
28
  # @param [Mixed] Data to be matched against the list of anyOf items
29
29
  # @return [Object] Returns the model or the data itself
30
30
  def build(data)
31
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
31
32
  # Go through the list of anyOf items and attempt to identify the appropriate one.
32
33
  # Note:
33
34
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -28,6 +28,7 @@ module Reacon
28
28
  # @param [Mixed] Data to be matched against the list of anyOf items
29
29
  # @return [Object] Returns the model or the data itself
30
30
  def build(data)
31
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
31
32
  # Go through the list of anyOf items and attempt to identify the appropriate one.
32
33
  # Note:
33
34
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -29,6 +29,7 @@ module Reacon
29
29
  # @param [Mixed] Data to be matched against the list of anyOf items
30
30
  # @return [Object] Returns the model or the data itself
31
31
  def build(data)
32
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
32
33
  # Go through the list of anyOf items and attempt to identify the appropriate one.
33
34
  # Note:
34
35
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -82,6 +82,7 @@ module Reacon
82
82
  # List of attributes with nullable: true
83
83
  def self.openapi_nullable
84
84
  Set.new([
85
+ :'next_cursor',
85
86
  ])
86
87
  end
87
88
 
@@ -149,10 +150,6 @@ module Reacon
149
150
  invalid_properties.push('invalid value for "filename", filename cannot be nil.')
150
151
  end
151
152
 
152
- if @next_cursor.nil?
153
- invalid_properties.push('invalid value for "next_cursor", next_cursor cannot be nil.')
154
- end
155
-
156
153
  if @row_count.nil?
157
154
  invalid_properties.push('invalid value for "row_count", row_count cannot be nil.')
158
155
  end
@@ -169,7 +166,6 @@ module Reacon
169
166
  content_type_validator = EnumAttributeValidator.new('String', ["text/csv; charset=utf-8"])
170
167
  return false unless content_type_validator.valid?(@content_type)
171
168
  return false if @filename.nil?
172
- return false if @next_cursor.nil?
173
169
  return false if @row_count.nil?
174
170
  true
175
171
  end
@@ -204,16 +200,6 @@ module Reacon
204
200
  @filename = filename
205
201
  end
206
202
 
207
- # Custom attribute writer method with validation
208
- # @param [Object] next_cursor Value to be assigned
209
- def next_cursor=(next_cursor)
210
- if next_cursor.nil?
211
- fail ArgumentError, 'next_cursor cannot be nil'
212
- end
213
-
214
- @next_cursor = next_cursor
215
- end
216
-
217
203
  # Custom attribute writer method with validation
218
204
  # @param [Object] row_count Value to be assigned
219
205
  def row_count=(row_count)
@@ -14,90 +14,177 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Reacon
17
- module MailPostAnalyticsExportResponse200NextCursor
18
- class << self
19
- # List of class defined in anyOf (OpenAPI v3)
20
- def openapi_any_of
21
- [
22
- :'MailPostAnalyticsExportResponse200NextCursorAnyOf',
23
- :'Object'
24
- ]
17
+ class MailPostAnalyticsExportResponse200NextCursor < ApiModelBase
18
+ attr_accessor :created_at
19
+
20
+ attr_accessor :id
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'created_at' => :'createdAt',
26
+ :'id' => :'id'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'created_at' => :'String',
44
+ :'id' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Reacon::MailPostAnalyticsExportResponse200NextCursor` initialize method"
25
59
  end
26
60
 
27
- # Builds the object
28
- # @param [Mixed] Data to be matched against the list of anyOf items
29
- # @return [Object] Returns the model or the data itself
30
- def build(data)
31
- # Go through the list of anyOf items and attempt to identify the appropriate one.
32
- # Note:
33
- # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
34
- # due to the way the deserialization is made in the base_object template (it just casts without verifying).
35
- # - TODO: scalar values are de facto behaving as if they were nullable.
36
- # - TODO: logging when debugging is set.
37
- openapi_any_of.each do |klass|
38
- begin
39
- next if klass == :AnyType # "nullable: true"
40
- return find_and_cast_into_type(klass, data)
41
- rescue # rescue all errors so we keep iterating even if the current item lookup raises
42
- end
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Reacon::MailPostAnalyticsExportResponse200NextCursor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
43
66
  end
67
+ h[k.to_sym] = v
68
+ }
44
69
 
45
- openapi_any_of.include?(:AnyType) ? data : nil
70
+ if attributes.key?(:'created_at')
71
+ self.created_at = attributes[:'created_at']
72
+ else
73
+ self.created_at = nil
46
74
  end
47
75
 
48
- private
49
-
50
- SchemaMismatchError = Class.new(StandardError)
51
-
52
- # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
53
- def find_and_cast_into_type(klass, data)
54
- return if data.nil?
55
-
56
- case klass.to_s
57
- when 'Boolean'
58
- return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
59
- when 'Float'
60
- return data if data.instance_of?(Float)
61
- when 'Integer'
62
- return data if data.instance_of?(Integer)
63
- when 'Time'
64
- return Time.parse(data)
65
- when 'Date'
66
- return Date.iso8601(data)
67
- when 'String'
68
- return data if data.instance_of?(String)
69
- when 'Object' # "type: object"
70
- return data if data.instance_of?(Hash)
71
- when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
72
- if data.instance_of?(Array)
73
- sub_type = Regexp.last_match[:sub_type]
74
- return data.map { |item| find_and_cast_into_type(sub_type, item) }
75
- end
76
- when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
77
- if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
78
- sub_type = Regexp.last_match[:sub_type]
79
- return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
80
- end
81
- else # model
82
- const = Reacon.const_get(klass)
83
- if const
84
- if const.respond_to?(:openapi_any_of) # nested anyOf model
85
- model = const.build(data)
86
- return model if model
87
- else
88
- # raise if data contains keys that are not known to the model
89
- raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
90
- model = const.build_from_hash(data)
91
- return model if model
92
- end
76
+ if attributes.key?(:'id')
77
+ self.id = attributes[:'id']
78
+ else
79
+ self.id = nil
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if @created_at.nil?
89
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
90
+ end
91
+
92
+ if @id.nil?
93
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
94
+ end
95
+
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ return false if @created_at.nil?
104
+ return false if @id.nil?
105
+ true
106
+ end
107
+
108
+ # Custom attribute writer method with validation
109
+ # @param [Object] created_at Value to be assigned
110
+ def created_at=(created_at)
111
+ if created_at.nil?
112
+ fail ArgumentError, 'created_at cannot be nil'
113
+ end
114
+
115
+ @created_at = created_at
116
+ end
117
+
118
+ # Custom attribute writer method with validation
119
+ # @param [Object] id Value to be assigned
120
+ def id=(id)
121
+ if id.nil?
122
+ fail ArgumentError, 'id cannot be nil'
123
+ end
124
+
125
+ @id = id
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ created_at == o.created_at &&
134
+ id == o.id
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [created_at, id].hash
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 self.build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ attributes = attributes.transform_keys(&:to_sym)
155
+ transformed_hash = {}
156
+ openapi_types.each_pair do |key, type|
157
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = nil
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[attribute_map[key]].is_a?(Array)
163
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
93
164
  end
165
+ elsif !attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
94
167
  end
168
+ end
169
+ new(transformed_hash)
170
+ end
95
171
 
96
- raise # if no match by now, raise
97
- rescue
98
- raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ if value.nil?
179
+ is_nullable = self.class.openapi_nullable.include?(attr)
180
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
+ end
182
+
183
+ hash[param] = _to_hash(value)
99
184
  end
185
+ hash
100
186
  end
187
+
101
188
  end
102
189
 
103
190
  end
@@ -28,6 +28,7 @@ module Reacon
28
28
  # @param [Mixed] Data to be matched against the list of anyOf items
29
29
  # @return [Object] Returns the model or the data itself
30
30
  def build(data)
31
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
31
32
  # Go through the list of anyOf items and attempt to identify the appropriate one.
32
33
  # Note:
33
34
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -34,6 +34,7 @@ module Reacon
34
34
  # @param [Mixed] Data to be matched against the list of anyOf items
35
35
  # @return [Object] Returns the model or the data itself
36
36
  def build(data)
37
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
37
38
  # Go through the list of anyOf items and attempt to identify the appropriate one.
38
39
  # Note:
39
40
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -28,6 +28,7 @@ module Reacon
28
28
  # @param [Mixed] Data to be matched against the list of anyOf items
29
29
  # @return [Object] Returns the model or the data itself
30
30
  def build(data)
31
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
31
32
  # Go through the list of anyOf items and attempt to identify the appropriate one.
32
33
  # Note:
33
34
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -28,6 +28,7 @@ module Reacon
28
28
  # @param [Mixed] Data to be matched against the list of anyOf items
29
29
  # @return [Object] Returns the model or the data itself
30
30
  def build(data)
31
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
31
32
  # Go through the list of anyOf items and attempt to identify the appropriate one.
32
33
  # Note:
33
34
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -28,6 +28,7 @@ module Reacon
28
28
  # @param [Mixed] Data to be matched against the list of anyOf items
29
29
  # @return [Object] Returns the model or the data itself
30
30
  def build(data)
31
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
31
32
  # Go through the list of anyOf items and attempt to identify the appropriate one.
32
33
  # Note:
33
34
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -28,6 +28,7 @@ module Reacon
28
28
  # @param [Mixed] Data to be matched against the list of anyOf items
29
29
  # @return [Object] Returns the model or the data itself
30
30
  def build(data)
31
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
31
32
  # Go through the list of anyOf items and attempt to identify the appropriate one.
32
33
  # Note:
33
34
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -28,6 +28,7 @@ module Reacon
28
28
  # @param [Mixed] Data to be matched against the list of anyOf items
29
29
  # @return [Object] Returns the model or the data itself
30
30
  def build(data)
31
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
31
32
  # Go through the list of anyOf items and attempt to identify the appropriate one.
32
33
  # Note:
33
34
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -29,6 +29,7 @@ module Reacon
29
29
  # @param [Mixed] Data to be matched against the list of anyOf items
30
30
  # @return [Object] Returns the model or the data itself
31
31
  def build(data)
32
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
32
33
  # Go through the list of anyOf items and attempt to identify the appropriate one.
33
34
  # Note:
34
35
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -56,6 +56,7 @@ module Reacon
56
56
  # @param [Mixed] Data to be matched against the list of anyOf items
57
57
  # @return [Object] Returns the model or the data itself
58
58
  def build(data)
59
+ data = data.transform_keys(&:to_sym) if data.is_a?(Hash)
59
60
  # Go through the list of anyOf items and attempt to identify the appropriate one.
60
61
  # Note:
61
62
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -11,5 +11,5 @@ Generator version: 7.25.0
11
11
  =end
12
12
 
13
13
  module Reacon
14
- VERSION = '0.2.0.beta.1'
14
+ VERSION = '0.4.0.beta.1'
15
15
  end
data/lib/reacon-sdk.rb CHANGED
@@ -140,6 +140,7 @@ require 'reacon-sdk/models/inspect_excel_workbook_request'
140
140
  require 'reacon-sdk/models/inspect_google_sheet_request'
141
141
  require 'reacon-sdk/models/integration_capability_response'
142
142
  require 'reacon-sdk/models/integration_capability_response_output'
143
+ require 'reacon-sdk/models/integration_capability_response_output_non_null'
143
144
  require 'reacon-sdk/models/integration_connection'
144
145
  require 'reacon-sdk/models/integration_connection_health'
145
146
  require 'reacon-sdk/models/integration_connection_list'
@@ -303,7 +304,6 @@ require 'reacon-sdk/models/mail_post_analytics_export_request'
303
304
  require 'reacon-sdk/models/mail_post_analytics_export_request_after'
304
305
  require 'reacon-sdk/models/mail_post_analytics_export_response200'
305
306
  require 'reacon-sdk/models/mail_post_analytics_export_response200_next_cursor'
306
- require 'reacon-sdk/models/mail_post_analytics_export_response200_next_cursor_any_of'
307
307
  require 'reacon-sdk/models/mail_post_cadence_campaigns_by_campaign_id_state_request'
308
308
  require 'reacon-sdk/models/mail_post_cadence_campaigns_by_campaign_id_state_response200'
309
309
  require 'reacon-sdk/models/mail_post_cadence_campaigns_by_campaign_id_state_response200_any_of'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reacon-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.beta.1
4
+ version: 0.4.0.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reacon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-28 00:00:00.000000000 Z
11
+ date: 2026-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: event_stream_parser
@@ -284,6 +284,7 @@ files:
284
284
  - lib/reacon-sdk/models/inspect_google_sheet_request.rb
285
285
  - lib/reacon-sdk/models/integration_capability_response.rb
286
286
  - lib/reacon-sdk/models/integration_capability_response_output.rb
287
+ - lib/reacon-sdk/models/integration_capability_response_output_non_null.rb
287
288
  - lib/reacon-sdk/models/integration_connection.rb
288
289
  - lib/reacon-sdk/models/integration_connection_health.rb
289
290
  - lib/reacon-sdk/models/integration_connection_list.rb
@@ -447,7 +448,6 @@ files:
447
448
  - lib/reacon-sdk/models/mail_post_analytics_export_request_after.rb
448
449
  - lib/reacon-sdk/models/mail_post_analytics_export_response200.rb
449
450
  - lib/reacon-sdk/models/mail_post_analytics_export_response200_next_cursor.rb
450
- - lib/reacon-sdk/models/mail_post_analytics_export_response200_next_cursor_any_of.rb
451
451
  - lib/reacon-sdk/models/mail_post_cadence_campaigns_by_campaign_id_state_request.rb
452
452
  - lib/reacon-sdk/models/mail_post_cadence_campaigns_by_campaign_id_state_response200.rb
453
453
  - lib/reacon-sdk/models/mail_post_cadence_campaigns_by_campaign_id_state_response200_any_of.rb
@@ -1,190 +0,0 @@
1
- =begin
2
- #Reacon API
3
-
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
-
6
- The version of the OpenAPI document: 0.1.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.25.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module Reacon
17
- class MailPostAnalyticsExportResponse200NextCursorAnyOf < ApiModelBase
18
- attr_accessor :created_at
19
-
20
- attr_accessor :id
21
-
22
- # Attribute mapping from ruby-style variable name to JSON key.
23
- def self.attribute_map
24
- {
25
- :'created_at' => :'createdAt',
26
- :'id' => :'id'
27
- }
28
- end
29
-
30
- # Returns attribute mapping this model knows about
31
- def self.acceptable_attribute_map
32
- attribute_map
33
- end
34
-
35
- # Returns all the JSON keys this model knows about
36
- def self.acceptable_attributes
37
- acceptable_attribute_map.values
38
- end
39
-
40
- # Attribute type mapping.
41
- def self.openapi_types
42
- {
43
- :'created_at' => :'String',
44
- :'id' => :'String'
45
- }
46
- end
47
-
48
- # List of attributes with nullable: true
49
- def self.openapi_nullable
50
- Set.new([
51
- ])
52
- end
53
-
54
- # Initializes the object
55
- # @param [Hash] attributes Model attributes in the form of hash
56
- def initialize(attributes = {})
57
- if (!attributes.is_a?(Hash))
58
- fail ArgumentError, "The input argument (attributes) must be a hash in `Reacon::MailPostAnalyticsExportResponse200NextCursorAnyOf` initialize method"
59
- end
60
-
61
- # check to see if the attribute exists and convert string to symbol for hash key
62
- acceptable_attribute_map = self.class.acceptable_attribute_map
63
- attributes = attributes.each_with_object({}) { |(k, v), h|
64
- if (!acceptable_attribute_map.key?(k.to_sym))
65
- fail ArgumentError, "`#{k}` is not a valid attribute in `Reacon::MailPostAnalyticsExportResponse200NextCursorAnyOf`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
- end
67
- h[k.to_sym] = v
68
- }
69
-
70
- if attributes.key?(:'created_at')
71
- self.created_at = attributes[:'created_at']
72
- else
73
- self.created_at = nil
74
- end
75
-
76
- if attributes.key?(:'id')
77
- self.id = attributes[:'id']
78
- else
79
- self.id = nil
80
- end
81
- end
82
-
83
- # Show invalid properties with the reasons. Usually used together with valid?
84
- # @return Array for valid properties with the reasons
85
- def list_invalid_properties
86
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
- invalid_properties = Array.new
88
- if @created_at.nil?
89
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
90
- end
91
-
92
- if @id.nil?
93
- invalid_properties.push('invalid value for "id", id cannot be nil.')
94
- end
95
-
96
- invalid_properties
97
- end
98
-
99
- # Check to see if the all the properties in the model are valid
100
- # @return true if the model is valid
101
- def valid?
102
- warn '[DEPRECATED] the `valid?` method is obsolete'
103
- return false if @created_at.nil?
104
- return false if @id.nil?
105
- true
106
- end
107
-
108
- # Custom attribute writer method with validation
109
- # @param [Object] created_at Value to be assigned
110
- def created_at=(created_at)
111
- if created_at.nil?
112
- fail ArgumentError, 'created_at cannot be nil'
113
- end
114
-
115
- @created_at = created_at
116
- end
117
-
118
- # Custom attribute writer method with validation
119
- # @param [Object] id Value to be assigned
120
- def id=(id)
121
- if id.nil?
122
- fail ArgumentError, 'id cannot be nil'
123
- end
124
-
125
- @id = id
126
- end
127
-
128
- # Checks equality by comparing each attribute.
129
- # @param [Object] Object to be compared
130
- def ==(o)
131
- return true if self.equal?(o)
132
- self.class == o.class &&
133
- created_at == o.created_at &&
134
- id == o.id
135
- end
136
-
137
- # @see the `==` method
138
- # @param [Object] Object to be compared
139
- def eql?(o)
140
- self == o
141
- end
142
-
143
- # Calculates hash code according to all attributes.
144
- # @return [Integer] Hash code
145
- def hash
146
- [created_at, id].hash
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 self.build_from_hash(attributes)
153
- return nil unless attributes.is_a?(Hash)
154
- attributes = attributes.transform_keys(&:to_sym)
155
- transformed_hash = {}
156
- openapi_types.each_pair do |key, type|
157
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
- transformed_hash["#{key}"] = nil
159
- elsif type =~ /\AArray<(.*)>/i
160
- # check to ensure the input is an array given that the attribute
161
- # is documented as an array but the input is not
162
- if attributes[attribute_map[key]].is_a?(Array)
163
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
- end
165
- elsif !attributes[attribute_map[key]].nil?
166
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
- end
168
- end
169
- new(transformed_hash)
170
- end
171
-
172
- # Returns the object in the form of hash
173
- # @return [Hash] Returns the object in the form of hash
174
- def to_hash
175
- hash = {}
176
- self.class.attribute_map.each_pair do |attr, param|
177
- value = self.send(attr)
178
- if value.nil?
179
- is_nullable = self.class.openapi_nullable.include?(attr)
180
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
- end
182
-
183
- hash[param] = _to_hash(value)
184
- end
185
- hash
186
- end
187
-
188
- end
189
-
190
- end