pingram 0.1.5 → 1.0.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.
@@ -1,184 +0,0 @@
1
- =begin
2
- #Pingram
3
-
4
- #Internal API for notification delivery and management
5
-
6
- The version of the OpenAPI document: 1.0.0
7
-
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 Pingram
17
- # In-app instant delivery: title, redirect URL, and image URL shown when the notification is delivered in real time.
18
- class TemplatePatchRequestAnyOf1Instant < ApiModelBase
19
- attr_accessor :title
20
-
21
- attr_accessor :redirect_url
22
-
23
- # Required for instant. Image URL shown in the in-app notification.
24
- attr_accessor :image_url
25
-
26
- # Attribute mapping from ruby-style variable name to JSON key.
27
- def self.attribute_map
28
- {
29
- :'title' => :'title',
30
- :'redirect_url' => :'redirectURL',
31
- :'image_url' => :'imageURL'
32
- }
33
- end
34
-
35
- # Returns attribute mapping this model knows about
36
- def self.acceptable_attribute_map
37
- attribute_map
38
- end
39
-
40
- # Returns all the JSON keys this model knows about
41
- def self.acceptable_attributes
42
- acceptable_attribute_map.values
43
- end
44
-
45
- # Attribute type mapping.
46
- def self.openapi_types
47
- {
48
- :'title' => :'String',
49
- :'redirect_url' => :'String',
50
- :'image_url' => :'String'
51
- }
52
- end
53
-
54
- # List of attributes with nullable: true
55
- def self.openapi_nullable
56
- Set.new([
57
- ])
58
- end
59
-
60
- # Initializes the object
61
- # @param [Hash] attributes Model attributes in the form of hash
62
- def initialize(attributes = {})
63
- if (!attributes.is_a?(Hash))
64
- fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::TemplatePatchRequestAnyOf1Instant` initialize method"
65
- end
66
-
67
- # check to see if the attribute exists and convert string to symbol for hash key
68
- acceptable_attribute_map = self.class.acceptable_attribute_map
69
- attributes = attributes.each_with_object({}) { |(k, v), h|
70
- if (!acceptable_attribute_map.key?(k.to_sym))
71
- fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::TemplatePatchRequestAnyOf1Instant`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
- end
73
- h[k.to_sym] = v
74
- }
75
-
76
- if attributes.key?(:'title')
77
- self.title = attributes[:'title']
78
- end
79
-
80
- if attributes.key?(:'redirect_url')
81
- self.redirect_url = attributes[:'redirect_url']
82
- end
83
-
84
- if attributes.key?(:'image_url')
85
- self.image_url = attributes[:'image_url']
86
- else
87
- self.image_url = nil
88
- end
89
- end
90
-
91
- # Show invalid properties with the reasons. Usually used together with valid?
92
- # @return Array for valid properties with the reasons
93
- def list_invalid_properties
94
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
- invalid_properties = Array.new
96
- if @image_url.nil?
97
- invalid_properties.push('invalid value for "image_url", image_url cannot be nil.')
98
- end
99
-
100
- invalid_properties
101
- end
102
-
103
- # Check to see if the all the properties in the model are valid
104
- # @return true if the model is valid
105
- def valid?
106
- warn '[DEPRECATED] the `valid?` method is obsolete'
107
- return false if @image_url.nil?
108
- true
109
- end
110
-
111
- # Custom attribute writer method with validation
112
- # @param [Object] image_url Value to be assigned
113
- def image_url=(image_url)
114
- if image_url.nil?
115
- fail ArgumentError, 'image_url cannot be nil'
116
- end
117
-
118
- @image_url = image_url
119
- end
120
-
121
- # Checks equality by comparing each attribute.
122
- # @param [Object] Object to be compared
123
- def ==(o)
124
- return true if self.equal?(o)
125
- self.class == o.class &&
126
- title == o.title &&
127
- redirect_url == o.redirect_url &&
128
- image_url == o.image_url
129
- end
130
-
131
- # @see the `==` method
132
- # @param [Object] Object to be compared
133
- def eql?(o)
134
- self == o
135
- end
136
-
137
- # Calculates hash code according to all attributes.
138
- # @return [Integer] Hash code
139
- def hash
140
- [title, redirect_url, image_url].hash
141
- end
142
-
143
- # Builds the object from hash
144
- # @param [Hash] attributes Model attributes in the form of hash
145
- # @return [Object] Returns the model itself
146
- def self.build_from_hash(attributes)
147
- return nil unless attributes.is_a?(Hash)
148
- attributes = attributes.transform_keys(&:to_sym)
149
- transformed_hash = {}
150
- openapi_types.each_pair do |key, type|
151
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
152
- transformed_hash["#{key}"] = nil
153
- elsif type =~ /\AArray<(.*)>/i
154
- # check to ensure the input is an array given that the attribute
155
- # is documented as an array but the input is not
156
- if attributes[attribute_map[key]].is_a?(Array)
157
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
158
- end
159
- elsif !attributes[attribute_map[key]].nil?
160
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
161
- end
162
- end
163
- new(transformed_hash)
164
- end
165
-
166
- # Returns the object in the form of hash
167
- # @return [Hash] Returns the object in the form of hash
168
- def to_hash
169
- hash = {}
170
- self.class.attribute_map.each_pair do |attr, param|
171
- value = self.send(attr)
172
- if value.nil?
173
- is_nullable = self.class.openapi_nullable.include?(attr)
174
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
175
- end
176
-
177
- hash[param] = _to_hash(value)
178
- end
179
- hash
180
- end
181
-
182
- end
183
-
184
- end