late-sdk 0.0.108 → 0.0.110

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 (89) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +36 -0
  3. data/docs/AnalyticsApi.md +78 -0
  4. data/docs/CreateWhatsAppFlow200Response.md +20 -0
  5. data/docs/CreateWhatsAppFlow200ResponseFlow.md +24 -0
  6. data/docs/CreateWhatsAppFlowRequest.md +24 -0
  7. data/docs/GetWhatsAppFlow200Response.md +20 -0
  8. data/docs/GetWhatsAppFlow200ResponseFlow.md +30 -0
  9. data/docs/GetWhatsAppFlow200ResponseFlowPreview.md +20 -0
  10. data/docs/GetWhatsAppFlowJson200Response.md +20 -0
  11. data/docs/GetWhatsAppFlowJson200ResponseAssetsInner.md +22 -0
  12. data/docs/GetYouTubeDemographics412Response.md +24 -0
  13. data/docs/GetYouTubeDemographics412ResponseScopeStatus.md +22 -0
  14. data/docs/ListWhatsAppFlows200Response.md +20 -0
  15. data/docs/ListWhatsAppFlows200ResponseFlowsInner.md +26 -0
  16. data/docs/PublishWhatsAppFlowRequest.md +18 -0
  17. data/docs/SendWhatsAppFlowMessage200Response.md +20 -0
  18. data/docs/SendWhatsAppFlowMessageRequest.md +38 -0
  19. data/docs/SendWhatsAppFlowMessageRequestFlowActionPayload.md +20 -0
  20. data/docs/SendWhatsAppFlowMessageRequestHeader.md +20 -0
  21. data/docs/UpdateWhatsAppFlowRequest.md +22 -0
  22. data/docs/UploadWhatsAppFlowJson200Response.md +20 -0
  23. data/docs/UploadWhatsAppFlowJson200ResponseValidationErrorsInner.md +30 -0
  24. data/docs/UploadWhatsAppFlowJsonRequest.md +20 -0
  25. data/docs/UploadWhatsAppFlowJsonRequestFlowJson.md +49 -0
  26. data/docs/WhatsAppFlowsApi.md +725 -0
  27. data/docs/YouTubeDemographicsResponse.md +28 -0
  28. data/docs/YouTubeDemographicsResponseDateRange.md +20 -0
  29. data/docs/YouTubeDemographicsResponseDemographicsValueInner.md +20 -0
  30. data/lib/late-sdk/api/analytics_api.rb +73 -0
  31. data/lib/late-sdk/api/whats_app_flows_api.rb +731 -0
  32. data/lib/late-sdk/models/create_whats_app_flow200_response.rb +156 -0
  33. data/lib/late-sdk/models/create_whats_app_flow200_response_flow.rb +176 -0
  34. data/lib/late-sdk/models/create_whats_app_flow_request.rb +257 -0
  35. data/lib/late-sdk/models/get_whats_app_flow200_response.rb +156 -0
  36. data/lib/late-sdk/models/get_whats_app_flow200_response_flow.rb +205 -0
  37. data/lib/late-sdk/models/get_whats_app_flow200_response_flow_preview.rb +156 -0
  38. data/lib/late-sdk/models/get_whats_app_flow_json200_response.rb +158 -0
  39. data/lib/late-sdk/models/get_whats_app_flow_json200_response_assets_inner.rb +166 -0
  40. data/lib/late-sdk/models/get_you_tube_demographics412_response.rb +174 -0
  41. data/lib/late-sdk/models/get_you_tube_demographics412_response_scope_status.rb +165 -0
  42. data/lib/late-sdk/models/list_whats_app_flows200_response.rb +158 -0
  43. data/lib/late-sdk/models/list_whats_app_flows200_response_flows_inner.rb +221 -0
  44. data/lib/late-sdk/models/publish_whats_app_flow_request.rb +165 -0
  45. data/lib/late-sdk/models/send_whats_app_flow_message200_response.rb +157 -0
  46. data/lib/late-sdk/models/send_whats_app_flow_message_request.rb +395 -0
  47. data/lib/late-sdk/models/send_whats_app_flow_message_request_flow_action_payload.rb +158 -0
  48. data/lib/late-sdk/models/send_whats_app_flow_message_request_header.rb +190 -0
  49. data/lib/late-sdk/models/update_whats_app_flow_request.rb +232 -0
  50. data/lib/late-sdk/models/upload_whats_app_flow_json200_response.rb +159 -0
  51. data/lib/late-sdk/models/upload_whats_app_flow_json200_response_validation_errors_inner.rb +201 -0
  52. data/lib/late-sdk/models/upload_whats_app_flow_json_request.rb +191 -0
  53. data/lib/late-sdk/models/upload_whats_app_flow_json_request_flow_json.rb +105 -0
  54. data/lib/late-sdk/models/you_tube_demographics_response.rb +196 -0
  55. data/lib/late-sdk/models/you_tube_demographics_response_date_range.rb +156 -0
  56. data/lib/late-sdk/models/you_tube_demographics_response_demographics_value_inner.rb +158 -0
  57. data/lib/late-sdk/version.rb +1 -1
  58. data/lib/late-sdk.rb +26 -0
  59. data/openapi.yaml +616 -1
  60. data/spec/api/analytics_api_spec.rb +15 -0
  61. data/spec/api/whats_app_flows_api_spec.rb +163 -0
  62. data/spec/models/create_whats_app_flow200_response_flow_spec.rb +54 -0
  63. data/spec/models/create_whats_app_flow200_response_spec.rb +42 -0
  64. data/spec/models/create_whats_app_flow_request_spec.rb +58 -0
  65. data/spec/models/get_whats_app_flow200_response_flow_preview_spec.rb +42 -0
  66. data/spec/models/get_whats_app_flow200_response_flow_spec.rb +72 -0
  67. data/spec/models/get_whats_app_flow200_response_spec.rb +42 -0
  68. data/spec/models/get_whats_app_flow_json200_response_assets_inner_spec.rb +48 -0
  69. data/spec/models/get_whats_app_flow_json200_response_spec.rb +42 -0
  70. data/spec/models/get_you_tube_demographics412_response_scope_status_spec.rb +48 -0
  71. data/spec/models/get_you_tube_demographics412_response_spec.rb +54 -0
  72. data/spec/models/list_whats_app_flows200_response_flows_inner_spec.rb +64 -0
  73. data/spec/models/list_whats_app_flows200_response_spec.rb +42 -0
  74. data/spec/models/publish_whats_app_flow_request_spec.rb +36 -0
  75. data/spec/models/send_whats_app_flow_message200_response_spec.rb +42 -0
  76. data/spec/models/send_whats_app_flow_message_request_flow_action_payload_spec.rb +42 -0
  77. data/spec/models/send_whats_app_flow_message_request_header_spec.rb +46 -0
  78. data/spec/models/send_whats_app_flow_message_request_spec.rb +100 -0
  79. data/spec/models/update_whats_app_flow_request_spec.rb +52 -0
  80. data/spec/models/upload_whats_app_flow_json200_response_spec.rb +42 -0
  81. data/spec/models/upload_whats_app_flow_json200_response_validation_errors_inner_spec.rb +72 -0
  82. data/spec/models/upload_whats_app_flow_json_request_flow_json_spec.rb +32 -0
  83. data/spec/models/upload_whats_app_flow_json_request_spec.rb +42 -0
  84. data/spec/models/you_tube_demographics_response_date_range_spec.rb +42 -0
  85. data/spec/models/you_tube_demographics_response_demographics_value_inner_spec.rb +42 -0
  86. data/spec/models/you_tube_demographics_response_spec.rb +66 -0
  87. data/zernio-sdk-0.0.110.gem +0 -0
  88. metadata +107 -3
  89. data/zernio-sdk-0.0.108.gem +0 -0
