Class: Shipeasy::Admin::Generated::CreatePublicFeatureRequestRequest
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Shipeasy::Admin::Generated::CreatePublicFeatureRequestRequest
- Defined in:
- lib/shipeasy_admin/models/create_public_feature_request_request.rb
Overview
Body for POST /ops/feature-request. The same feature-request fields as CreateFeatureRequestRequest, minus the type discriminator — the path already says what is being filed.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#assignee_id ⇒ Object
The
users.idof the person to assign as owner at creation, ornull. -
#context ⇒ Object
Arbitrary capture context, or
null. -
#description ⇒ Object
What the feature is.
-
#notify ⇒ Object
Where this request's completion notification lands.
-
#page_url ⇒ Object
URL of the page the request relates to, or
null. -
#priority ⇒ Object
Initial triage priority, or
null. -
#reporter_email ⇒ Object
Email of the reporter, or
null. -
#status ⇒ Object
Initial lifecycle status; defaults to
openwhen omitted. -
#subscribers ⇒ Object
Emails of teammates to subscribe to this item's Slack pings at creation.
-
#tags ⇒ Object
Tag names to attach at creation (get-or-created by name, deduped case-insensitively).
-
#title ⇒ Object
One-line feature-request title (no leading/trailing whitespace).
-
#use_case ⇒ Object
Why it's needed / the use case.
-
#user_agent ⇒ Object
Reporter's user-agent string, or
null.
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 = {}) ⇒ CreatePublicFeatureRequestRequest
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 = {}) ⇒ CreatePublicFeatureRequestRequest
Initializes the object
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 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 143 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::CreatePublicFeatureRequestRequest` 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 `Shipeasy::Admin::Generated::CreatePublicFeatureRequestRequest`. 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'] else self.description = '' end if attributes.key?(:'use_case') self.use_case = attributes[:'use_case'] else self.use_case = '' end if attributes.key?(:'priority') self.priority = attributes[:'priority'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'assignee_id') self.assignee_id = attributes[:'assignee_id'] end if attributes.key?(:'subscribers') if (value = attributes[:'subscribers']).is_a?(Array) self.subscribers = value end end if attributes.key?(:'tags') if (value = attributes[:'tags']).is_a?(Array) self. = value end end if attributes.key?(:'reporter_email') self.reporter_email = attributes[:'reporter_email'] end if attributes.key?(:'page_url') self.page_url = attributes[:'page_url'] end if attributes.key?(:'user_agent') self.user_agent = attributes[:'user_agent'] end if attributes.key?(:'context') if (value = attributes[:'context']).is_a?(Hash) self.context = value end end if attributes.key?(:'notify') self.notify = attributes[:'notify'] end end |
Instance Attribute Details
#assignee_id ⇒ Object
The users.id of the person to assign as owner at creation, or null.
35 36 37 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 35 def assignee_id @assignee_id end |
#context ⇒ Object
Arbitrary capture context, or null.
53 54 55 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 53 def context @context end |
#description ⇒ Object
What the feature is.
23 24 25 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 23 def description @description end |
#notify ⇒ Object
Where this request's completion notification lands.
56 57 58 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 56 def notify @notify end |
#page_url ⇒ Object
URL of the page the request relates to, or null.
47 48 49 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 47 def page_url @page_url end |
#priority ⇒ Object
Initial triage priority, or null.
29 30 31 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 29 def priority @priority end |
#reporter_email ⇒ Object
Email of the reporter, or null.
44 45 46 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 44 def reporter_email @reporter_email end |
#status ⇒ Object
Initial lifecycle status; defaults to open when omitted.
32 33 34 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 32 def status @status end |
#subscribers ⇒ Object
Emails of teammates to subscribe to this item's Slack pings at creation.
38 39 40 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 38 def subscribers @subscribers end |
#tags ⇒ Object
Tag names to attach at creation (get-or-created by name, deduped case-insensitively).
41 42 43 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 41 def @tags end |
#title ⇒ Object
One-line feature-request title (no leading/trailing whitespace).
20 21 22 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 20 def title @title end |
#use_case ⇒ Object
Why it's needed / the use case.
26 27 28 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 26 def use_case @use_case end |
#user_agent ⇒ Object
Reporter's user-agent string, or null.
50 51 52 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 50 def user_agent @user_agent end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
100 101 102 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 100 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
105 106 107 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 105 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 81 def self.attribute_map { :'title' => :'title', :'description' => :'description', :'use_case' => :'useCase', :'priority' => :'priority', :'status' => :'status', :'assignee_id' => :'assigneeId', :'subscribers' => :'subscribers', :'tags' => :'tags', :'reporter_email' => :'reporterEmail', :'page_url' => :'pageUrl', :'user_agent' => :'userAgent', :'context' => :'context', :'notify' => :'notify' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 369 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
129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 129 def self.openapi_nullable Set.new([ :'priority', :'assignee_id', :'reporter_email', :'page_url', :'user_agent', :'context', :'notify' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 110 def self.openapi_types { :'title' => :'String', :'description' => :'String', :'use_case' => :'String', :'priority' => :'OpsItemPriority', :'status' => :'OpsItemStatus', :'assignee_id' => :'String', :'subscribers' => :'Array<String>', :'tags' => :'Array<String>', :'reporter_email' => :'String', :'page_url' => :'String', :'user_agent' => :'String', :'context' => :'Hash<String, Object>', :'notify' => :'NotificationTarget' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 336 def ==(o) return true if self.equal?(o) self.class == o.class && title == o.title && description == o.description && use_case == o.use_case && priority == o.priority && status == o.status && assignee_id == o.assignee_id && subscribers == o.subscribers && == o. && reporter_email == o.reporter_email && page_url == o.page_url && user_agent == o.user_agent && context == o.context && notify == o.notify end |
#eql?(o) ⇒ Boolean
356 357 358 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 356 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
362 363 364 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 362 def hash [title, description, use_case, priority, status, assignee_id, subscribers, , reporter_email, page_url, user_agent, context, notify].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 224 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 if @title.to_s.length > 200 invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 200.') end if @title.to_s.length < 1 invalid_properties.push('invalid value for "title", the character length must be greater than or equal to 1.') end pattern = Regexp.new(/^\S(.*\S)?$/) if @title !~ pattern invalid_properties.push("invalid value for \"title\", must conform to the pattern #{pattern}.") end if !@description.nil? && @description.to_s.length > 8000 invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 8000.') end if !@use_case.nil? && @use_case.to_s.length > 8000 invalid_properties.push('invalid value for "use_case", the character length must be smaller than or equal to 8000.') end if !@user_agent.nil? && @user_agent.to_s.length > 500 invalid_properties.push('invalid value for "user_agent", the character length must be smaller than or equal to 500.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
391 392 393 394 395 396 397 398 399 400 401 402 403 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 391 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
261 262 263 264 265 266 267 268 269 270 271 |
# File 'lib/shipeasy_admin/models/create_public_feature_request_request.rb', line 261 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @title.nil? return false if @title.to_s.length > 200 return false if @title.to_s.length < 1 return false if @title !~ Regexp.new(/^\S(.*\S)?$/) return false if !@description.nil? && @description.to_s.length > 8000 return false if !@use_case.nil? && @use_case.to_s.length > 8000 return false if !@user_agent.nil? && @user_agent.to_s.length > 500 true end |