Skip to content

Commit

Permalink
Merge pull request #319 from Roti12/master
Browse files Browse the repository at this point in the history
Add ability to select ticket_form_id when updating a ticket
  • Loading branch information
mikerogers123 authored Nov 2, 2023
2 parents e92590e + a864e8f commit b7d9b1d
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ZendeskApi.Build/ZendeskApi.Commons.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<PropertyGroup>
<Major>7</Major>
<Minor>0</Minor>
<Revision>4</Revision>
<Revision>5</Revision>
<PackageVersion>$(Major).$(Minor).$(Revision)</PackageVersion>
</PropertyGroup>
<ItemGroup>
Expand Down
37 changes: 37 additions & 0 deletions src/ZendeskApi.Client/Models/Status/Included/Attributes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using Newtonsoft.Json;

namespace ZendeskApi.Client.Models.Status.Included;

public class Attributes
{
[JsonProperty("created_at")]
public DateTime? CreatedAt { get; set; }

[JsonProperty("description")]
public string Description { get; set; }

[JsonProperty("name")]
public string Name { get; set; }

[JsonProperty("slug")]
public string Slug { get; set; }

[JsonProperty("degradation")]
public bool? Degradation { get; set; }

[JsonProperty("incident_id")]
public string IncidentId { get; set; }

[JsonProperty("outage")]
public bool? Outage { get; set; }

[JsonProperty("resolved_at")]
public DateTime? ResolvedAt { get; set; }

[JsonProperty("service_id")]
public string ServiceId { get; set; }

[JsonProperty("started_at")]
public DateTime? StartedAt { get; set; }
}
18 changes: 18 additions & 0 deletions src/ZendeskApi.Client/Models/Status/Included/Included.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Newtonsoft.Json;

namespace ZendeskApi.Client.Models.Status.Included;

public class Included
{
[JsonProperty("attributes")]
public Attributes Attributes { get; set; }

[JsonProperty("id")]
public string Id { get; set; }

[JsonProperty("type")]
public Type Type { get; set; }

[JsonProperty("relationships")]
public Relationships Relationships { get; set; }
}
13 changes: 13 additions & 0 deletions src/ZendeskApi.Client/Models/Status/Included/IncludedReference.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace ZendeskApi.Client.Models.Status.Included;

public class IncludedReference
{
[JsonProperty("id")]
public string Id { get; set; }

[JsonProperty("type")]
public Type Type { get; set; }
}
9 changes: 9 additions & 0 deletions src/ZendeskApi.Client/Models/Status/Included/Relationships.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Newtonsoft.Json;

namespace ZendeskApi.Client.Models.Status.Included;

public class Relationships
{
[JsonProperty("service")]
public Service Service { get; set; }
}
5 changes: 5 additions & 0 deletions src/ZendeskApi.Client/Models/Status/Included/Service.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace ZendeskApi.Client.Models.Status.Included;

public class Service : DataContainer<IncludedReference>
{
}
15 changes: 15 additions & 0 deletions src/ZendeskApi.Client/Models/Status/Included/Type.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Runtime.Serialization;

namespace ZendeskApi.Client.Models.Status.Included;

public enum Type
{
[EnumMember(Value = "service")]
Service,
[EnumMember(Value = "incident_service")]
IncidentService,
[EnumMember(Value = "incident_update")]
IncidentUpdate,
[EnumMember(Value = "incident")]
Incident
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace ZendeskApi.Client.Models.Status.Response;

public class ListIncidentsResponse : DataContainer<IReadOnlyList<Incident>>
{
[JsonProperty("included")]
public IReadOnlyList<Included.Included> Included { get; set; }
}
6 changes: 6 additions & 0 deletions src/ZendeskApi.Client/Requests/Ticket/TicketUpdateRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,11 @@ public TicketUpdateRequest(long id)

[JsonProperty("brand_id")]
public long? BrandId { get; set; }

/// <summary>
/// The id of the ticket form to use. Only applicable for enterprise accounts
/// </summary>
[JsonProperty("ticket_form_id")]
public long? FormId { get; set; }
}
}

0 comments on commit b7d9b1d

Please sign in to comment.