Class: Merge::Ticketing::PatchedTicketRequest

Inherits:
Object
  • Object
show all
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, issue, task or case.
### Usage Example
TODO

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: OMIT, assignees: OMIT, assigned_teams: OMIT, creator: OMIT, due_date: OMIT, status: OMIT, description: OMIT, collections: OMIT, ticket_type: OMIT, account: OMIT, contact: OMIT, parent_ticket: OMIT, access_level: OMIT, tags: OMIT, roles: OMIT, ticket_url: OMIT, priority: OMIT, completed_at: OMIT, integration_params: OMIT, linked_account_params: OMIT, remote_fields: OMIT, additional_properties: nil) ⇒ Merge::Ticketing::PatchedTicketRequest

Parameters:

  • name (String) (defaults to: OMIT)

    The ticket’s name.

  • assignees (Array<String>) (defaults to: OMIT)

    The individual ‘Users` who are assigned to this ticket. This does not include `Users` who just have view access to this ticket. To fetch all `Users` and `Teams` that can access the ticket, use the `GET /tickets/ticket_id/viewers` [endpoint](docs.merge.dev/ticketing/tickets/#tickets_viewers_list).

  • assigned_teams (Array<String>) (defaults to: OMIT)

    The ‘Teams` that are assigned to this ticket. This does not include `Teams` who just have view access to this ticket. To fetch all `Users` and `Teams` that can access this ticket, use the `GET /tickets/ticket_id/viewers` [endpoint](docs.merge.dev/ticketing/tickets/#tickets_viewers_list).

  • creator (String) (defaults to: OMIT)

    The user who created this ticket.

  • due_date (DateTime) (defaults to: OMIT)

    The ticket’s due date.

  • status (Merge::Ticketing::TicketStatusEnum) (defaults to: OMIT)

    The current status of the ticket.

    • ‘OPEN` - OPEN

    • ‘CLOSED` - CLOSED

    • ‘IN_PROGRESS` - IN_PROGRESS

    • ‘ON_HOLD` - ON_HOLD

  • description (String) (defaults to: OMIT)

    The ticket’s description. HTML version of description is mapped if supported by the third-party platform.

  • collections (Array<String>) (defaults to: OMIT)

    The ‘Collections` that this `Ticket` is included in.

  • ticket_type (String) (defaults to: OMIT)

    The sub category of the ticket within the 3rd party system. Examples include incident, task, subtask or to-do.

  • account (String) (defaults to: OMIT)

    The account associated with the ticket.

  • contact (String) (defaults to: OMIT)

    The contact associated with the ticket.

  • parent_ticket (String) (defaults to: OMIT)

    The ticket’s parent ticket.

  • access_level (Merge::Ticketing::TicketAccessLevelEnum) (defaults to: OMIT)

    The description of who is able to access a given ticket, or where access is inherited from.

    • ‘COMPANY` - COMPANY

    • ‘PUBLIC` - PUBLIC

    • ‘PRIVATE` - PRIVATE

    • ‘COLLECTION` - COLLECTION

  • tags (Array<String>) (defaults to: OMIT)
  • roles (Array<String>) (defaults to: OMIT)
  • ticket_url (String) (defaults to: OMIT)

    The 3rd party url of the Ticket.

  • priority (Merge::Ticketing::PriorityEnum) (defaults to: OMIT)

    The priority or urgency of the Ticket.

    • ‘URGENT` - URGENT

    • ‘HIGH` - HIGH

    • ‘NORMAL` - NORMAL

    • ‘LOW` - LOW

  • completed_at (DateTime) (defaults to: OMIT)

    When the ticket was completed.

  • integration_params (Hash{String => Object}) (defaults to: OMIT)
  • linked_account_params (Hash{String => Object}) (defaults to: OMIT)
  • remote_fields (Array<Merge::Ticketing::RemoteFieldRequest>) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 134

def initialize(name: OMIT, assignees: OMIT, assigned_teams: OMIT, creator: OMIT, due_date: OMIT, status: OMIT,
               description: OMIT, collections: OMIT, ticket_type: OMIT, account: OMIT, contact: OMIT, parent_ticket: OMIT, access_level: OMIT, tags: OMIT, roles: OMIT, ticket_url: OMIT, priority: OMIT, completed_at: OMIT, integration_params: OMIT, linked_account_params: OMIT, remote_fields: OMIT, additional_properties: nil)
  @name = name if name != OMIT
  @assignees = assignees if assignees != OMIT
  @assigned_teams = assigned_teams if assigned_teams != 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 =  if  != OMIT
  @contact = contact if contact != OMIT
  @parent_ticket = parent_ticket if parent_ticket != OMIT
  @access_level = access_level if access_level != OMIT
  @tags = tags if tags != OMIT
  @roles = roles if roles != OMIT
  @ticket_url = ticket_url if ticket_url != OMIT
  @priority = priority if priority != OMIT
  @completed_at = completed_at if completed_at != OMIT
  @integration_params = integration_params if integration_params != OMIT
   =  if  != OMIT
  @remote_fields = remote_fields if remote_fields != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "name": name,
    "assignees": assignees,
    "assigned_teams": assigned_teams,
    "creator": creator,
    "due_date": due_date,
    "status": status,
    "description": description,
    "collections": collections,
    "ticket_type": ticket_type,
    "account": ,
    "contact": contact,
    "parent_ticket": parent_ticket,
    "access_level": access_level,
    "tags": tags,
    "roles": roles,
    "ticket_url": ticket_url,
    "priority": priority,
    "completed_at": completed_at,
    "integration_params": integration_params,
    "linked_account_params": ,
    "remote_fields": remote_fields
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#access_levelMerge::Ticketing::TicketAccessLevelEnum (readonly)

Returns The description of who is able to access a given ticket, or where access is inherited from.

  • ‘COMPANY` - COMPANY

  • ‘PUBLIC` - PUBLIC

  • ‘PRIVATE` - PRIVATE

  • ‘COLLECTION` - COLLECTION.

Returns:

  • (Merge::Ticketing::TicketAccessLevelEnum)

    The description of who is able to access a given ticket, or where access is inherited from.

    • ‘COMPANY` - COMPANY

    • ‘PUBLIC` - PUBLIC

    • ‘PRIVATE` - PRIVATE

    • ‘COLLECTION` - COLLECTION



61
62
63
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 61

def access_level
  @access_level
end

#accountString (readonly)

Returns The account associated with the ticket.

Returns:

  • (String)

    The account associated with the ticket.



50
51
52
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 50

def 
  @account
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



83
84
85
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 83

def additional_properties
  @additional_properties
end

#assigned_teamsArray<String> (readonly)

Returns The ‘Teams` that are assigned to this ticket. This does not include `Teams` who just have view access to this ticket. To fetch all `Users` and `Teams` that can access this ticket, use the `GET /tickets/ticket_id/viewers` [endpoint](docs.merge.dev/ticketing/tickets/#tickets_viewers_list).

Returns:

  • (Array<String>)

    The ‘Teams` that are assigned to this ticket. This does not include `Teams` who just have view access to this ticket. To fetch all `Users` and `Teams` that can access this ticket, use the `GET /tickets/ticket_id/viewers` [endpoint](docs.merge.dev/ticketing/tickets/#tickets_viewers_list).



30
31
32
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 30

def assigned_teams
  @assigned_teams
end

#assigneesArray<String> (readonly)

Returns The individual ‘Users` who are assigned to this ticket. This does not include `Users` who just have view access to this ticket. To fetch all `Users` and `Teams` that can access the ticket, use the `GET /tickets/ticket_id/viewers` [endpoint](docs.merge.dev/ticketing/tickets/#tickets_viewers_list).

Returns:

  • (Array<String>)

    The individual ‘Users` who are assigned to this ticket. This does not include `Users` who just have view access to this ticket. To fetch all `Users` and `Teams` that can access the ticket, use the `GET /tickets/ticket_id/viewers` [endpoint](docs.merge.dev/ticketing/tickets/#tickets_viewers_list).



25
26
27
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 25

def assignees
  @assignees
end

#collectionsArray<String> (readonly)

Returns The ‘Collections` that this `Ticket` is included in.

Returns:

  • (Array<String>)

    The ‘Collections` that this `Ticket` is included in.



45
46
47
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 45

def collections
  @collections
end

#completed_atDateTime (readonly)

Returns When the ticket was completed.

Returns:

  • (DateTime)

    When the ticket was completed.



75
76
77
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 75

def completed_at
  @completed_at
end

#contactString (readonly)

Returns The contact associated with the ticket.

Returns:

  • (String)

    The contact associated with the ticket.



52
53
54
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 52

def contact
  @contact
end

#creatorString (readonly)

Returns The user who created this ticket.

Returns:

  • (String)

    The user who created this ticket.



32
33
34
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 32

def creator
  @creator
end

#descriptionString (readonly)

Returns The ticket’s description. HTML version of description is mapped if supported by the third-party platform.

Returns:

  • (String)

    The ticket’s description. HTML version of description is mapped if supported by the third-party platform.



43
44
45
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 43

def description
  @description
end

#due_dateDateTime (readonly)

Returns The ticket’s due date.

Returns:

  • (DateTime)

    The ticket’s due date.



34
35
36
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 34

def due_date
  @due_date
end

#integration_paramsHash{String => Object} (readonly)

Returns:

  • (Hash{String => Object})


77
78
79
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 77

def integration_params
  @integration_params
end

#linked_account_paramsHash{String => Object} (readonly)

Returns:

  • (Hash{String => Object})


79
80
81
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 79

def 
  
end

#nameString (readonly)

Returns The ticket’s name.

Returns:

  • (String)

    The ticket’s name.



20
21
22
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 20

def name
  @name
end

#parent_ticketString (readonly)

Returns The ticket’s parent ticket.

Returns:

  • (String)

    The ticket’s parent ticket.



54
55
56
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 54

def parent_ticket
  @parent_ticket
end

#priorityMerge::Ticketing::PriorityEnum (readonly)

Returns The priority or urgency of the Ticket.

  • ‘URGENT` - URGENT

  • ‘HIGH` - HIGH

  • ‘NORMAL` - NORMAL

  • ‘LOW` - LOW.

Returns:



73
74
75
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 73

def priority
  @priority
end

#remote_fieldsArray<Merge::Ticketing::RemoteFieldRequest> (readonly)



81
82
83
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 81

def remote_fields
  @remote_fields
end

#rolesArray<String> (readonly)

Returns:

  • (Array<String>)


65
66
67
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 65

def roles
  @roles
end

#statusMerge::Ticketing::TicketStatusEnum (readonly)

Returns The current status of the ticket.

  • ‘OPEN` - OPEN

  • ‘CLOSED` - CLOSED

  • ‘IN_PROGRESS` - IN_PROGRESS

  • ‘ON_HOLD` - ON_HOLD.

Returns:



40
41
42
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 40

def status
  @status
end

#tagsArray<String> (readonly)

Returns:

  • (Array<String>)


63
64
65
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 63

def tags
  @tags
end

#ticket_typeString (readonly)

Returns The sub category of the ticket within the 3rd party system. Examples include incident, task, subtask or to-do.

Returns:

  • (String)

    The sub category of the ticket within the 3rd party system. Examples include incident, task, subtask or to-do.



48
49
50
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 48

def ticket_type
  @ticket_type
end

#ticket_urlString (readonly)

Returns The 3rd party url of the Ticket.

Returns:

  • (String)

    The 3rd party url of the Ticket.



67
68
69
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 67

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

Parameters:

  • json_object (String)

Returns:



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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 189

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"]
  assigned_teams = parsed_json["assigned_teams"]
  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"]
   = parsed_json["account"]
  contact = parsed_json["contact"]
  parent_ticket = parsed_json["parent_ticket"]
  access_level = parsed_json["access_level"]
  tags = parsed_json["tags"]
  roles = parsed_json["roles"]
  ticket_url = parsed_json["ticket_url"]
  priority = parsed_json["priority"]
  completed_at = (DateTime.parse(parsed_json["completed_at"]) unless parsed_json["completed_at"].nil?)
  integration_params = parsed_json["integration_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,
    assigned_teams: assigned_teams,
    creator: creator,
    due_date: due_date,
    status: status,
    description: description,
    collections: collections,
    ticket_type: ticket_type,
    account: ,
    contact: contact,
    parent_ticket: parent_ticket,
    access_level: access_level,
    tags: tags,
    roles: roles,
    ticket_url: ticket_url,
    priority: priority,
    completed_at: completed_at,
    integration_params: integration_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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 255

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.assigned_teams&.is_a?(Array) != false || raise("Passed value for field obj.assigned_teams 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.&.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.access_level&.is_a?(Merge::Ticketing::TicketAccessLevelEnum) != false || raise("Passed value for field obj.access_level is not the expected type, validation failed.")
  obj.tags&.is_a?(Array) != false || raise("Passed value for field obj.tags is not the expected type, validation failed.")
  obj.roles&.is_a?(Array) != false || raise("Passed value for field obj.roles 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.completed_at&.is_a?(DateTime) != false || raise("Passed value for field obj.completed_at 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.&.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

Returns:

  • (String)


245
246
247
# File 'lib/merge_ruby_client/ticketing/types/patched_ticket_request.rb', line 245

def to_json(*_args)
  @_field_set&.to_json
end