@@ -0,0 +1,156 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Late
17
+ class CreateWhatsAppFlow200Response < ApiModelBase
18
+ attr_accessor :success
19
+
20
+ attr_accessor :flow
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'success' => :'success',
26
+ :'flow' => :'flow'
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
+ :'success' => :'Boolean',
44
+ :'flow' => :'CreateWhatsAppFlow200ResponseFlow'
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 `Late::CreateWhatsAppFlow200Response` 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 `Late::CreateWhatsAppFlow200Response`. 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?(:'success')
71
+ self.success = attributes[:'success']
72
+ end
73
+
74
+ if attributes.key?(:'flow')
75
+ self.flow = attributes[:'flow']
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
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ success == o.success &&
100
+ flow == o.flow
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [success, flow].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ attributes = attributes.transform_keys(&:to_sym)
121
+ transformed_hash = {}
122
+ openapi_types.each_pair do |key, type|
123
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = nil
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[attribute_map[key]].is_a?(Array)
129
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
130
+ end
131
+ elsif !attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
133
+ end
134
+ end
135
+ new(transformed_hash)
136
+ end
137
+
138
+ # Returns the object in the form of hash
139
+ # @return [Hash] Returns the object in the form of hash
140
+ def to_hash
141
+ hash = {}
142
+ self.class.attribute_map.each_pair do |attr, param|
143
+ value = self.send(attr)
144
+ if value.nil?
145
+ is_nullable = self.class.openapi_nullable.include?(attr)
146
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
147
+ end
148
+
149
+ hash[param] = _to_hash(value)
150
+ end
151
+ hash
152
+ end
153
+
154
+ end
155
+
156
+ end
@@ -0,0 +1,176 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Late
17
+ class CreateWhatsAppFlow200ResponseFlow < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :status
23
+
24
+ attr_accessor :categories
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'id' => :'id',
30
+ :'name' => :'name',
31
+ :'status' => :'status',
32
+ :'categories' => :'categories'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'id' => :'String',
50
+ :'name' => :'String',
51
+ :'status' => :'String',
52
+ :'categories' => :'Array<String>'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::CreateWhatsAppFlow200ResponseFlow` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::CreateWhatsAppFlow200ResponseFlow`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'id')
79
+ self.id = attributes[:'id']
80
+ end
81
+
82
+ if attributes.key?(:'name')
83
+ self.name = attributes[:'name']
84
+ end
85
+
86
+ if attributes.key?(:'status')
87
+ self.status = attributes[:'status']
88
+ end
89
+
90
+ if attributes.key?(:'categories')
91
+ if (value = attributes[:'categories']).is_a?(Array)
92
+ self.categories = value
93
+ end
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
101
+ invalid_properties = Array.new
102
+ invalid_properties
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ def valid?
108
+ warn '[DEPRECATED] the `valid?` method is obsolete'
109
+ true
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ id == o.id &&
118
+ name == o.name &&
119
+ status == o.status &&
120
+ categories == o.categories
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Integer] Hash code
131
+ def hash
132
+ [id, name, status, categories].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def self.build_from_hash(attributes)
139
+ return nil unless attributes.is_a?(Hash)
140
+ attributes = attributes.transform_keys(&:to_sym)
141
+ transformed_hash = {}
142
+ openapi_types.each_pair do |key, type|
143
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = nil
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[attribute_map[key]].is_a?(Array)
149
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
150
+ end
151
+ elsif !attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
153
+ end
154
+ end
155
+ new(transformed_hash)
156
+ end
157
+
158
+ # Returns the object in the form of hash
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = self.send(attr)
164
+ if value.nil?
165
+ is_nullable = self.class.openapi_nullable.include?(attr)
166
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
167
+ end
168
+
169
+ hash[param] = _to_hash(value)
170
+ end
171
+ hash
172
+ end
173
+
174
+ end
175
+
176
+ end
@@ -0,0 +1,257 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Late
17
+ class CreateWhatsAppFlowRequest < ApiModelBase
18
+ # WhatsApp social account ID
19
+ attr_accessor :account_id
20
+
21
+ # Flow display name
22
+ attr_accessor :name
23
+
24
+ # Flow categories
25
+ attr_accessor :categories
26
+
27
+ # Optional: ID of an existing flow to clone
28
+ attr_accessor :clone_flow_id
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'account_id' => :'accountId',
56
+ :'name' => :'name',
57
+ :'categories' => :'categories',
58
+ :'clone_flow_id' => :'cloneFlowId'
59
+ }
60
+ end
61
+
62
+ # Returns attribute mapping this model knows about
63
+ def self.acceptable_attribute_map
64
+ attribute_map
65
+ end
66
+
67
+ # Returns all the JSON keys this model knows about
68
+ def self.acceptable_attributes
69
+ acceptable_attribute_map.values
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.openapi_types
74
+ {
75
+ :'account_id' => :'String',
76
+ :'name' => :'String',
77
+ :'categories' => :'Array<String>',
78
+ :'clone_flow_id' => :'String'
79
+ }
80
+ end
81
+
82
+ # List of attributes with nullable: true
83
+ def self.openapi_nullable
84
+ Set.new([
85
+ ])
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ if (!attributes.is_a?(Hash))
92
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::CreateWhatsAppFlowRequest` initialize method"
93
+ end
94
+
95
+ # check to see if the attribute exists and convert string to symbol for hash key
96
+ acceptable_attribute_map = self.class.acceptable_attribute_map
97
+ attributes = attributes.each_with_object({}) { |(k, v), h|
98
+ if (!acceptable_attribute_map.key?(k.to_sym))
99
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::CreateWhatsAppFlowRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
100
+ end
101
+ h[k.to_sym] = v
102
+ }
103
+
104
+ if attributes.key?(:'account_id')
105
+ self.account_id = attributes[:'account_id']
106
+ else
107
+ self.account_id = nil
108
+ end
109
+
110
+ if attributes.key?(:'name')
111
+ self.name = attributes[:'name']
112
+ else
113
+ self.name = nil
114
+ end
115
+
116
+ if attributes.key?(:'categories')
117
+ if (value = attributes[:'categories']).is_a?(Array)
118
+ self.categories = value
119
+ end
120
+ else
121
+ self.categories = nil
122
+ end
123
+
124
+ if attributes.key?(:'clone_flow_id')
125
+ self.clone_flow_id = attributes[:'clone_flow_id']
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
133
+ invalid_properties = Array.new
134
+ if @account_id.nil?
135
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
136
+ end
137
+
138
+ if @name.nil?
139
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
140
+ end
141
+
142
+ if @name.to_s.length > 128
143
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 128.')
144
+ end
145
+
146
+ if @categories.nil?
147
+ invalid_properties.push('invalid value for "categories", categories cannot be nil.')
148
+ end
149
+
150
+ if @categories.length < 1
151
+ invalid_properties.push('invalid value for "categories", number of items must be greater than or equal to 1.')
152
+ end
153
+
154
+ invalid_properties
155
+ end
156
+
157
+ # Check to see if the all the properties in the model are valid
158
+ # @return true if the model is valid
159
+ def valid?
160
+ warn '[DEPRECATED] the `valid?` method is obsolete'
161
+ return false if @account_id.nil?
162
+ return false if @name.nil?
163
+ return false if @name.to_s.length > 128
164
+ return false if @categories.nil?
165
+ return false if @categories.length < 1
166
+ true
167
+ end
168
+
169
+ # Custom attribute writer method with validation
170
+ # @param [Object] account_id Value to be assigned
171
+ def account_id=(account_id)
172
+ if account_id.nil?
173
+ fail ArgumentError, 'account_id cannot be nil'
174
+ end
175
+
176
+ @account_id = account_id
177
+ end
178
+
179
+ # Custom attribute writer method with validation
180
+ # @param [Object] name Value to be assigned
181
+ def name=(name)
182
+ if name.nil?
183
+ fail ArgumentError, 'name cannot be nil'
184
+ end
185
+
186
+ if name.to_s.length > 128
187
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 128.'
188
+ end
189
+
190
+ @name = name
191
+ end
192
+
193
+ # Checks equality by comparing each attribute.
194
+ # @param [Object] Object to be compared
195
+ def ==(o)
196
+ return true if self.equal?(o)
197
+ self.class == o.class &&
198
+ account_id == o.account_id &&
199
+ name == o.name &&
200
+ categories == o.categories &&
201
+ clone_flow_id == o.clone_flow_id
202
+ end
203
+
204
+ # @see the `==` method
205
+ # @param [Object] Object to be compared
206
+ def eql?(o)
207
+ self == o
208
+ end
209
+
210
+ # Calculates hash code according to all attributes.
211
+ # @return [Integer] Hash code
212
+ def hash
213
+ [account_id, name, categories, clone_flow_id].hash
214
+ end
215
+
216
+ # Builds the object from hash
217
+ # @param [Hash] attributes Model attributes in the form of hash
218
+ # @return [Object] Returns the model itself
219
+ def self.build_from_hash(attributes)
220
+ return nil unless attributes.is_a?(Hash)
221
+ attributes = attributes.transform_keys(&:to_sym)
222
+ transformed_hash = {}
223
+ openapi_types.each_pair do |key, type|
224
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
225
+ transformed_hash["#{key}"] = nil
226
+ elsif type =~ /\AArray<(.*)>/i
227
+ # check to ensure the input is an array given that the attribute
228
+ # is documented as an array but the input is not
229
+ if attributes[attribute_map[key]].is_a?(Array)
230
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
231
+ end
232
+ elsif !attributes[attribute_map[key]].nil?
233
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
234
+ end
235
+ end
236
+ new(transformed_hash)
237
+ end
238
+
239
+ # Returns the object in the form of hash
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_hash
242
+ hash = {}
243
+ self.class.attribute_map.each_pair do |attr, param|
244
+ value = self.send(attr)
245
+ if value.nil?
246
+ is_nullable = self.class.openapi_nullable.include?(attr)
247
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
248
+ end
249
+
250
+ hash[param] = _to_hash(value)
251
+ end
252
+ hash
253
+ end
254
+
255
+ end
256
+
257
+ end