hubspot-api-client 17.0.0.pre.beta.2 → 17.0.0.pre.beta.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -1
  3. data/Gemfile.lock +1 -1
  4. data/lib/hubspot/codegen/crm/associations/schema/api/types_api.rb +97 -0
  5. data/lib/hubspot/codegen/crm/associations/schema/api_client.rb +412 -0
  6. data/lib/hubspot/codegen/crm/associations/schema/api_error.rb +63 -0
  7. data/lib/hubspot/codegen/crm/associations/schema/configuration.rb +296 -0
  8. data/lib/hubspot/codegen/crm/associations/schema/models/associated_id.rb +244 -0
  9. data/lib/hubspot/codegen/crm/associations/schema/models/batch_input_public_association.rb +232 -0
  10. data/lib/hubspot/codegen/crm/associations/schema/models/batch_input_public_object_id.rb +232 -0
  11. data/lib/hubspot/codegen/crm/associations/schema/models/batch_response_public_association.rb +328 -0
  12. data/lib/hubspot/codegen/crm/associations/schema/models/batch_response_public_association_multi.rb +328 -0
  13. data/lib/hubspot/codegen/crm/associations/schema/models/batch_response_public_association_multi_with_errors.rb +348 -0
  14. data/lib/hubspot/codegen/crm/associations/schema/models/batch_response_public_association_with_errors.rb +348 -0
  15. data/lib/hubspot/codegen/crm/associations/schema/models/collection_response_public_association_definition_no_paging.rb +232 -0
  16. data/lib/hubspot/codegen/crm/associations/schema/models/error.rb +307 -0
  17. data/lib/hubspot/codegen/crm/associations/schema/models/error_category.rb +278 -0
  18. data/lib/hubspot/codegen/crm/associations/schema/models/error_detail.rb +273 -0
  19. data/lib/hubspot/codegen/crm/associations/schema/models/next_page.rb +239 -0
  20. data/lib/hubspot/codegen/crm/associations/schema/models/paging.rb +234 -0
  21. data/lib/hubspot/codegen/crm/associations/schema/models/previous_page.rb +239 -0
  22. data/lib/hubspot/codegen/crm/associations/schema/models/public_association.rb +258 -0
  23. data/lib/hubspot/codegen/crm/associations/schema/models/public_association_definition.rb +244 -0
  24. data/lib/hubspot/codegen/crm/associations/schema/models/public_association_multi.rb +256 -0
  25. data/lib/hubspot/codegen/crm/associations/schema/models/public_object_id.rb +231 -0
  26. data/lib/hubspot/codegen/crm/associations/schema/models/standard_error.rb +324 -0
  27. data/lib/hubspot/codegen/crm/associations/v4/api/basic_api.rb +365 -0
  28. data/lib/hubspot/codegen/crm/associations/v4/api/batch_api.rb +1 -1
  29. data/lib/hubspot/codegen/crm/associations/v4/api_client.rb +1 -1
  30. data/lib/hubspot/codegen/crm/associations/v4/api_error.rb +1 -1
  31. data/lib/hubspot/codegen/crm/associations/v4/configuration.rb +1 -1
  32. data/lib/hubspot/codegen/crm/associations/v4/models/associated_id.rb +244 -0
  33. data/lib/hubspot/codegen/crm/associations/v4/models/association_spec.rb +1 -1
  34. data/lib/hubspot/codegen/crm/associations/v4/models/association_spec_with_label.rb +1 -1
  35. data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_association_multi_archive.rb +1 -1
  36. data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_association_multi_post.rb +1 -1
  37. data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_default_association_multi_post.rb +1 -1
  38. data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_fetch_associations_batch_request.rb +1 -1
  39. data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_simple_public_object_batch_input.rb +232 -0
  40. data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_simple_public_object_id.rb +232 -0
  41. data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_simple_public_object_input_for_create.rb +232 -0
  42. data/lib/hubspot/codegen/crm/associations/v4/models/batch_read_input_simple_public_object_id.rb +273 -0
  43. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_labels_between_object_pair.rb +1 -1
  44. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_labels_between_object_pair_with_errors.rb +1 -1
  45. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_public_association_multi_with_label.rb +1 -1
  46. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_public_association_multi_with_label_with_errors.rb +1 -1
  47. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_public_default_association.rb +1 -1
  48. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_simple_public_object.rb +328 -0
  49. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_simple_public_object_with_errors.rb +348 -0
  50. data/lib/hubspot/codegen/crm/associations/v4/models/collection_response_associated_id.rb +241 -0
  51. data/lib/hubspot/codegen/crm/associations/v4/models/collection_response_association_spec_with_label_no_paging.rb +1 -1
  52. data/lib/hubspot/codegen/crm/associations/v4/models/collection_response_multi_associated_object_with_label_forward_paging.rb +241 -0
  53. data/lib/hubspot/codegen/crm/associations/v4/models/collection_response_simple_public_object_with_associations_forward_paging.rb +241 -0
  54. data/lib/hubspot/codegen/crm/associations/v4/models/error.rb +1 -1
  55. data/lib/hubspot/codegen/crm/associations/v4/models/error_category.rb +1 -1
  56. data/lib/hubspot/codegen/crm/associations/v4/models/error_detail.rb +1 -1
  57. data/lib/hubspot/codegen/crm/associations/v4/models/forward_paging.rb +225 -0
  58. data/lib/hubspot/codegen/crm/associations/v4/models/labels_between_object_pair.rb +1 -1
  59. data/lib/hubspot/codegen/crm/associations/v4/models/multi_associated_object_with_label.rb +1 -1
  60. data/lib/hubspot/codegen/crm/associations/v4/models/next_page.rb +1 -1
  61. data/lib/hubspot/codegen/crm/associations/v4/models/paging.rb +1 -1
  62. data/lib/hubspot/codegen/crm/associations/v4/models/previous_page.rb +1 -1
  63. data/lib/hubspot/codegen/crm/associations/v4/models/public_association_definition_create_request.rb +1 -1
  64. data/lib/hubspot/codegen/crm/associations/v4/models/public_association_definition_update_request.rb +1 -1
  65. data/lib/hubspot/codegen/crm/associations/v4/models/public_association_multi_archive.rb +1 -1
  66. data/lib/hubspot/codegen/crm/associations/v4/models/public_association_multi_post.rb +1 -1
  67. data/lib/hubspot/codegen/crm/associations/v4/models/public_association_multi_with_label.rb +1 -1
  68. data/lib/hubspot/codegen/crm/associations/v4/models/public_associations_for_object.rb +246 -0
  69. data/lib/hubspot/codegen/crm/associations/v4/models/public_default_association.rb +1 -1
  70. data/lib/hubspot/codegen/crm/associations/v4/models/public_default_association_multi_post.rb +1 -1
  71. data/lib/hubspot/codegen/crm/associations/v4/models/public_fetch_associations_batch_request.rb +1 -1
  72. data/lib/hubspot/codegen/crm/associations/v4/models/public_gdpr_delete_input.rb +239 -0
  73. data/lib/hubspot/codegen/crm/associations/v4/models/public_object_id.rb +1 -1
  74. data/lib/hubspot/codegen/crm/associations/v4/models/simple_public_object.rb +303 -0
  75. data/lib/hubspot/codegen/crm/associations/v4/models/simple_public_object_batch_input.rb +246 -0
  76. data/lib/hubspot/codegen/crm/associations/v4/models/simple_public_object_id.rb +230 -0
  77. data/lib/hubspot/codegen/crm/associations/v4/models/simple_public_object_input.rb +232 -0
  78. data/lib/hubspot/codegen/crm/associations/v4/models/simple_public_object_input_for_create.rb +248 -0
  79. data/lib/hubspot/codegen/crm/associations/v4/models/simple_public_object_with_associations.rb +314 -0
  80. data/lib/hubspot/codegen/crm/associations/v4/models/standard_error.rb +1 -1
  81. data/lib/hubspot/codegen/crm/associations/v4/models/value_with_timestamp.rb +285 -0
  82. data/lib/hubspot/codegen/crm/associations/v4/schema/api/definitions_api.rb +334 -0
  83. data/lib/hubspot/codegen/crm/associations/v4/schema/api_client.rb +414 -0
  84. data/lib/hubspot/codegen/crm/associations/v4/schema/api_error.rb +65 -0
  85. data/lib/hubspot/codegen/crm/associations/v4/schema/configuration.rb +298 -0
  86. data/lib/hubspot/codegen/crm/associations/v4/schema/models/association_spec.rb +280 -0
  87. data/lib/hubspot/codegen/crm/associations/v4/schema/models/association_spec_with_label.rb +289 -0
  88. data/lib/hubspot/codegen/crm/associations/v4/schema/models/batch_input_public_association_multi_archive.rb +234 -0
  89. data/lib/hubspot/codegen/crm/associations/v4/schema/models/batch_input_public_association_multi_post.rb +234 -0
  90. data/lib/hubspot/codegen/crm/associations/v4/schema/models/batch_input_public_default_association_multi_post.rb +234 -0
  91. data/lib/hubspot/codegen/crm/associations/v4/schema/models/batch_input_public_fetch_associations_batch_request.rb +234 -0
  92. data/lib/hubspot/codegen/crm/associations/v4/schema/models/batch_response_labels_between_object_pair.rb +330 -0
  93. data/lib/hubspot/codegen/crm/associations/v4/schema/models/batch_response_labels_between_object_pair_with_errors.rb +350 -0
  94. data/lib/hubspot/codegen/crm/associations/v4/schema/models/batch_response_public_association_multi_with_label.rb +330 -0
  95. data/lib/hubspot/codegen/crm/associations/v4/schema/models/batch_response_public_association_multi_with_label_with_errors.rb +350 -0
  96. data/lib/hubspot/codegen/crm/associations/v4/schema/models/batch_response_public_default_association.rb +350 -0
  97. data/lib/hubspot/codegen/crm/associations/v4/schema/models/collection_response_association_spec_with_label_no_paging.rb +234 -0
  98. data/lib/hubspot/codegen/crm/associations/v4/schema/models/error.rb +309 -0
  99. data/lib/hubspot/codegen/crm/associations/v4/schema/models/error_category.rb +280 -0
  100. data/lib/hubspot/codegen/crm/associations/v4/schema/models/error_detail.rb +275 -0
  101. data/lib/hubspot/codegen/crm/associations/v4/schema/models/labels_between_object_pair.rb +290 -0
  102. data/lib/hubspot/codegen/crm/associations/v4/schema/models/multi_associated_object_with_label.rb +248 -0
  103. data/lib/hubspot/codegen/crm/associations/v4/schema/models/next_page.rb +241 -0
  104. data/lib/hubspot/codegen/crm/associations/v4/schema/models/paging.rb +236 -0
  105. data/lib/hubspot/codegen/crm/associations/v4/schema/models/previous_page.rb +241 -0
  106. data/lib/hubspot/codegen/crm/associations/v4/schema/models/public_association_definition_create_request.rb +246 -0
  107. data/lib/hubspot/codegen/crm/associations/v4/schema/models/public_association_definition_update_request.rb +246 -0
  108. data/lib/hubspot/codegen/crm/associations/v4/schema/models/public_association_multi_archive.rb +248 -0
  109. data/lib/hubspot/codegen/crm/associations/v4/schema/models/public_association_multi_post.rb +262 -0
  110. data/lib/hubspot/codegen/crm/associations/v4/schema/models/public_association_multi_with_label.rb +257 -0
  111. data/lib/hubspot/codegen/crm/associations/v4/schema/models/public_default_association.rb +260 -0
  112. data/lib/hubspot/codegen/crm/associations/v4/schema/models/public_default_association_multi_post.rb +246 -0
  113. data/lib/hubspot/codegen/crm/associations/v4/schema/models/public_fetch_associations_batch_request.rb +241 -0
  114. data/lib/hubspot/codegen/crm/associations/v4/schema/models/public_object_id.rb +232 -0
  115. data/lib/hubspot/codegen/crm/associations/v4/schema/models/standard_error.rb +326 -0
  116. data/lib/hubspot/codegen/crm/objects/communications/api/basic_api.rb +391 -0
  117. data/lib/hubspot/codegen/crm/objects/communications/api/batch_api.rb +295 -0
  118. data/lib/hubspot/codegen/crm/objects/communications/api/public_object_api.rb +94 -0
  119. data/lib/hubspot/codegen/crm/objects/communications/api/search_api.rb +92 -0
  120. data/lib/hubspot/codegen/crm/objects/communications/api_client.rb +412 -0
  121. data/lib/hubspot/codegen/crm/objects/communications/api_error.rb +63 -0
  122. data/lib/hubspot/codegen/crm/objects/communications/configuration.rb +296 -0
  123. data/lib/hubspot/codegen/crm/objects/communications/models/associated_id.rb +244 -0
  124. data/lib/hubspot/codegen/crm/objects/communications/models/association_spec.rb +278 -0
  125. data/lib/hubspot/codegen/crm/objects/communications/models/batch_input_simple_public_object_batch_input.rb +232 -0
  126. data/lib/hubspot/codegen/crm/objects/communications/models/batch_input_simple_public_object_id.rb +232 -0
  127. data/lib/hubspot/codegen/crm/objects/communications/models/batch_input_simple_public_object_input_for_create.rb +232 -0
  128. data/lib/hubspot/codegen/crm/objects/communications/models/batch_read_input_simple_public_object_id.rb +273 -0
  129. data/lib/hubspot/codegen/crm/objects/communications/models/batch_response_simple_public_object.rb +328 -0
  130. data/lib/hubspot/codegen/crm/objects/communications/models/batch_response_simple_public_object_with_errors.rb +348 -0
  131. data/lib/hubspot/codegen/crm/objects/communications/models/collection_response_associated_id.rb +241 -0
  132. data/lib/hubspot/codegen/crm/objects/communications/models/collection_response_simple_public_object_with_associations_forward_paging.rb +241 -0
  133. data/lib/hubspot/codegen/crm/objects/communications/models/collection_response_with_total_simple_public_object_forward_paging.rb +255 -0
  134. data/lib/hubspot/codegen/crm/objects/communications/models/error.rb +307 -0
  135. data/lib/hubspot/codegen/crm/objects/communications/models/error_category.rb +278 -0
  136. data/lib/hubspot/codegen/crm/objects/communications/models/error_detail.rb +273 -0
  137. data/lib/hubspot/codegen/crm/objects/communications/models/filter.rb +308 -0
  138. data/lib/hubspot/codegen/crm/objects/communications/models/filter_group.rb +232 -0
  139. data/lib/hubspot/codegen/crm/objects/communications/models/forward_paging.rb +225 -0
  140. data/lib/hubspot/codegen/crm/objects/communications/models/next_page.rb +239 -0
  141. data/lib/hubspot/codegen/crm/objects/communications/models/paging.rb +234 -0
  142. data/lib/hubspot/codegen/crm/objects/communications/models/previous_page.rb +239 -0
  143. data/lib/hubspot/codegen/crm/objects/communications/models/public_associations_for_object.rb +246 -0
  144. data/lib/hubspot/codegen/crm/objects/communications/models/public_merge_input.rb +244 -0
  145. data/lib/hubspot/codegen/crm/objects/communications/models/public_object_id.rb +230 -0
  146. data/lib/hubspot/codegen/crm/objects/communications/models/public_object_search_request.rb +301 -0
  147. data/lib/hubspot/codegen/crm/objects/communications/models/simple_public_object.rb +303 -0
  148. data/lib/hubspot/codegen/crm/objects/communications/models/simple_public_object_batch_input.rb +246 -0
  149. data/lib/hubspot/codegen/crm/objects/communications/models/simple_public_object_id.rb +230 -0
  150. data/lib/hubspot/codegen/crm/objects/communications/models/simple_public_object_input.rb +232 -0
  151. data/lib/hubspot/codegen/crm/objects/communications/models/simple_public_object_input_for_create.rb +248 -0
  152. data/lib/hubspot/codegen/crm/objects/communications/models/simple_public_object_with_associations.rb +314 -0
  153. data/lib/hubspot/codegen/crm/objects/communications/models/standard_error.rb +324 -0
  154. data/lib/hubspot/codegen/crm/objects/communications/models/value_with_timestamp.rb +285 -0
  155. data/lib/hubspot/discovery/crm/associations/client.rb +4 -2
  156. data/lib/hubspot/discovery/crm/associations/schema/api/types_api.rb +15 -0
  157. data/lib/hubspot/discovery/crm/associations/schema/client.rb +20 -0
  158. data/lib/hubspot/discovery/crm/associations/v4/api/{definitions_api.rb → basic_api.rb} +1 -1
  159. data/lib/hubspot/discovery/crm/associations/v4/client.rb +6 -1
  160. data/lib/hubspot/discovery/crm/associations/v4/schema/api/definitions_api.rb +17 -0
  161. data/lib/hubspot/discovery/crm/associations/v4/schema/client.rb +22 -0
  162. data/lib/hubspot/discovery/crm/objects/client.rb +1 -0
  163. data/lib/hubspot/discovery/crm/objects/communications/api/basic_api.rb +15 -0
  164. data/lib/hubspot/discovery/crm/objects/communications/api/batch_api.rb +15 -0
  165. data/lib/hubspot/discovery/crm/objects/communications/api/public_object_api.rb +15 -0
  166. data/lib/hubspot/discovery/crm/objects/communications/api/search_api.rb +15 -0
  167. data/lib/hubspot/discovery/crm/objects/communications/client.rb +24 -0
  168. data/lib/hubspot/version.rb +1 -1
  169. data/spec/discovery/crm/associations/client_spec.rb +1 -0
  170. data/spec/discovery/crm/associations/schema/types_api_spec.rb +7 -0
  171. data/spec/discovery/crm/associations/v4/basic_api_spec.rb +10 -0
  172. data/spec/discovery/crm/associations/v4/client_spec.rb +7 -0
  173. data/spec/discovery/crm/associations/v4/{definitions_api_spec.rb → schema/definitions_api_spec.rb} +3 -3
  174. data/spec/discovery/crm/objects/client_spec.rb +1 -0
  175. data/spec/discovery/crm/objects/communications/basic_api_spec.rb +10 -0
  176. data/spec/discovery/crm/objects/communications/batch_api_spec.rb +10 -0
  177. data/spec/discovery/crm/objects/communications/public_object_api_spec.rb +7 -0
  178. data/spec/discovery/crm/objects/communications/search_api_spec.rb +7 -0
  179. metadata +145 -10
  180. data/lib/hubspot/codegen/crm/associations/api/types_api.rb +0 -95
  181. data/lib/hubspot/codegen/crm/associations/v4/api/definitions_api.rb +0 -332
  182. data/lib/hubspot/discovery/crm/associations/api/types_api.rb +0 -13
  183. data/spec/discovery/crm/associations/types_api_spec.rb +0 -7
