Class: Spatio::CreateTaskRequest
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Spatio::CreateTaskRequest
- Defined in:
- lib/spatio-sdk/models/create_task_request.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Optional override for the target connected account.
-
#assignee_id ⇒ Object
Returns the value of attribute assignee_id.
-
#description ⇒ Object
Returns the value of attribute description.
-
#due_date ⇒ Object
Returns the value of attribute due_date.
-
#labels ⇒ Object
Returns the value of attribute labels.
-
#parent_task_id ⇒ Object
Returns the value of attribute parent_task_id.
-
#priority ⇒ Object
Returns the value of attribute priority.
-
#provider ⇒ Object
Returns the value of attribute provider.
-
#source_id ⇒ Object
Returns the value of attribute source_id.
-
#source_platform ⇒ Object
Returns the value of attribute source_platform.
-
#status ⇒ Object
Returns the value of attribute status.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ CreateTaskRequest
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ CreateTaskRequest
Initializes the object
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 129 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Spatio::CreateTaskRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Spatio::CreateTaskRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'title') self.title = attributes[:'title'] else self.title = nil end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'due_date') self.due_date = attributes[:'due_date'] end if attributes.key?(:'priority') self.priority = attributes[:'priority'] end if attributes.key?(:'labels') if (value = attributes[:'labels']).is_a?(Array) self.labels = value end end if attributes.key?(:'tags') if (value = attributes[:'tags']).is_a?(Array) self. = value end end if attributes.key?(:'assignee_id') self.assignee_id = attributes[:'assignee_id'] end if attributes.key?(:'parent_task_id') self.parent_task_id = attributes[:'parent_task_id'] end if attributes.key?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'source_platform') self.source_platform = attributes[:'source_platform'] end if attributes.key?(:'source_id') self.source_id = attributes[:'source_id'] end if attributes.key?(:'account_id') self.account_id = attributes[:'account_id'] end if attributes.key?(:'provider') self.provider = attributes[:'provider'] end end |
Instance Attribute Details
#account_id ⇒ Object
Optional override for the target connected account. May also be passed as ‘?accountId=`.
43 44 45 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 43 def account_id @account_id end |
#assignee_id ⇒ Object
Returns the value of attribute assignee_id.
32 33 34 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 32 def assignee_id @assignee_id end |
#description ⇒ Object
Returns the value of attribute description.
20 21 22 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 20 def description @description end |
#due_date ⇒ Object
Returns the value of attribute due_date.
24 25 26 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 24 def due_date @due_date end |
#labels ⇒ Object
Returns the value of attribute labels.
28 29 30 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 28 def labels @labels end |
#parent_task_id ⇒ Object
Returns the value of attribute parent_task_id.
34 35 36 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 34 def parent_task_id @parent_task_id end |
#priority ⇒ Object
Returns the value of attribute priority.
26 27 28 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 26 def priority @priority end |
#provider ⇒ Object
Returns the value of attribute provider.
45 46 47 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 45 def provider @provider end |
#source_id ⇒ Object
Returns the value of attribute source_id.
40 41 42 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 40 def source_id @source_id end |
#source_platform ⇒ Object
Returns the value of attribute source_platform.
38 39 40 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 38 def source_platform @source_platform end |
#status ⇒ Object
Returns the value of attribute status.
22 23 24 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 22 def status @status end |
#tags ⇒ Object
Returns the value of attribute tags.
30 31 32 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 30 def @tags end |
#title ⇒ Object
Returns the value of attribute title.
18 19 20 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 18 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
36 37 38 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 36 def type @type end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
90 91 92 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 90 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
95 96 97 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 95 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 70 def self.attribute_map { :'title' => :'title', :'description' => :'description', :'status' => :'status', :'due_date' => :'dueDate', :'priority' => :'priority', :'labels' => :'labels', :'tags' => :'tags', :'assignee_id' => :'assigneeId', :'parent_task_id' => :'parentTaskId', :'type' => :'type', :'source_platform' => :'sourcePlatform', :'source_id' => :'sourceId', :'account_id' => :'accountId', :'provider' => :'provider' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 284 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
120 121 122 123 124 125 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 120 def self.openapi_nullable Set.new([ :'due_date', :'parent_task_id', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 100 def self.openapi_types { :'title' => :'String', :'description' => :'String', :'status' => :'String', :'due_date' => :'Time', :'priority' => :'String', :'labels' => :'Array<String>', :'tags' => :'Array<String>', :'assignee_id' => :'String', :'parent_task_id' => :'String', :'type' => :'String', :'source_platform' => :'String', :'source_id' => :'String', :'account_id' => :'String', :'provider' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 250 def ==(o) return true if self.equal?(o) self.class == o.class && title == o.title && description == o.description && status == o.status && due_date == o.due_date && priority == o.priority && labels == o.labels && == o. && assignee_id == o.assignee_id && parent_task_id == o.parent_task_id && type == o.type && source_platform == o.source_platform && source_id == o.source_id && account_id == o.account_id && provider == o.provider end |
#eql?(o) ⇒ Boolean
271 272 273 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 271 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
277 278 279 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 277 def hash [title, description, status, due_date, priority, labels, , assignee_id, parent_task_id, type, source_platform, source_id, account_id, provider].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
208 209 210 211 212 213 214 215 216 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 208 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @title.nil? invalid_properties.push('invalid value for "title", title cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
306 307 308 309 310 311 312 313 314 315 316 317 318 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 306 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
220 221 222 223 224 225 226 |
# File 'lib/spatio-sdk/models/create_task_request.rb', line 220 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @title.nil? priority_validator = EnumAttributeValidator.new('String', ["none", "low", "medium", "high", "urgent"]) return false unless priority_validator.valid?(@priority) true end |