bombbomb 2.0.831 → 2.0.20679

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +13 -5
  2. data/README.md +31 -147
  3. data/Rakefile +3 -8
  4. data/bombbomb.gemspec +17 -8
  5. data/docs/InlineResponse200.md +1 -1
  6. data/docs/JerichoConfiguration.md +1 -7
  7. data/docs/JerichoPerformance.md +0 -4
  8. data/docs/PromptsApi.md +6 -712
  9. data/docs/TeamsApi.md +62 -1144
  10. data/docs/UtilitiesApi.md +4 -4
  11. data/docs/VideoEmailPrompt.md +10 -24
  12. data/docs/WebhooksApi.md +4 -45
  13. data/git_push.sh +13 -1
  14. data/lib/bombbomb.rb +14 -30
  15. data/lib/bombbomb/api/prompts_api.rb +42 -833
  16. data/lib/bombbomb/api/teams_api.rb +157 -1331
  17. data/lib/bombbomb/api/utilities_api.rb +44 -23
  18. data/lib/bombbomb/api/webhooks_api.rb +43 -68
  19. data/lib/bombbomb/api_client.rb +45 -55
  20. data/lib/bombbomb/api_error.rb +18 -9
  21. data/lib/bombbomb/configuration.rb +13 -8
  22. data/lib/bombbomb/models/bb_web_hook.rb +17 -6
  23. data/lib/bombbomb/models/inline_response_200.rb +18 -7
  24. data/lib/bombbomb/models/inline_response_200_items.rb +1 -1
  25. data/lib/bombbomb/models/jericho_configuration.rb +22 -75
  26. data/lib/bombbomb/models/jericho_performance.rb +21 -50
  27. data/lib/bombbomb/models/o_auth_client.rb +17 -6
  28. data/lib/bombbomb/models/string.rb +17 -6
  29. data/lib/bombbomb/models/video_email_prompt.rb +90 -214
  30. data/lib/bombbomb/version.rb +14 -3
  31. data/spec/models/{team_public_representation_spec.rb → inline_response_200_items_spec.rb} +14 -8
  32. metadata +56 -168
  33. data/Gemfile +0 -7
  34. data/docs/AccountsApi.md +0 -384
  35. data/docs/AutomationsApi.md +0 -167
  36. data/docs/ClientGroupAssetMetaData.md +0 -11
  37. data/docs/ContactsApi.md +0 -436
  38. data/docs/Curriculum.md +0 -15
  39. data/docs/CurriculumApi.md +0 -109
  40. data/docs/CurriculumUserProgress.md +0 -12
  41. data/docs/CurriculumWithProgress.md +0 -15
  42. data/docs/EmailsApi.md +0 -633
  43. data/docs/FilesApi.md +0 -272
  44. data/docs/FormsApi.md +0 -60
  45. data/docs/HostedDoc.md +0 -13
  46. data/docs/IntegrationsApi.md +0 -285
  47. data/docs/ListsApi.md +0 -265
  48. data/docs/OrdersApi.md +0 -60
  49. data/docs/PromptBot.md +0 -22
  50. data/docs/PromptBotBot.md +0 -18
  51. data/docs/PromptMonthlyPerformance.md +0 -11
  52. data/docs/PromptOverview.md +0 -11
  53. data/docs/PromptSocialPrompt.md +0 -20
  54. data/docs/SignUploadRequest.md +0 -9
  55. data/docs/SignUploadResponse.md +0 -9
  56. data/docs/SocialsApi.md +0 -653
  57. data/docs/TeamPublicRepresentation.md +0 -10
  58. data/docs/UsersApi.md +0 -100
  59. data/docs/VideoEncodingStatusResponse.md +0 -10
  60. data/docs/VideoPublicRepresentation.md +0 -18
  61. data/docs/VideoRecorderMethodResponse.md +0 -15
  62. data/docs/VideosApi.md +0 -287
  63. data/lib/bombbomb/api/accounts_api.rb +0 -432
  64. data/lib/bombbomb/api/automations_api.rb +0 -191
  65. data/lib/bombbomb/api/contacts_api.rb +0 -470
  66. data/lib/bombbomb/api/curriculum_api.rb +0 -124
  67. data/lib/bombbomb/api/emails_api.rb +0 -673
  68. data/lib/bombbomb/api/files_api.rb +0 -302
  69. data/lib/bombbomb/api/forms_api.rb +0 -77
  70. data/lib/bombbomb/api/integrations_api.rb +0 -308
  71. data/lib/bombbomb/api/lists_api.rb +0 -295
  72. data/lib/bombbomb/api/orders_api.rb +0 -78
  73. data/lib/bombbomb/api/socials_api.rb +0 -714
  74. data/lib/bombbomb/api/users_api.rb +0 -119
  75. data/lib/bombbomb/api/videos_api.rb +0 -326
  76. data/lib/bombbomb/models/client_group_asset_meta_data.rb +0 -215
  77. data/lib/bombbomb/models/curriculum.rb +0 -261
  78. data/lib/bombbomb/models/curriculum_user_progress.rb +0 -229
  79. data/lib/bombbomb/models/curriculum_with_progress.rb +0 -261
  80. data/lib/bombbomb/models/hosted_doc.rb +0 -239
  81. data/lib/bombbomb/models/prompt_bot.rb +0 -329
  82. data/lib/bombbomb/models/prompt_bot_bot.rb +0 -300
  83. data/lib/bombbomb/models/prompt_monthly_performance.rb +0 -219
  84. data/lib/bombbomb/models/prompt_overview.rb +0 -219
  85. data/lib/bombbomb/models/prompt_social_prompt.rb +0 -311
  86. data/lib/bombbomb/models/sign_upload_request.rb +0 -199
  87. data/lib/bombbomb/models/sign_upload_response.rb +0 -199
  88. data/lib/bombbomb/models/team_public_representation.rb +0 -209
  89. data/lib/bombbomb/models/video_encoding_status_response.rb +0 -209
  90. data/lib/bombbomb/models/video_public_representation.rb +0 -291
  91. data/lib/bombbomb/models/video_recorder_method_response.rb +0 -259
  92. data/spec/api/accounts_api_spec.rb +0 -96
  93. data/spec/api/automations_api_spec.rb +0 -71
  94. data/spec/api/contacts_api_spec.rb +0 -58
  95. data/spec/api/curriculum_api_spec.rb +0 -69
  96. data/spec/api/emails_api_spec.rb +0 -104
  97. data/spec/api/files_api_spec.rb +0 -58
  98. data/spec/api/forms_api_spec.rb +0 -58
  99. data/spec/api/integrations_api_spec.rb +0 -58
  100. data/spec/api/lists_api_spec.rb +0 -83
  101. data/spec/api/orders_api_spec.rb +0 -58
  102. data/spec/api/socials_api_spec.rb +0 -135
  103. data/spec/api/users_api_spec.rb +0 -57
  104. data/spec/api/videos_api_spec.rb +0 -86
  105. data/spec/models/client_group_asset_meta_data_spec.rb +0 -60
  106. data/spec/models/curriculum_spec.rb +0 -95
  107. data/spec/models/curriculum_user_progress_spec.rb +0 -77
  108. data/spec/models/curriculum_with_progress_spec.rb +0 -95
  109. data/spec/models/hosted_doc_spec.rb +0 -83
  110. data/spec/models/prompt_bot_spec.rb +0 -137
  111. data/spec/models/prompt_monthly_performance_spec.rb +0 -60
  112. data/spec/models/prompt_overview_spec.rb +0 -60
  113. data/spec/models/prompt_social_prompt_spec.rb +0 -125
  114. data/spec/models/sign_upload_request_spec.rb +0 -59
  115. data/spec/models/sign_upload_response_spec.rb +0 -59
  116. data/spec/models/video_encoding_status_response_spec.rb +0 -65
  117. data/spec/models/video_public_representation_spec.rb +0 -113
  118. data/spec/models/video_recorder_method_response_spec.rb +0 -95
