Class: Merge::Ticketing::PatchedTicketRequest
- Inherits:
-
Object
- Object
- Merge::Ticketing::PatchedTicketRequest
- Defined in:
- lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb
Overview
# The Ticket Object
### Description
The `Ticket` object is used to represent a ticket or a task within a system.
### Usage Example
TODO
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#account ⇒ String
readonly
The account associated with the ticket.
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #assignees ⇒ Array<String> readonly
- #collections ⇒ Array<String> readonly
-
#completed_at ⇒ DateTime
readonly
When the ticket was completed.
-
#contact ⇒ String
readonly
The contact associated with the ticket.
-
#creator ⇒ String
readonly
The user who created this ticket.
-
#description ⇒ String
readonly
The ticket’s description.
-
#due_date ⇒ DateTime
readonly
The ticket’s due date.
- #integration_params ⇒ Hash{String => Object} readonly
- #linked_account_params ⇒ Hash{String => Object} readonly
-
#name ⇒ String
readonly
The ticket’s name.
-
#parent_ticket ⇒ String
readonly
The ticket’s parent ticket.
-
#priority ⇒ Merge::Ticketing::PriorityEnum
readonly
The priority or urgency of the Ticket.
- #remote_fields ⇒ Array<Merge::Ticketing::RemoteFieldRequest> readonly
-
#status ⇒ Merge::Ticketing::TicketStatusEnum
readonly
The current status of the ticket.
- #tags ⇒ Array<String> readonly
-
#ticket_type ⇒ String
readonly
The sub category of the ticket within the 3rd party system.
-
#ticket_url ⇒ String
readonly
The 3rd party url of the Ticket.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Ticketing::PatchedTicketRequest
Deserialize a JSON object to an instance of PatchedTicketRequest.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(name: OMIT, assignees: OMIT, creator: OMIT, due_date: OMIT, status: OMIT, description: OMIT, collections: OMIT, ticket_type: OMIT, account: OMIT, contact: OMIT, parent_ticket: OMIT, tags: OMIT, completed_at: OMIT, ticket_url: OMIT, priority: OMIT, integration_params: OMIT, linked_account_params: OMIT, remote_fields: OMIT, additional_properties: nil) ⇒ Merge::Ticketing::PatchedTicketRequest constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of PatchedTicketRequest to a JSON object.
Constructor Details
#initialize(name: OMIT, assignees: OMIT, creator: OMIT, due_date: OMIT, status: OMIT, description: OMIT, collections: OMIT, ticket_type: OMIT, account: OMIT, contact: OMIT, parent_ticket: OMIT, tags: OMIT, completed_at: OMIT, ticket_url: OMIT, priority: OMIT, integration_params: OMIT, linked_account_params: OMIT, remote_fields: OMIT, additional_properties: nil) ⇒ Merge::Ticketing::PatchedTicketRequest
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 102 def initialize(name: OMIT, assignees: OMIT, creator: OMIT, due_date: OMIT, status: OMIT, description: OMIT, collections: OMIT, ticket_type: OMIT, account: OMIT, contact: OMIT, parent_ticket: OMIT, tags: OMIT, completed_at: OMIT, ticket_url: OMIT, priority: OMIT, integration_params: OMIT, linked_account_params: OMIT, remote_fields: OMIT, additional_properties: nil) @name = name if name != OMIT @assignees = assignees if assignees != OMIT @creator = creator if creator != OMIT @due_date = due_date if due_date != OMIT @status = status if status != OMIT @description = description if description != OMIT @collections = collections if collections != OMIT @ticket_type = ticket_type if ticket_type != OMIT @account = account if account != OMIT @contact = contact if contact != OMIT @parent_ticket = parent_ticket if parent_ticket != OMIT @tags = if != OMIT @completed_at = completed_at if completed_at != OMIT @ticket_url = ticket_url if ticket_url != OMIT @priority = priority if priority != OMIT @integration_params = integration_params if integration_params != OMIT @linked_account_params = linked_account_params if linked_account_params != OMIT @remote_fields = remote_fields if remote_fields != OMIT @additional_properties = additional_properties @_field_set = { "name": name, "assignees": assignees, "creator": creator, "due_date": due_date, "status": status, "description": description, "collections": collections, "ticket_type": ticket_type, "account": account, "contact": contact, "parent_ticket": parent_ticket, "tags": , "completed_at": completed_at, "ticket_url": ticket_url, "priority": priority, "integration_params": integration_params, "linked_account_params": linked_account_params, "remote_fields": remote_fields }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#account ⇒ String (readonly)
Returns The account associated with the ticket.
41 42 43 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 41 def account @account end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
65 66 67 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 65 def additional_properties @additional_properties end |
#assignees ⇒ Array<String> (readonly)
21 22 23 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 21 def assignees @assignees end |
#collections ⇒ Array<String> (readonly)
36 37 38 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 36 def collections @collections end |
#completed_at ⇒ DateTime (readonly)
Returns When the ticket was completed.
49 50 51 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 49 def completed_at @completed_at end |
#contact ⇒ String (readonly)
Returns The contact associated with the ticket.
43 44 45 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 43 def contact @contact end |
#creator ⇒ String (readonly)
Returns The user who created this ticket.
23 24 25 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 23 def creator @creator end |
#description ⇒ String (readonly)
Returns The ticket’s description. HTML version of description is mapped if supported by the third-party platform.
34 35 36 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 34 def description @description end |
#due_date ⇒ DateTime (readonly)
Returns The ticket’s due date.
25 26 27 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 25 def due_date @due_date end |
#integration_params ⇒ Hash{String => Object} (readonly)
59 60 61 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 59 def integration_params @integration_params end |
#linked_account_params ⇒ Hash{String => Object} (readonly)
61 62 63 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 61 def linked_account_params @linked_account_params end |
#name ⇒ String (readonly)
Returns The ticket’s name.
19 20 21 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 19 def name @name end |
#parent_ticket ⇒ String (readonly)
Returns The ticket’s parent ticket.
45 46 47 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 45 def parent_ticket @parent_ticket end |
#priority ⇒ Merge::Ticketing::PriorityEnum (readonly)
Returns The priority or urgency of the Ticket.
-
‘URGENT` - URGENT
-
‘HIGH` - HIGH
-
‘NORMAL` - NORMAL
-
‘LOW` - LOW.
57 58 59 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 57 def priority @priority end |
#remote_fields ⇒ Array<Merge::Ticketing::RemoteFieldRequest> (readonly)
63 64 65 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 63 def remote_fields @remote_fields end |
#status ⇒ Merge::Ticketing::TicketStatusEnum (readonly)
Returns The current status of the ticket.
-
‘OPEN` - OPEN
-
‘CLOSED` - CLOSED
-
‘IN_PROGRESS` - IN_PROGRESS
-
‘ON_HOLD` - ON_HOLD.
31 32 33 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 31 def status @status end |
#tags ⇒ Array<String> (readonly)
47 48 49 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 47 def @tags end |
#ticket_type ⇒ String (readonly)
Returns The sub category of the ticket within the 3rd party system. Examples include incident, task, subtask or to-do.
39 40 41 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 39 def ticket_type @ticket_type end |
#ticket_url ⇒ String (readonly)
Returns The 3rd party url of the Ticket.
51 52 53 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 51 def ticket_url @ticket_url end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Ticketing::PatchedTicketRequest
Deserialize a JSON object to an instance of PatchedTicketRequest
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 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 151 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) name = parsed_json["name"] assignees = parsed_json["assignees"] creator = parsed_json["creator"] due_date = (DateTime.parse(parsed_json["due_date"]) unless parsed_json["due_date"].nil?) status = parsed_json["status"] description = parsed_json["description"] collections = parsed_json["collections"] ticket_type = parsed_json["ticket_type"] account = parsed_json["account"] contact = parsed_json["contact"] parent_ticket = parsed_json["parent_ticket"] = parsed_json["tags"] completed_at = (DateTime.parse(parsed_json["completed_at"]) unless parsed_json["completed_at"].nil?) ticket_url = parsed_json["ticket_url"] priority = parsed_json["priority"] integration_params = parsed_json["integration_params"] linked_account_params = parsed_json["linked_account_params"] remote_fields = parsed_json["remote_fields"]&.map do |item| item = item.to_json Merge::Ticketing::RemoteFieldRequest.from_json(json_object: item) end new( name: name, assignees: assignees, creator: creator, due_date: due_date, status: status, description: description, collections: collections, ticket_type: ticket_type, account: account, contact: contact, parent_ticket: parent_ticket, tags: , completed_at: completed_at, ticket_url: ticket_url, priority: priority, integration_params: integration_params, linked_account_params: linked_account_params, remote_fields: remote_fields, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 211 def self.validate_raw(obj:) obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.assignees&.is_a?(Array) != false || raise("Passed value for field obj.assignees is not the expected type, validation failed.") obj.creator&.is_a?(String) != false || raise("Passed value for field obj.creator is not the expected type, validation failed.") obj.due_date&.is_a?(DateTime) != false || raise("Passed value for field obj.due_date is not the expected type, validation failed.") obj.status&.is_a?(Merge::Ticketing::TicketStatusEnum) != false || raise("Passed value for field obj.status is not the expected type, validation failed.") obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.") obj.collections&.is_a?(Array) != false || raise("Passed value for field obj.collections is not the expected type, validation failed.") obj.ticket_type&.is_a?(String) != false || raise("Passed value for field obj.ticket_type is not the expected type, validation failed.") obj.account&.is_a?(String) != false || raise("Passed value for field obj.account is not the expected type, validation failed.") obj.contact&.is_a?(String) != false || raise("Passed value for field obj.contact is not the expected type, validation failed.") obj.parent_ticket&.is_a?(String) != false || raise("Passed value for field obj.parent_ticket is not the expected type, validation failed.") obj.&.is_a?(Array) != false || raise("Passed value for field obj.tags is not the expected type, validation failed.") obj.completed_at&.is_a?(DateTime) != false || raise("Passed value for field obj.completed_at is not the expected type, validation failed.") obj.ticket_url&.is_a?(String) != false || raise("Passed value for field obj.ticket_url is not the expected type, validation failed.") obj.priority&.is_a?(Merge::Ticketing::PriorityEnum) != false || raise("Passed value for field obj.priority is not the expected type, validation failed.") obj.integration_params&.is_a?(Hash) != false || raise("Passed value for field obj.integration_params is not the expected type, validation failed.") obj.linked_account_params&.is_a?(Hash) != false || raise("Passed value for field obj.linked_account_params is not the expected type, validation failed.") obj.remote_fields&.is_a?(Array) != false || raise("Passed value for field obj.remote_fields is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of PatchedTicketRequest to a JSON object
201 202 203 |
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 201 def to_json(*_args) @_field_set&.to_json end |