Skip to content

Commit a0c0f63

Browse files
APErebusOctobob
authored andcommitted
Add pull requests resource to InterruptionResource
+semver: minor GitOrigin-RevId: d6a9aa3c6032b02b452845b0b12922b7b23868e2
1 parent 77f1980 commit a0c0f63

File tree

4 files changed

+97
-1
lines changed

4 files changed

+97
-1
lines changed

source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETCore.approved.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3578,6 +3578,31 @@ Octopus.Client.Model
35783578
{
35793579
String Slug { get; set; }
35803580
}
3581+
class InterruptionPullRequestResource
3582+
{
3583+
.ctor()
3584+
String Id { get; set; }
3585+
String InterruptionId { get; set; }
3586+
Int64 Number { get; set; }
3587+
String RepositoryUrl { get; set; }
3588+
Octopus.Client.Model.InterruptionPullRequestStatus Status { get; set; }
3589+
String Title { get; set; }
3590+
String Url { get; set; }
3591+
}
3592+
class InterruptionPullRequestStatus
3593+
IEquatable<InterruptionPullRequestStatus>
3594+
{
3595+
static Octopus.Client.Model.InterruptionPullRequestStatus Closed
3596+
static Octopus.Client.Model.InterruptionPullRequestStatus Merged
3597+
static Octopus.Client.Model.InterruptionPullRequestStatus Open
3598+
static Octopus.Client.Model.InterruptionPullRequestStatus Unknown
3599+
static Octopus.Client.Model.InterruptionPullRequestStatus UnknownGitVendor
3600+
.ctor(String)
3601+
Boolean Equals(Octopus.Client.Model.InterruptionPullRequestStatus)
3602+
Boolean Equals(Object)
3603+
Int32 GetHashCode()
3604+
String ToString()
3605+
}
35813606
class InterruptionResource
35823607
Octopus.Client.Extensibility.IResource
35833608
Octopus.Client.Model.IAuditedResource
@@ -3592,6 +3617,7 @@ Octopus.Client.Model
35923617
Boolean HasResponsibility { get; set; }
35933618
Boolean IsLinkedToOtherInterruption { get; set; }
35943619
Boolean IsPending { get; set; }
3620+
List<InterruptionPullRequestResource> PullRequests { get; set; }
35953621
Octopus.Client.Model.ReferenceCollection RelatedDocumentIds { get; set; }
35963622
Octopus.Client.Model.ReferenceCollection ResponsibleTeamIds { get; set; }
35973623
String ResponsibleUserId { get; set; }
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace Octopus.Client.Model;
2+
3+
public class InterruptionPullRequestResource
4+
{
5+
public string Id { get; set; }
6+
7+
public string InterruptionId { get; set; }
8+
public string RepositoryUrl { get; set; }
9+
public string Url { get; set; }
10+
public string Title { get; set; }
11+
public long Number { get; set; }
12+
public InterruptionPullRequestStatus Status { get; set; }
13+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#nullable enable
2+
using System;
3+
4+
namespace Octopus.Client.Model;
5+
6+
public class InterruptionPullRequestStatus(string value) : IEquatable<InterruptionPullRequestStatus>
7+
{
8+
public static readonly InterruptionPullRequestStatus Unknown = new ("Unknown");
9+
public static readonly InterruptionPullRequestStatus Open = new ("Open");
10+
public static readonly InterruptionPullRequestStatus Merged = new ("Merged");
11+
public static readonly InterruptionPullRequestStatus Closed = new ("Closed");
12+
public static readonly InterruptionPullRequestStatus UnknownGitVendor = new ("UnknownGitVendor");
13+
14+
string Value { get; } = value;
15+
16+
public bool Equals(InterruptionPullRequestStatus? other)
17+
{
18+
if ((object?)other is null)
19+
{
20+
return false;
21+
}
22+
return Value == other.Value;
23+
}
24+
25+
public override bool Equals(object? obj)
26+
{
27+
if (obj is null)
28+
{
29+
return false;
30+
}
31+
32+
if (ReferenceEquals(this, obj))
33+
{
34+
return true;
35+
}
36+
37+
if (obj.GetType() != GetType())
38+
{
39+
return false;
40+
}
41+
42+
return Equals((InterruptionPullRequestStatus)obj);
43+
}
44+
45+
public static bool operator ==(InterruptionPullRequestStatus left, InterruptionPullRequestStatus right) => Equals(left, right);
46+
public static bool operator !=(InterruptionPullRequestStatus left, InterruptionPullRequestStatus right) => !(left == right);
47+
48+
public override int GetHashCode() => (Value != null ? Value.GetHashCode() : 0);
49+
50+
public override string ToString() => Value;
51+
}

source/Octopus.Server.Client/Model/InterruptionResource.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using Newtonsoft.Json;
34
using Octopus.Client.Extensibility;
45
using Octopus.Client.Model.Forms;
@@ -105,5 +106,10 @@ public InterruptionType Type
105106
public bool IsLinkedToOtherInterruption { get; set; }
106107

107108
public string SpaceId { get; set; }
109+
110+
/// <summary>
111+
/// Gets or sets a list of pull requests associated with this interruption. This will only be populated when <see cref="Type"/> is <see cref="InterruptionType.PullRequestCompletion"/>.
112+
/// </summary>
113+
public List<InterruptionPullRequestResource> PullRequests { get; set; }
108114
}
109-
}
115+
}

0 commit comments

Comments
 (0)