Skip to content

Commit

Permalink
fix: Fix namespaces for Artifacts models (#2862)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomhurst committed Jan 25, 2024
1 parent edd080b commit c9ddf3e
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 136 deletions.
153 changes: 78 additions & 75 deletions Octokit/Models/Response/Artifact.cs
Expand Up @@ -2,82 +2,85 @@
using System.Diagnostics;
using System.Globalization;

[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class Artifact
namespace Octokit
{
public Artifact()
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class Artifact
{
public Artifact()
{
}

public Artifact(long id, string nodeId, string name, int sizeInBytes, string url, string archiveDownloadUrl, bool expired, DateTime createdAt, DateTime expiresAt, DateTime updatedAt, ArtifactWorkflowRun workflowRun)
{
Id = id;
NodeId = nodeId;
Name = name;
SizeInBytes = sizeInBytes;
Url = url;
ArchiveDownloadUrl = archiveDownloadUrl;
Expired = expired;
CreatedAt = createdAt;
ExpiresAt = expiresAt;
UpdatedAt = updatedAt;
WorkflowRun = workflowRun;
}

/// <summary>
/// The artifact Id
/// </summary>
public long Id { get; private set; }

/// <summary>
/// The artifact node Id
/// </summary>
public string NodeId { get; private set; }

/// <summary>
/// The name of the artifact
/// </summary>
public string Name { get; private set; }

/// <summary>
/// The size of the artifact in bytes
/// </summary>
public int SizeInBytes { get; private set; }

/// <summary>
/// The url for retrieving the artifact information
/// </summary>
public string Url { get; private set; }

/// <summary>
/// The url for downloading the artifact contents
/// </summary>
public string ArchiveDownloadUrl { get; private set; }

/// <summary>
/// True if the artifact has expired
/// </summary>
public bool Expired { get; private set; }

/// <summary>
/// The date and time when the artifact was created
/// </summary>
public DateTime CreatedAt { get; private set; }

/// <summary>
/// The date and time when the artifact expires
/// </summary>
public DateTime ExpiresAt { get; private set; }

/// <summary>
/// The date and time when the artifact was last updated
/// </summary>
public DateTime UpdatedAt { get; private set; }

/// <summary>
/// The workflow from where the artifact was created
/// </summary>
public ArtifactWorkflowRun WorkflowRun { get; private set; }

internal string DebuggerDisplay => string.Format(CultureInfo.InvariantCulture, "Id: {0}", Id);
}

public Artifact(long id, string nodeId, string name, int sizeInBytes, string url, string archiveDownloadUrl, bool expired, DateTime createdAt, DateTime expiresAt, DateTime updatedAt, ArtifactWorkflowRun workflowRun)
{
Id = id;
NodeId = nodeId;
Name = name;
SizeInBytes = sizeInBytes;
Url = url;
ArchiveDownloadUrl = archiveDownloadUrl;
Expired = expired;
CreatedAt = createdAt;
ExpiresAt = expiresAt;
UpdatedAt = updatedAt;
WorkflowRun = workflowRun;
}

/// <summary>
/// The artifact Id
/// </summary>
public long Id { get; private set; }

/// <summary>
/// The artifact node Id
/// </summary>
public string NodeId { get; private set; }

/// <summary>
/// The name of the artifact
/// </summary>
public string Name { get; private set; }

/// <summary>
/// The size of the artifact in bytes
/// </summary>
public int SizeInBytes { get; private set; }

/// <summary>
/// The url for retrieving the artifact information
/// </summary>
public string Url { get; private set; }

/// <summary>
/// The url for downloading the artifact contents
/// </summary>
public string ArchiveDownloadUrl { get; private set; }

/// <summary>
/// True if the artifact has expired
/// </summary>
public bool Expired { get; private set; }

/// <summary>
/// The date and time when the artifact was created
/// </summary>
public DateTime CreatedAt { get; private set; }

/// <summary>
/// The date and time when the artifact expires
/// </summary>
public DateTime ExpiresAt { get; private set; }

/// <summary>
/// The date and time when the artifact was last updated
/// </summary>
public DateTime UpdatedAt { get; private set; }

/// <summary>
/// The workflow from where the artifact was created
/// </summary>
public ArtifactWorkflowRun WorkflowRun { get; private set; }

internal string DebuggerDisplay => string.Format(CultureInfo.InvariantCulture, "Id: {0}", Id);
}
83 changes: 43 additions & 40 deletions Octokit/Models/Response/ArtifactWorkflowRun.cs
@@ -1,46 +1,49 @@
using System.Diagnostics;
using System.Globalization;

[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class ArtifactWorkflowRun
namespace Octokit
{
public ArtifactWorkflowRun()
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class ArtifactWorkflowRun
{
}

public ArtifactWorkflowRun(long id, long repositoryId, long headRepositoryId, string headBranch, string headSha)
{
Id = id;
RepositoryId = repositoryId;
HeadRepositoryId = headRepositoryId;
HeadBranch = headBranch;
HeadSha = headSha;
}
public ArtifactWorkflowRun()
{
}

public ArtifactWorkflowRun(long id, long repositoryId, long headRepositoryId, string headBranch, string headSha)
{
Id = id;
RepositoryId = repositoryId;
HeadRepositoryId = headRepositoryId;
HeadBranch = headBranch;
HeadSha = headSha;
}

/// <summary>
/// The workflow run Id
/// </summary>
public long Id { get; private set; }

/// <summary>
/// The workflow run Id
/// </summary>
public long Id { get; private set; }

/// <summary>
/// The repository Id
/// </summary>
public long RepositoryId { get; private set; }

/// <summary>
/// The head repository Id
/// </summary>
public long HeadRepositoryId { get; private set; }

/// <summary>
/// The head branch
/// </summary>
public string HeadBranch { get; private set; }

/// <summary>
/// The head Sha
/// </summary>
public string HeadSha { get; private set; }

internal string DebuggerDisplay => string.Format(CultureInfo.InvariantCulture, "Id: {0}", Id);
}
/// <summary>
/// The repository Id
/// </summary>
public long RepositoryId { get; private set; }

/// <summary>
/// The head repository Id
/// </summary>
public long HeadRepositoryId { get; private set; }

/// <summary>
/// The head branch
/// </summary>
public string HeadBranch { get; private set; }

/// <summary>
/// The head Sha
/// </summary>
public string HeadSha { get; private set; }

internal string DebuggerDisplay => string.Format(CultureInfo.InvariantCulture, "Id: {0}", Id);
}
}
45 changes: 24 additions & 21 deletions Octokit/Models/Response/ListArtifactsResponse.cs
Expand Up @@ -2,28 +2,31 @@
using System.Diagnostics;
using System.Globalization;

[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class ListArtifactsResponse
namespace Octokit
{
public ListArtifactsResponse()
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class ListArtifactsResponse
{
}

public ListArtifactsResponse(int totalCount, IReadOnlyList<Artifact> artifacts)
{
TotalCount = totalCount;
Artifacts = artifacts;
}
public ListArtifactsResponse()
{
}

public ListArtifactsResponse(int totalCount, IReadOnlyList<Artifact> artifacts)
{
TotalCount = totalCount;
Artifacts = artifacts;
}

/// <summary>
/// The number of artifacts found
/// </summary>
public int TotalCount { get; private set; }

/// <summary>
/// The list of found artifacts
/// </summary>
public IReadOnlyList<Artifact> Artifacts { get; private set; } = new List<Artifact>();

internal string DebuggerDisplay => string.Format(CultureInfo.InvariantCulture, "Artifacts: {0}", TotalCount);
/// <summary>
/// The number of artifacts found
/// </summary>
public int TotalCount { get; private set; }

/// <summary>
/// The list of found artifacts
/// </summary>
public IReadOnlyList<Artifact> Artifacts { get; private set; } = new List<Artifact>();

internal string DebuggerDisplay => string.Format(CultureInfo.InvariantCulture, "Artifacts: {0}", TotalCount);
}
}

0 comments on commit c9ddf3e

Please sign in to comment.