@@ -1,199 +0,0 @@
1
- =begin
2
- #BombBomb
3
-
4
- #We make it easy to build relationships using simple videos.
5
-
6
- OpenAPI spec version: 2.0.831
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module BombBomb
16
- # The SignUploadRequest class
17
- class SignUploadRequest
18
- # when the upload will expire.
19
- attr_accessor :expiration
20
-
21
- # Key/Value object of request conditions.
22
- attr_accessor :conditions
23
-
24
-
25
- # Attribute mapping from ruby-style variable name to JSON key.
26
- def self.attribute_map
27
- {
28
- :'expiration' => :'expiration',
29
- :'conditions' => :'conditions'
30
- }
31
- end
32
-
33
- # Attribute type mapping.
34
- def self.swagger_types
35
- {
36
- :'expiration' => :'DateTime',
37
- :'conditions' => :'Object'
38
- }
39
- end
40
-
41
- # Initializes the object
42
- # @param [Hash] attributes Model attributes in the form of hash
43
- def initialize(attributes = {})
44
- return unless attributes.is_a?(Hash)
45
-
46
- # convert string to symbol for hash key
47
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
48
-
49
- if attributes.has_key?(:'expiration')
50
- self.expiration = attributes[:'expiration']
51
- end
52
-
53
- if attributes.has_key?(:'conditions')
54
- self.conditions = attributes[:'conditions']
55
- end
56
-
57
- end
58
-
59
- # Show invalid properties with the reasons. Usually used together with valid?
60
- # @return Array for valid properties with the reasons
61
- def list_invalid_properties
62
- invalid_properties = Array.new
63
- return invalid_properties
64
- end
65
-
66
- # Check to see if the all the properties in the model are valid
67
- # @return true if the model is valid
68
- def valid?
69
- return true
70
- end
71
-
72
- # Checks equality by comparing each attribute.
73
- # @param [Object] Object to be compared
74
- def ==(o)
75
- return true if self.equal?(o)
76
- self.class == o.class &&
77
- expiration == o.expiration &&
78
- conditions == o.conditions
79
- end
80
-
81
- # @see the `==` method
82
- # @param [Object] Object to be compared
83
- def eql?(o)
84
- self == o
85
- end
86
-
87
- # Calculates hash code according to all attributes.
88
- # @return [Fixnum] Hash code
89
- def hash
90
- [expiration, conditions].hash
91
- end
92
-
93
- # Builds the object from hash
94
- # @param [Hash] attributes Model attributes in the form of hash
95
- # @return [Object] Returns the model itself
96
- def build_from_hash(attributes)
97
- return nil unless attributes.is_a?(Hash)
98
- self.class.swagger_types.each_pair do |key, type|
99
- if type =~ /\AArray<(.*)>/i
100
- # check to ensure the input is an array given that the the attribute
101
- # is documented as an array but the input is not
102
- if attributes[self.class.attribute_map[key]].is_a?(Array)
103
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
104
- end
105
- elsif !attributes[self.class.attribute_map[key]].nil?
106
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
107
- end # or else data not found in attributes(hash), not an issue as the data can be optional
108
- end
109
-
110
- self
111
- end
112
-
113
- # Deserializes the data based on type
114
- # @param string type Data type
115
- # @param string value Value to be deserialized
116
- # @return [Object] Deserialized data
117
- def _deserialize(type, value)
118
- case type.to_sym
119
- when :DateTime
120
- DateTime.parse(value)
121
- when :Date
122
- Date.parse(value)
123
- when :String
124
- value.to_s
125
- when :Integer
126
- value.to_i
127
- when :Float
128
- value.to_f
129
- when :BOOLEAN
130
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
131
- true
132
- else
133
- false
134
- end
135
- when :Object
136
- # generic object (usually a Hash), return directly
137
- value
138
- when /\AArray<(?<inner_type>.+)>\z/
139
- inner_type = Regexp.last_match[:inner_type]
140
- value.map { |v| _deserialize(inner_type, v) }
141
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
142
- k_type = Regexp.last_match[:k_type]
143
- v_type = Regexp.last_match[:v_type]
144
- {}.tap do |hash|
145
- value.each do |k, v|
146
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
147
- end
148
- end
149
- else # model
150
- temp_model = BombBomb.const_get(type).new
151
- temp_model.build_from_hash(value)
152
- end
153
- end
154
-
155
- # Returns the string representation of the object
156
- # @return [String] String presentation of the object
157
- def to_s
158
- to_hash.to_s
159
- end
160
-
161
- # to_body is an alias to to_hash (backward compatibility)
162
- # @return [Hash] Returns the object in the form of hash
163
- def to_body
164
- to_hash
165
- end
166
-
167
- # Returns the object in the form of hash
168
- # @return [Hash] Returns the object in the form of hash
169
- def to_hash
170
- hash = {}
171
- self.class.attribute_map.each_pair do |attr, param|
172
- value = self.send(attr)
173
- next if value.nil?
174
- hash[param] = _to_hash(value)
175
- end
176
- hash
177
- end
178
-
179
- # Outputs non-array value in the form of hash
180
- # For object, use to_hash. Otherwise, just return the value
181
- # @param [Object] value Any valid value
182
- # @return [Hash] Returns the value in the form of hash
183
- def _to_hash(value)
184
- if value.is_a?(Array)
185
- value.compact.map{ |v| _to_hash(v) }
186
- elsif value.is_a?(Hash)
187
- {}.tap do |hash|
188
- value.each { |k, v| hash[k] = _to_hash(v) }
189
- end
190
- elsif value.respond_to? :to_hash
191
- value.to_hash
192
- else
193
- value
194
- end
195
- end
196
-
197
- end
198
-
199
- end
@@ -1,199 +0,0 @@
1
- =begin
2
- #BombBomb
3
-
4
- #We make it easy to build relationships using simple videos.
5
-
6
- OpenAPI spec version: 2.0.831
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module BombBomb
16
- # The SignUploadResponse class
17
- class SignUploadResponse
18
- # Base64 encoded policy.
19
- attr_accessor :policy
20
-
21
- # Signature for policy.
22
- attr_accessor :signature
23
-
24
-
25
- # Attribute mapping from ruby-style variable name to JSON key.
26
- def self.attribute_map
27
- {
28
- :'policy' => :'policy',
29
- :'signature' => :'signature'
30
- }
31
- end
32
-
33
- # Attribute type mapping.
34
- def self.swagger_types
35
- {
36
- :'policy' => :'String',
37
- :'signature' => :'String'
38
- }
39
- end
40
-
41
- # Initializes the object
42
- # @param [Hash] attributes Model attributes in the form of hash
43
- def initialize(attributes = {})
44
- return unless attributes.is_a?(Hash)
45
-
46
- # convert string to symbol for hash key
47
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
48
-
49
- if attributes.has_key?(:'policy')
50
- self.policy = attributes[:'policy']
51
- end
52
-
53
- if attributes.has_key?(:'signature')
54
- self.signature = attributes[:'signature']
55
- end
56
-
57
- end
58
-
59
- # Show invalid properties with the reasons. Usually used together with valid?
60
- # @return Array for valid properties with the reasons
61
- def list_invalid_properties
62
- invalid_properties = Array.new
63
- return invalid_properties
64
- end
65
-
66
- # Check to see if the all the properties in the model are valid
67
- # @return true if the model is valid
68
- def valid?
69
- return true
70
- end
71
-
72
- # Checks equality by comparing each attribute.
73
- # @param [Object] Object to be compared
74
- def ==(o)
75
- return true if self.equal?(o)
76
- self.class == o.class &&
77
- policy == o.policy &&
78
- signature == o.signature
79
- end
80
-
81
- # @see the `==` method
82
- # @param [Object] Object to be compared
83
- def eql?(o)
84
- self == o
85
- end
86
-
87
- # Calculates hash code according to all attributes.
88
- # @return [Fixnum] Hash code
89
- def hash
90
- [policy, signature].hash
91
- end
92
-
93
- # Builds the object from hash
94
- # @param [Hash] attributes Model attributes in the form of hash
95
- # @return [Object] Returns the model itself
96
- def build_from_hash(attributes)
97
- return nil unless attributes.is_a?(Hash)
98
- self.class.swagger_types.each_pair do |key, type|
99
- if type =~ /\AArray<(.*)>/i
100
- # check to ensure the input is an array given that the the attribute
101
- # is documented as an array but the input is not
102
- if attributes[self.class.attribute_map[key]].is_a?(Array)
103
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
104
- end
105
- elsif !attributes[self.class.attribute_map[key]].nil?
106
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
107
- end # or else data not found in attributes(hash), not an issue as the data can be optional
108
- end
109
-
110
- self
111
- end
112
-
113
- # Deserializes the data based on type
114
- # @param string type Data type
115
- # @param string value Value to be deserialized
116
- # @return [Object] Deserialized data
117
- def _deserialize(type, value)
118
- case type.to_sym
119
- when :DateTime
120
- DateTime.parse(value)
121
- when :Date
122
- Date.parse(value)
123
- when :String
124
- value.to_s
125
- when :Integer
126
- value.to_i
127
- when :Float
128
- value.to_f
129
- when :BOOLEAN
130
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
131
- true
132
- else
133
- false
134
- end
135
- when :Object
136
- # generic object (usually a Hash), return directly
137
- value
138
- when /\AArray<(?<inner_type>.+)>\z/
139
- inner_type = Regexp.last_match[:inner_type]
140
- value.map { |v| _deserialize(inner_type, v) }
141
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
142
- k_type = Regexp.last_match[:k_type]
143
- v_type = Regexp.last_match[:v_type]
144
- {}.tap do |hash|
145
- value.each do |k, v|
146
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
147
- end
148
- end
149
- else # model
150
- temp_model = BombBomb.const_get(type).new
151
- temp_model.build_from_hash(value)
152
- end
153
- end
154
-
155
- # Returns the string representation of the object
156
- # @return [String] String presentation of the object
157
- def to_s
158
- to_hash.to_s
159
- end
160
-
161
- # to_body is an alias to to_hash (backward compatibility)
162
- # @return [Hash] Returns the object in the form of hash
163
- def to_body
164
- to_hash
165
- end
166
-
167
- # Returns the object in the form of hash
168
- # @return [Hash] Returns the object in the form of hash
169
- def to_hash
170
- hash = {}
171
- self.class.attribute_map.each_pair do |attr, param|
172
- value = self.send(attr)
173
- next if value.nil?
174
- hash[param] = _to_hash(value)
175
- end
176
- hash
177
- end
178
-
179
- # Outputs non-array value in the form of hash
180
- # For object, use to_hash. Otherwise, just return the value
181
- # @param [Object] value Any valid value
182
- # @return [Hash] Returns the value in the form of hash
183
- def _to_hash(value)
184
- if value.is_a?(Array)
185
- value.compact.map{ |v| _to_hash(v) }
186
- elsif value.is_a?(Hash)
187
- {}.tap do |hash|
188
- value.each { |k, v| hash[k] = _to_hash(v) }
189
- end
190
- elsif value.respond_to? :to_hash
191
- value.to_hash
192
- else
193
- value
194
- end
195
- end
196
-
197
- end
198
-
199
- end
@@ -1,209 +0,0 @@
1
- =begin
2
- #BombBomb
3
-
4
- #We make it easy to build relationships using simple videos.
5
-
6
- OpenAPI spec version: 2.0.831
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module BombBomb
16
- # The TeamPublicRepresentation class
17
- class TeamPublicRepresentation
18
- # The id of the team
19
- attr_accessor :id
20
-
21
- # The name of the team
22
- attr_accessor :name
23
-
24
- # The date the team was created
25
- attr_accessor :created_date
26
-
27
-
28
- # Attribute mapping from ruby-style variable name to JSON key.
29
- def self.attribute_map
30
- {
31
- :'id' => :'id',
32
- :'name' => :'name',
33
- :'created_date' => :'createdDate'
34
- }
35
- end
36
-
37
- # Attribute type mapping.
38
- def self.swagger_types
39
- {
40
- :'id' => :'String',
41
- :'name' => :'String',
42
- :'created_date' => :'String'
43
- }
44
- end
45
-
46
- # Initializes the object
47
- # @param [Hash] attributes Model attributes in the form of hash
48
- def initialize(attributes = {})
49
- return unless attributes.is_a?(Hash)
50
-
51
- # convert string to symbol for hash key
52
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
53
-
54
- if attributes.has_key?(:'id')
55
- self.id = attributes[:'id']
56
- end
57
-
58
- if attributes.has_key?(:'name')
59
- self.name = attributes[:'name']
60
- end
61
-
62
- if attributes.has_key?(:'createdDate')
63
- self.created_date = attributes[:'createdDate']
64
- end
65
-
66
- end
67
-
68
- # Show invalid properties with the reasons. Usually used together with valid?
69
- # @return Array for valid properties with the reasons
70
- def list_invalid_properties
71
- invalid_properties = Array.new
72
- return invalid_properties
73
- end
74
-
75
- # Check to see if the all the properties in the model are valid
76
- # @return true if the model is valid
77
- def valid?
78
- return true
79
- end
80
-
81
- # Checks equality by comparing each attribute.
82
- # @param [Object] Object to be compared
83
- def ==(o)
84
- return true if self.equal?(o)
85
- self.class == o.class &&
86
- id == o.id &&
87
- name == o.name &&
88
- created_date == o.created_date
89
- end
90
-
91
- # @see the `==` method
92
- # @param [Object] Object to be compared
93
- def eql?(o)
94
- self == o
95
- end
96
-
97
- # Calculates hash code according to all attributes.
98
- # @return [Fixnum] Hash code
99
- def hash
100
- [id, name, created_date].hash
101
- end
102
-
103
- # Builds the object from hash
104
- # @param [Hash] attributes Model attributes in the form of hash
105
- # @return [Object] Returns the model itself
106
- def build_from_hash(attributes)
107
- return nil unless attributes.is_a?(Hash)
108
- self.class.swagger_types.each_pair do |key, type|
109
- if type =~ /\AArray<(.*)>/i
110
- # check to ensure the input is an array given that the the attribute
111
- # is documented as an array but the input is not
112
- if attributes[self.class.attribute_map[key]].is_a?(Array)
113
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
114
- end
115
- elsif !attributes[self.class.attribute_map[key]].nil?
116
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
- end # or else data not found in attributes(hash), not an issue as the data can be optional
118
- end
119
-
120
- self
121
- end
122
-
123
- # Deserializes the data based on type
124
- # @param string type Data type
125
- # @param string value Value to be deserialized
126
- # @return [Object] Deserialized data
127
- def _deserialize(type, value)
128
- case type.to_sym
129
- when :DateTime
130
- DateTime.parse(value)
131
- when :Date
132
- Date.parse(value)
133
- when :String
134
- value.to_s
135
- when :Integer
136
- value.to_i
137
- when :Float
138
- value.to_f
139
- when :BOOLEAN
140
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
141
- true
142
- else
143
- false
144
- end
145
- when :Object
146
- # generic object (usually a Hash), return directly
147
- value
148
- when /\AArray<(?<inner_type>.+)>\z/
149
- inner_type = Regexp.last_match[:inner_type]
150
- value.map { |v| _deserialize(inner_type, v) }
151
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
152
- k_type = Regexp.last_match[:k_type]
153
- v_type = Regexp.last_match[:v_type]
154
- {}.tap do |hash|
155
- value.each do |k, v|
156
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
157
- end
158
- end
159
- else # model
160
- temp_model = BombBomb.const_get(type).new
161
- temp_model.build_from_hash(value)
162
- end
163
- end
164
-
165
- # Returns the string representation of the object
166
- # @return [String] String presentation of the object
167
- def to_s
168
- to_hash.to_s
169
- end
170
-
171
- # to_body is an alias to to_hash (backward compatibility)
172
- # @return [Hash] Returns the object in the form of hash
173
- def to_body
174
- to_hash
175
- end
176
-
177
- # Returns the object in the form of hash
178
- # @return [Hash] Returns the object in the form of hash
179
- def to_hash
180
- hash = {}
181
- self.class.attribute_map.each_pair do |attr, param|
182
- value = self.send(attr)
183
- next if value.nil?
184
- hash[param] = _to_hash(value)
185
- end
186
- hash
187
- end
188
-
189
- # Outputs non-array value in the form of hash
190
- # For object, use to_hash. Otherwise, just return the value
191
- # @param [Object] value Any valid value
192
- # @return [Hash] Returns the value in the form of hash
193
- def _to_hash(value)
194
- if value.is_a?(Array)
195
- value.compact.map{ |v| _to_hash(v) }
196
- elsif value.is_a?(Hash)
197
- {}.tap do |hash|
198
- value.each { |k, v| hash[k] = _to_hash(v) }
199
- end
200
- elsif value.respond_to? :to_hash
201
- value.to_hash
202
- else
203
- value
204
- end
205
- end
206
-
207
- end
208
-
209
- end