Files
octokit.net/Octokit/Models/Request/OrganizationCustomPropertyValuesRequest.cs
Colby Williams 9a3177e385 [FEAT]: Custom Properties (#2933)
* add custom properties model and clients

* observable

* observable tests

* add search

* error CS8370: 'target-typed object creation'

* Error CS8370: 'target-typed object creation'

* add patch with body that return status code

* fixes for failed ConventionTests

* working UnitTests

* (de)serialization and model tests

* Update Repository.cs
2024-06-17 15:01:20 -07:00

52 lines
1.6 KiB
C#

using System.Collections.Generic;
using System.Diagnostics;
namespace Octokit
{
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class OrganizationCustomPropertyValuesRequest : SearchRepositoriesRequest
{
/// <summary>
/// Initializes a new instance of the <see cref="OrganizationCustomPropertyValuesRequest"/> class.
/// </summary>
public OrganizationCustomPropertyValuesRequest() : base()
{ }
/// <summary>
/// Initializes a new instance of the <see cref="OrganizationCustomPropertyValuesRequest"/> class.
/// </summary>
public OrganizationCustomPropertyValuesRequest(string term)
: base(term)
{ }
public override string Sort => null;
/// <summary>
/// Get the query parameters that will be appending onto the search
/// </summary>
public new IDictionary<string, string> Parameters
{
get
{
var parameters = base.Parameters;
// Remove the default sort and order parameters as they are not supported by the API
parameters.Remove("order");
parameters.Remove("sort");
// Replace the default query parameter "q" with the custom query parameter
var query = parameters["q"];
if (!string.IsNullOrWhiteSpace(query))
{
parameters.Add("repository_query", query);
}
parameters.Remove("q");
return parameters;
}
}
}
}