Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix namespaces for Artifacts models #2862

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 78 additions & 75 deletions Octokit/Models/Response/Artifact.cs
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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);
}
}
Loading