@@ -0,0 +1,248 @@
1
+ =begin
2
+ #CrmPublicAssociationsServiceV4
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v4
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 Crm
18
+ module Associations
19
+ module V4
20
+ module Schema
21
+ class MultiAssociatedObjectWithLabel
22
+ attr_accessor :to_object_id
23
+
24
+ attr_accessor :association_types
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'to_object_id' => :'toObjectId',
30
+ :'association_types' => :'associationTypes'
31
+ }
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'to_object_id' => :'Integer',
43
+ :'association_types' => :'Array<AssociationSpecWithLabel>'
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::Crm::Associations::V4::MultiAssociatedObjectWithLabel` 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::Crm::Associations::V4::MultiAssociatedObjectWithLabel`. 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?(:'to_object_id')
69
+ self.to_object_id = attributes[:'to_object_id']
70
+ end
71
+
72
+ if attributes.key?(:'association_types')
73
+ if (value = attributes[:'association_types']).is_a?(Array)
74
+ self.association_types = value
75
+ end
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ if @to_object_id.nil?
84
+ invalid_properties.push('invalid value for "to_object_id", to_object_id cannot be nil.')
85
+ end
86
+
87
+ if @association_types.nil?
88
+ invalid_properties.push('invalid value for "association_types", association_types cannot be nil.')
89
+ end
90
+
91
+ invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ return false if @to_object_id.nil?
98
+ return false if @association_types.nil?
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ to_object_id == o.to_object_id &&
108
+ association_types == o.association_types
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [to_object_id, association_types].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ new.build_from_hash(attributes)
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def build_from_hash(attributes)
134
+ return nil unless attributes.is_a?(Hash)
135
+ attributes = attributes.transform_keys(&:to_sym)
136
+ self.class.openapi_types.each_pair do |key, type|
137
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
138
+ self.send("#{key}=", nil)
139
+ elsif type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :Time
160
+ Time.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :Boolean
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ # models (e.g. Pet) or oneOf
191
+ klass = Hubspot::Crm::Associations::V4.const_get(type)
192
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
193
+ end
194
+ end
195
+
196
+ # Returns the string representation of the object
197
+ # @return [String] String presentation of the object
198
+ def to_s
199
+ to_hash.to_s
200
+ end
201
+
202
+ # to_body is an alias to to_hash (backward compatibility)
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_body
205
+ to_hash
206
+ end
207
+
208
+ # Returns the object in the form of hash
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_hash
211
+ hash = {}
212
+ self.class.attribute_map.each_pair do |attr, param|
213
+ value = self.send(attr)
214
+ if value.nil?
215
+ is_nullable = self.class.openapi_nullable.include?(attr)
216
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
217
+ end
218
+
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ # Outputs non-array value in the form of hash
225
+ # For object, use to_hash. Otherwise, just return the value
226
+ # @param [Object] value Any valid value
227
+ # @return [Hash] Returns the value in the form of hash
228
+ def _to_hash(value)
229
+ if value.is_a?(Array)
230
+ value.compact.map { |v| _to_hash(v) }
231
+ elsif value.is_a?(Hash)
232
+ {}.tap do |hash|
233
+ value.each { |k, v| hash[k] = _to_hash(v) }
234
+ end
235
+ elsif value.respond_to? :to_hash
236
+ value.to_hash
237
+ else
238
+ value
239
+ end
240
+ end
241
+
242
+ end
243
+
244
+ end
245
+ end
246
+ end
247
+ end
248
+ end
@@ -0,0 +1,241 @@
1
+ =begin
2
+ #CrmPublicAssociationsServiceV4
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v4
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 Crm
18
+ module Associations
19
+ module V4
20
+ module Schema
21
+ class NextPage
22
+ attr_accessor :after
23
+
24
+ attr_accessor :link
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'after' => :'after',
30
+ :'link' => :'link'
31
+ }
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'after' => :'String',
43
+ :'link' => :'String'
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::Crm::Associations::V4::NextPage` 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::Crm::Associations::V4::NextPage`. 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?(:'after')
69
+ self.after = attributes[:'after']
70
+ end
71
+
72
+ if attributes.key?(:'link')
73
+ self.link = attributes[:'link']
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ if @after.nil?
82
+ invalid_properties.push('invalid value for "after", after cannot be nil.')
83
+ end
84
+
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ return false if @after.nil?
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ after == o.after &&
101
+ link == o.link
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Integer] Hash code
112
+ def hash
113
+ [after, link].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def self.build_from_hash(attributes)
120
+ new.build_from_hash(attributes)
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ self.class.openapi_types.each_pair do |key, type|
130
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
131
+ self.send("#{key}=", nil)
132
+ elsif type =~ /\AArray<(.*)>/i
133
+ # check to ensure the input is an array given that the attribute
134
+ # is documented as an array but the input is not
135
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
136
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
137
+ end
138
+ elsif !attributes[self.class.attribute_map[key]].nil?
139
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
140
+ end
141
+ end
142
+
143
+ self
144
+ end
145
+
146
+ # Deserializes the data based on type
147
+ # @param string type Data type
148
+ # @param string value Value to be deserialized
149
+ # @return [Object] Deserialized data
150
+ def _deserialize(type, value)
151
+ case type.to_sym
152
+ when :Time
153
+ Time.parse(value)
154
+ when :Date
155
+ Date.parse(value)
156
+ when :String
157
+ value.to_s
158
+ when :Integer
159
+ value.to_i
160
+ when :Float
161
+ value.to_f
162
+ when :Boolean
163
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
+ true
165
+ else
166
+ false
167
+ end
168
+ when :Object
169
+ # generic object (usually a Hash), return directly
170
+ value
171
+ when /\AArray<(?<inner_type>.+)>\z/
172
+ inner_type = Regexp.last_match[:inner_type]
173
+ value.map { |v| _deserialize(inner_type, v) }
174
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
+ k_type = Regexp.last_match[:k_type]
176
+ v_type = Regexp.last_match[:v_type]
177
+ {}.tap do |hash|
178
+ value.each do |k, v|
179
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
+ end
181
+ end
182
+ else # model
183
+ # models (e.g. Pet) or oneOf
184
+ klass = Hubspot::Crm::Associations::V4.const_get(type)
185
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
186
+ end
187
+ end
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # to_body is an alias to to_hash (backward compatibility)
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_body
198
+ to_hash
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ # Outputs non-array value in the form of hash
218
+ # For object, use to_hash. Otherwise, just return the value
219
+ # @param [Object] value Any valid value
220
+ # @return [Hash] Returns the value in the form of hash
221
+ def _to_hash(value)
222
+ if value.is_a?(Array)
223
+ value.compact.map { |v| _to_hash(v) }
224
+ elsif value.is_a?(Hash)
225
+ {}.tap do |hash|
226
+ value.each { |k, v| hash[k] = _to_hash(v) }
227
+ end
228
+ elsif value.respond_to? :to_hash
229
+ value.to_hash
230
+ else
231
+ value
232
+ end
233
+ end
234
+
235
+ end
236
+
237
+ end
238
+ end
239
+ end
240
+ end
241
+ end