GitHubGateway
Assembly: ServiceStack.Common.dll
Declaration
public class GitHubGateway : IGitHubGateway, IGistGateway
Properties
UserAgent
Declaration
public string UserAgent { get; set; }
BaseUrl
Declaration
public string BaseUrl { get; set; }
AccessToken
AccessTokenSecret
Declaration
public string AccessToken { get; set; }
GetJsonFilter
Intercept and override GitHub JSON API requests
Declaration
public Func<string, string> GetJsonFilter { get; set; }
Fields
ApiBaseUrl
Declaration
public const string ApiBaseUrl = "https://api.github.com/"
Methods
GetRateLimitsAsync()
Declaration
public async Task<GithubRateLimits> GetRateLimitsAsync()
Returns
System.Threading.Tasks.Task<ServiceStack.GithubRateLimits>
GetRateLimits()
Declaration
public GithubRateLimits GetRateLimits()
Returns
ServiceStack.GithubRateLimits
AssertRepo(String[], String, Boolean)
Declaration
public virtual Tuple<string, string> AssertRepo(string[] orgs, string name, bool useFork = false)
Returns
System.Tuple<System.String,System.String>
Parameters
Type | Name |
---|
System.String[] | orgs |
System.String | name |
System.Boolean | useFork |
FindRepo(String[], String, Boolean)
Declaration
public virtual Tuple<string, string> FindRepo(string[] orgs, string name, bool useFork = false)
Returns
System.Tuple<System.String,System.String>
Parameters
Type | Name |
---|
System.String[] | orgs |
System.String | name |
System.Boolean | useFork |
GetSourceZipUrl(String, String)
Declaration
public virtual string GetSourceZipUrl(string user, string repo)
Returns
System.String
Parameters
Type | Name |
---|
System.String | user |
System.String | repo |
GetSourceZipUrl(String, String, String)
Declaration
public virtual string GetSourceZipUrl(string user, string repo, string tag)
Returns
System.String
Parameters
Type | Name |
---|
System.String | user |
System.String | repo |
System.String | tag |
GetSourceZipUrlAsync(String, String)
Declaration
public virtual async Task<string> GetSourceZipUrlAsync(string user, string repo)
Returns
System.Threading.Tasks.Task<System.String>
Parameters
Type | Name |
---|
System.String | user |
System.String | repo |
GetSourceReposAsync(String)
Declaration
public virtual async Task<List<GithubRepo>> GetSourceReposAsync(string orgName)
Returns
System.Threading.Tasks.Task<System.Collections.Generic.List<ServiceStack.GithubRepo>>
Parameters
Type | Name |
---|
System.String | orgName |
GetUserAndOrgReposAsync(String)
Declaration
public virtual async Task<List<GithubRepo>> GetUserAndOrgReposAsync(string githubOrgOrUser)
Returns
System.Threading.Tasks.Task<System.Collections.Generic.List<ServiceStack.GithubRepo>>
Parameters
Type | Name |
---|
System.String | githubOrgOrUser |
GetRepo(String, String)
Declaration
public virtual GithubRepo GetRepo(string userOrOrg, string repo)
Returns
ServiceStack.GithubRepo
Parameters
Type | Name |
---|
System.String | userOrOrg |
System.String | repo |
GetRepoAsync(String, String)
Declaration
public virtual Task<GithubRepo> GetRepoAsync(string userOrOrg, string repo)
Returns
System.Threading.Tasks.Task<ServiceStack.GithubRepo>
Parameters
Type | Name |
---|
System.String | userOrOrg |
System.String | repo |
GetUserRepos(String)
Declaration
public virtual List<GithubRepo> GetUserRepos(string githubUser)
Returns
System.Collections.Generic.List<ServiceStack.GithubRepo>
Parameters
Type | Name |
---|
System.String | githubUser |
GetUserReposAsync(String)
Declaration
public virtual async Task<List<GithubRepo>> GetUserReposAsync(string githubUser)
Returns
System.Threading.Tasks.Task<System.Collections.Generic.List<ServiceStack.GithubRepo>>
Parameters
Type | Name |
---|
System.String | githubUser |
GetOrgRepos(String)
Declaration
public virtual List<GithubRepo> GetOrgRepos(string githubOrg)
Returns
System.Collections.Generic.List<ServiceStack.GithubRepo>
Parameters
Type | Name |
---|
System.String | githubOrg |
GetOrgReposAsync(String)
Declaration
public virtual async Task<List<GithubRepo>> GetOrgReposAsync(string githubOrg)
Returns
System.Threading.Tasks.Task<System.Collections.Generic.List<ServiceStack.GithubRepo>>
Parameters
Type | Name |
---|
System.String | githubOrg |
GetJson(String)
Declaration
public virtual string GetJson(string route)
Returns
System.String
Parameters
Type | Name |
---|
System.String | route |
GetJson<T>(String)
Declaration
public virtual T GetJson<T>(string route)
Returns
<T>
Parameters
Type | Name |
---|
System.String | route |
Type Parameters
GetJsonAsync(String)
Declaration
public virtual async Task<string> GetJsonAsync(string route)
Returns
System.Threading.Tasks.Task<System.String>
Parameters
Type | Name |
---|
System.String | route |
GetJsonAsync<T>(String)
Declaration
public virtual async Task<T> GetJsonAsync<T>(string route)
Returns
System.Threading.Tasks.Task<<T>>
Parameters
Type | Name |
---|
System.String | route |
Type Parameters
StreamJsonCollection<T>(String)
Declaration
public virtual IEnumerable<T> StreamJsonCollection<T>(string route)
Returns
System.Collections.Generic.IEnumerable<<T>>
Parameters
Type | Name |
---|
System.String | route |
Type Parameters
GetJsonCollectionAsync<T>(String)
Declaration
public virtual async Task<List<T>> GetJsonCollectionAsync<T>(string route)
Returns
System.Threading.Tasks.Task<System.Collections.Generic.List<<T>>>
Parameters
Type | Name |
---|
System.String | route |
Type Parameters
ParseLinkUrls(String)
Declaration
public virtual Dictionary<string, string> ParseLinkUrls(string linkHeader)
Returns
System.Collections.Generic.Dictionary<System.String,System.String>
Parameters
Type | Name |
---|
System.String | linkHeader |
DownloadFile(String, String)
Declaration
public virtual void DownloadFile(string downloadUrl, string fileName)
Parameters
Type | Name |
---|
System.String | downloadUrl |
System.String | fileName |
GetGithubGist(String)
Declaration
public virtual GithubGist GetGithubGist(string gistId)
Returns
ServiceStack.GithubGist
Parameters
Type | Name |
---|
System.String | gistId |
GetGithubGist(String, String)
Declaration
public virtual GithubGist GetGithubGist(string gistId, string version)
Returns
ServiceStack.GithubGist
Parameters
Type | Name |
---|
System.String | gistId |
System.String | version |
GetGist(String)
Declaration
public virtual Gist GetGist(string gistId)
Returns
ServiceStack.Gist
Parameters
Type | Name |
---|
System.String | gistId |
GetGist(String, String)
Declaration
public Gist GetGist(string gistId, string version)
Returns
ServiceStack.Gist
Parameters
Type | Name |
---|
System.String | gistId |
System.String | version |
GetGistAsync(String)
Declaration
public async Task<Gist> GetGistAsync(string gistId)
Returns
System.Threading.Tasks.Task<ServiceStack.Gist>
Parameters
Type | Name |
---|
System.String | gistId |
GetGistAsync(String, String)
Declaration
public async Task<Gist> GetGistAsync(string gistId, string version)
Returns
System.Threading.Tasks.Task<ServiceStack.Gist>
Parameters
Type | Name |
---|
System.String | gistId |
System.String | version |
CreateGist(String, Boolean, Dictionary<String, Object>)
Declaration
public virtual Gist CreateGist(string description, bool isPublic, Dictionary<string, object> files)
Returns
ServiceStack.Gist
Parameters
Type | Name |
---|
System.String | description |
System.Boolean | isPublic |
System.Collections.Generic.Dictionary<System.String,System.Object> | files |
CreateGist(String, Boolean, Dictionary<String, String>)
Declaration
public virtual Gist CreateGist(string description, bool isPublic, Dictionary<string, string> textFiles)
Returns
ServiceStack.Gist
Parameters
Type | Name |
---|
System.String | description |
System.Boolean | isPublic |
System.Collections.Generic.Dictionary<System.String,System.String> | textFiles |
CreateGithubGist(String, Boolean, Dictionary<String, Object>)
Declaration
public virtual GithubGist CreateGithubGist(string description, bool isPublic, Dictionary<string, object> files)
Returns
ServiceStack.GithubGist
Parameters
Type | Name |
---|
System.String | description |
System.Boolean | isPublic |
System.Collections.Generic.Dictionary<System.String,System.Object> | files |
CreateGithubGist(String, Boolean, Dictionary<String, String>)
Declaration
public virtual GithubGist CreateGithubGist(string description, bool isPublic, Dictionary<string, string> textFiles)
Returns
ServiceStack.GithubGist
Parameters
Type | Name |
---|
System.String | description |
System.Boolean | isPublic |
System.Collections.Generic.Dictionary<System.String,System.String> | textFiles |
IsDirSep(Char)
Declaration
public static bool IsDirSep(char c)
Returns
System.Boolean
Parameters
ToTextFiles(Dictionary<String, Object>)
Declaration
public static Dictionary<string, string> ToTextFiles(Dictionary<string, object> files)
Returns
System.Collections.Generic.Dictionary<System.String,System.String>
Parameters
Type | Name |
---|
System.Collections.Generic.Dictionary<System.String,System.Object> | files |
WriteGistFiles(String, Dictionary<String, Object>, String, Boolean)
Declaration
public virtual void WriteGistFiles(string gistId, Dictionary<string, object> files, string description = null, bool deleteMissing = false)
Parameters
Type | Name |
---|
System.String | gistId |
System.Collections.Generic.Dictionary<System.String,System.Object> | files |
System.String | description |
System.Boolean | deleteMissing |
WriteGistFiles(String, Dictionary<String, String>, String, Boolean)
Create or Write Gist Text Files. Requires AccessToken
Declaration
public virtual void WriteGistFiles(string gistId, Dictionary<string, string> textFiles, string description = null, bool deleteMissing = false)
Parameters
Type | Name |
---|
System.String | gistId |
System.Collections.Generic.Dictionary<System.String,System.String> | textFiles |
System.String | description |
System.Boolean | deleteMissing |
CreateGistFile(String, String, String)
Create new Gist File. Requires AccessToken
Declaration
public virtual void CreateGistFile(string gistId, string filePath, string contents)
Parameters
Type | Name |
---|
System.String | gistId |
System.String | filePath |
System.String | contents |
WriteGistFile(String, String, String)
Create or Write Gist File. Requires AccessToken
Declaration
public virtual void WriteGistFile(string gistId, string filePath, string contents)
Parameters
Type | Name |
---|
System.String | gistId |
System.String | filePath |
System.String | contents |
AssertAccessToken()
Declaration
protected virtual void AssertAccessToken()
DeleteGistFiles(String, String[])
Declaration
public virtual void DeleteGistFiles(string gistId, params string[] filePaths)
Parameters
Type | Name |
---|
System.String | gistId |
System.String[] | filePaths |
ApplyRequestFilters(HttpWebRequest)
Declaration
public virtual void ApplyRequestFilters(HttpWebRequest req)
Parameters
Type | Name |
---|
System.Net.HttpWebRequest | req |
Implements