Exemplo n.º 1
0
 public TagsResource(string accountName, string repoSlugOrName, RepositoriesEndPoint repositoriesEndPoint)
     : this(repositoriesEndPoint.RepositoriesResource(accountName).RepositoryResource(repoSlugOrName))
 {
 }
Exemplo n.º 2
0
 public RepositoriesAccountResource(
     ISharpBucketRequesterV2 sharpBucketV2, string accountName, RepositoriesEndPoint repositoriesEndPoint)
     : this(repositoriesEndPoint, accountName)
 {
 }
Exemplo n.º 3
0
 internal RepositoriesAccountResource(
     RepositoriesEndPoint repositoriesEndPoint, string accountName)
     : base(repositoriesEndPoint, accountName.GuidOrValue())
 {
     this.AccountName = accountName;
 }
Exemplo n.º 4
0
 public RepositoryResource(string accountName, string repoSlugOrName, RepositoriesEndPoint repositoriesEndPoint)
 {
     _slug                 = repoSlugOrName.ToSlug();
     _accountName          = accountName.GuidOrValue();
     _repositoriesEndPoint = repositoriesEndPoint;
 }
Exemplo n.º 5
0
 public PullRequestResource(string accountName, string repository, int pullRequestId, RepositoriesEndPoint repositoriesEndPoint)
 {
     _accountName          = accountName;
     _repository           = repository;
     _repositoriesEndPoint = repositoriesEndPoint;
     _pullRequestId        = pullRequestId;
 }
Exemplo n.º 6
0
 public RepositoryResource(string accountName, string repository, RepositoriesEndPoint repositoriesEndPoint)
 {
     _repository           = repository;
     _accountName          = accountName;
     _repositoriesEndPoint = repositoriesEndPoint;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Gets the metadata of a specified sub path in this resource.
 /// <remarks>
 /// Since it can be difficult to guess which field is filled or not in a <see cref="TreeEntry"/>,
 /// we suggest you to use <see cref="GetSrcEntry"/> method instead of that one,
 /// except if you really want to retrieve the raw model as returned by BitBucket.
 /// </remarks>
 /// </summary>
 /// <param name="subPath">The path to the file or directory, or null to retrieve the metadata of the root of this resource.</param>
 public async Task <TreeEntry> GetTreeEntryAsync(string subPath = null)
 {
     return(await RepositoriesEndPoint.GetTreeEntryAsync(SrcPath.Value, subPath));
 }
Exemplo n.º 8
0
 /// <summary>
 /// Gets the raw content of the specified file.
 /// </summary>
 /// <param name="filePath">The path to a file relative to the root of this resource.</param>
 public string GetFileContent(string filePath)
 {
     return(RepositoriesEndPoint.GetFileContent(SrcPath.Value, filePath));
 }
Exemplo n.º 9
0
 private SrcResource(RepositoriesEndPoint repositoriesEndPoint, string srcPath, string subDirPath)
 {
     RepositoriesEndPoint = repositoriesEndPoint;
     SrcPath = new Lazy <string>(() => UrlHelper.ConcatPathSegments(srcPath, subDirPath).EnsureEndsWith('/'));
 }
Exemplo n.º 10
0
 public PullRequestResource(string accountName, string repoSlugOrName, int pullRequestId, RepositoriesEndPoint repositoriesEndPoint)
     : this(
         repositoriesEndPoint.RepositoryResource(accountName, repoSlugOrName).PullRequestsResource(),
         pullRequestId)
 {
 }
Exemplo n.º 11
0
 /// <summary>
 /// Gets the metadata of a specified sub path in this resource.
 /// <remarks>
 /// Since it can be difficult to guess which field is filled or not in a <see cref="TreeEntry"/>,
 /// we suggest you to use <see cref="GetSrcEntry"/> method instead of that one,
 /// except if you really want to retrieve the raw model as returned by BitBucket.
 /// </remarks>
 /// </summary>
 /// <param name="subPath">The path to the file or directory, or null to retrieve the metadata of the root of this resource.</param>
 public TreeEntry GetTreeEntry(string subPath = null)
 {
     return(RepositoriesEndPoint.GetTreeEntry(SrcPath.Value, subPath));
 }
Exemplo n.º 12
0
 public SrcResource(RepositoriesEndPoint repositoriesEndPoint, string accountName, string repoSlugOrName, string revision = null, string path = null)
     : this(repositoriesEndPoint.RepositoriesResource(accountName).RepositoryResource(repoSlugOrName), revision, path)
 {
 }
 public void Init()
 {
     sharpBucket = TestHelpers.GetV2ClientAuthenticatedWithBasicAuthentication();
      repositoriesEndPoint = sharpBucket.RepositoriesEndPoint();
 }
Exemplo n.º 14
0
 /// <summary>
 /// Gets the raw content of the specified file.
 /// </summary>
 /// <param name="filePath">The path to a file relative to the root of this resource.</param>
 public async Task <string> GetFileContentAsync(string filePath)
 {
     return(await RepositoriesEndPoint.GetFileContentAsync(SrcPath.Value, filePath));
 }
 public PullRequestsResource(string accountName, string repository, RepositoriesEndPoint repositoriesEndPoint)
 {
     _accountName = accountName;
      _repository = repository;
      _repositoriesEndPoint = repositoriesEndPoint;
 }
Exemplo n.º 16
0
 /// <summary>
 /// List the tree entries that are present at the root of this resource, or in the specified sub directory.
 /// <remarks>
 /// Since it can be difficult to guess which field is filled or not in a <see cref="TreeEntry"/>,
 /// we suggest you to use <see cref="ListSrcEntries"/> method instead of that one,
 /// except if you really want to retrieve the raw model as returned by BitBucket.
 /// </remarks>
 /// </summary>
 /// <param name="subDirPath">The path to a sub directory, or null to list the root directory of this resource.</param>
 /// <param name="listParameters">Parameters for the query.</param>
 public List <TreeEntry> ListTreeEntries(string subDirPath = null, ListParameters listParameters = null)
 {
     return(RepositoriesEndPoint.ListTreeEntries(SrcPath.Value, subDirPath, listParameters));
 }
Exemplo n.º 17
0
 public PullRequestsResource(string accountName, string repoSlugOrName, RepositoriesEndPoint repositoriesEndPoint)
     : base(
         repositoriesEndPoint,
         $"{accountName.GuidOrValue()}/{repoSlugOrName.ToSlug()}/pullrequests")
 {
 }
Exemplo n.º 18
0
 public PullRequestResource(string accountName, string repoSlugOrName, int pullRequestId, RepositoriesEndPoint repositoriesEndPoint)
 {
     _accountName          = accountName.GuidOrValue();
     _slug                 = repoSlugOrName.ToSlug();
     _repositoriesEndPoint = repositoriesEndPoint;
     _pullRequestId        = pullRequestId;
 }
Exemplo n.º 19
0
 public PullRequestsResource(string accountName, string repository, RepositoriesEndPoint repositoriesEndPoint)
 {
     _accountName          = accountName;
     _repository           = repository;
     _repositoriesEndPoint = repositoriesEndPoint;
 }
 public RepositoryResource(string accountName, string repository, RepositoriesEndPoint repositoriesEndPoint)
 {
     _repository = repository;
     _accountName = accountName;
     _repositoriesEndPoint = repositoriesEndPoint;
 }