import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import { setPaginationParams } from "../helpers";
export class LCDQueryClient {
  constructor({
    requestClient
  }) {
    _defineProperty(this, "req", void 0);
    this.req = requestClient;
    this.params = this.params.bind(this);
    this.vestedAmount = this.vestedAmount.bind(this);
    this.task = this.task.bind(this);
    this.taskAll = this.taskAll.bind(this);
    this.branchAll = this.branchAll.bind(this);
    this.repositoryBranch = this.repositoryBranch.bind(this);
    this.repositoryBranchSha = this.repositoryBranchSha.bind(this);
    this.repositoryBranchAll = this.repositoryBranchAll.bind(this);
    this.tagAll = this.tagAll.bind(this);
    this.repositoryTag = this.repositoryTag.bind(this);
    this.repositoryTagSha = this.repositoryTagSha.bind(this);
    this.repositoryTagAll = this.repositoryTagAll.bind(this);
    this.daoMember = this.daoMember.bind(this);
    this.daoMemberAll = this.daoMemberAll.bind(this);
    this.memberAll = this.memberAll.bind(this);
    this.bounty = this.bounty.bind(this);
    this.bountyAll = this.bountyAll.bind(this);
    this.release = this.release.bind(this);
    this.releaseAll = this.releaseAll.bind(this);
    this.pullRequestAll = this.pullRequestAll.bind(this);
    this.dao = this.dao.bind(this);
    this.daoAll = this.daoAll.bind(this);
    this.issueComment = this.issueComment.bind(this);
    this.pullRequestComment = this.pullRequestComment.bind(this);
    this.commentAll = this.commentAll.bind(this);
    this.issueCommentAll = this.issueCommentAll.bind(this);
    this.pullRequestCommentAll = this.pullRequestCommentAll.bind(this);
    this.issueAll = this.issueAll.bind(this);
    this.repositoryReleaseLatest = this.repositoryReleaseLatest.bind(this);
    this.repositoryRelease = this.repositoryRelease.bind(this);
    this.repositoryReleaseAll = this.repositoryReleaseAll.bind(this);
    this.repositoryIssue = this.repositoryIssue.bind(this);
    this.repositoryIssueAll = this.repositoryIssueAll.bind(this);
    this.repositoryPullRequest = this.repositoryPullRequest.bind(this);
    this.repositoryPullRequestAll = this.repositoryPullRequestAll.bind(this);
    this.repository = this.repository.bind(this);
    this.repositoryAll = this.repositoryAll.bind(this);
    this.forkAll = this.forkAll.bind(this);
    this.user = this.user.bind(this);
    this.userDaoAll = this.userDaoAll.bind(this);
    this.userAll = this.userAll.bind(this);
    this.anyRepositoryAll = this.anyRepositoryAll.bind(this);
    this.anyRepository = this.anyRepository.bind(this);
    this.whois = this.whois.bind(this);
    this.whoisAll = this.whoisAll.bind(this);
    this.pullRequestMergePermission = this.pullRequestMergePermission.bind(this);
    this.checkGitServerAuthorization = this.checkGitServerAuthorization.bind(this);
    this.checkStorageProviderAuthorization = this.checkStorageProviderAuthorization.bind(this);
  }
  /* Params returns the total set of gitopia parameters. */
  async params(_params = {}) {
    const endpoint = `gitopia/gitopia/gitopia/params`;
    return await this.req.get(endpoint);
  }
  /* query vested amount for developer address */
  async vestedAmount(params) {
    const endpoint = `gitopia/gitopia/gitopia/vestedAmount/${params.address}`;
    return await this.req.get(endpoint);
  }
  /* Queries a Task by id. */
  async task(params) {
    const endpoint = `gitopia/gitopia/gitopia/task/${params.id}`;
    return await this.req.get(endpoint);
  }
  /* Queries a list of Task items. */
  async taskAll(params = {
    pagination: undefined
  }) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/task`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a list of Branch items. */
  async branchAll(params = {
    pagination: undefined
  }) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/branch`;
    return await this.req.get(endpoint, options);
  }
  /* Queries Repository Branch by name. */
  async repositoryBranch(params) {
    const endpoint = `gitopia/gitopia/gitopia/${params.id}/repository/${params.repositoryName}/branch/${params.branchName}`;
    return await this.req.get(endpoint);
  }
  /* RepositoryBranchSha */
  async repositoryBranchSha(params) {
    const endpoint = `gitopia/gitopia/gitopia/${params.id}/repository/${params.repositoryName}/branch/${params.branchName}/sha`;
    return await this.req.get(endpoint);
  }
  /* Queries a list of Repository Branch. */
  async repositoryBranchAll(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/${params.id}/repository/${params.repositoryName}/branch`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a list of Tag items. */
  async tagAll(params = {
    pagination: undefined
  }) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/tag`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a Repository Tag by id. */
  async repositoryTag(params) {
    const endpoint = `gitopia/gitopia/gitopia/${params.id}/repository/${params.repositoryName}/tag/${params.tagName}`;
    return await this.req.get(endpoint);
  }
  /* RepositoryTagSha */
  async repositoryTagSha(params) {
    const endpoint = `gitopia/gitopia/gitopia/${params.id}/repository/${params.repositoryName}/tag/${params.tagName}/sha`;
    return await this.req.get(endpoint);
  }
  /* Queries a list of Repository Tag. */
  async repositoryTagAll(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/${params.id}/repository/${params.repositoryName}/tag`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a Member by id. */
  async daoMember(params) {
    const endpoint = `gitopia/gitopia/gitopia/dao/${params.daoId}/member/${params.userId}`;
    return await this.req.get(endpoint);
  }
  /* Queries a list of Dao Member. */
  async daoMemberAll(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/dao/${params.daoId}/member`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a list of Member items. */
  async memberAll(params = {
    pagination: undefined
  }) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/member`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a Bounty by id. */
  async bounty(params) {
    const endpoint = `gitopia/gitopia/gitopia/bounty/${params.id}`;
    return await this.req.get(endpoint);
  }
  /* Queries a list of Bounty items. */
  async bountyAll(params = {
    pagination: undefined
  }) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/bounty`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a release by id. */
  async release(params) {
    const endpoint = `gitopia/gitopia/gitopia/release/${params.id}`;
    return await this.req.get(endpoint);
  }
  /* Queries a list of release items. */
  async releaseAll(params = {
    pagination: undefined
  }) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/release`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a list of pullRequest items. */
  async pullRequestAll(params = {
    pagination: undefined
  }) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/pullRequest`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a Dao by id. */
  async dao(params) {
    const endpoint = `gitopia/gitopia/gitopia/dao/${params.id}`;
    return await this.req.get(endpoint);
  }
  /* Queries a list of Dao items. */
  async daoAll(params = {
    pagination: undefined
  }) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/dao`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a issue comment. */
  async issueComment(params) {
    const endpoint = `gitopia/gitopia/gitopia/repository/${params.repositoryId}/issue/${params.issueIid}/comment/${params.commentIid}`;
    return await this.req.get(endpoint);
  }
  /* Queries a pullrequest comment. */
  async pullRequestComment(params) {
    const endpoint = `gitopia/gitopia/gitopia/repository/${params.repositoryId}/pullrequest/${params.pullRequestIid}/comment/${params.commentIid}`;
    return await this.req.get(endpoint);
  }
  /* Queries a list of comment. */
  async commentAll(params = {
    pagination: undefined
  }) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/comment`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a list of issue comment. */
  async issueCommentAll(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/repository/${params.repositoryId}/issue/${params.issueIid}/comment`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a list of pullrequest comment. */
  async pullRequestCommentAll(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/repository/${params.repositoryId}/pullrequest/${params.pullRequestIid}/comment`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a list of issue items. */
  async issueAll(params = {
    pagination: undefined
  }) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/issue`;
    return await this.req.get(endpoint, options);
  }
  /* RepositoryReleaseLatest */
  async repositoryReleaseLatest(params) {
    const endpoint = `gitopia/gitopia/gitopia/${params.id}/repository/${params.repositoryName}/releases/latest`;
    return await this.req.get(endpoint);
  }
  /* RepositoryRelease */
  async repositoryRelease(params) {
    const endpoint = `gitopia/gitopia/gitopia/${params.id}/repository/${params.repositoryName}/releases/tag/${params.tagName}`;
    return await this.req.get(endpoint);
  }
  /* RepositoryReleaseAll */
  async repositoryReleaseAll(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/${params.id}/repository/${params.repositoryName}/releases`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a repository issue by iid. */
  async repositoryIssue(params) {
    const endpoint = `gitopia/gitopia/gitopia/${params.id}/${params.repositoryName}/issue/${params.issueIid}`;
    return await this.req.get(endpoint);
  }
  /* Queries a list of repository issue. */
  async repositoryIssueAll(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.option) !== "undefined") {
      options.params.option = params.option;
    }
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/${params.id}/${params.repositoryName}/issue`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a repository pullRequest. */
  async repositoryPullRequest(params) {
    const endpoint = `gitopia/gitopia/gitopia/${params.id}/${params.repositoryName}/pull/${params.pullIid}`;
    return await this.req.get(endpoint);
  }
  /* Queries a list of repository pullRequest. */
  async repositoryPullRequestAll(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.option) !== "undefined") {
      options.params.option = params.option;
    }
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/${params.id}/${params.repositoryName}/pull`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a repository by id. */
  async repository(params) {
    const endpoint = `gitopia/gitopia/gitopia/repository/${params.id}`;
    return await this.req.get(endpoint);
  }
  /* Queries a list of repository items. */
  async repositoryAll(params = {
    pagination: undefined
  }) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/repository`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a repository forks by id. */
  async forkAll(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/${params.id}/repository/${params.repositoryName}/forks`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a user by id. */
  async user(params) {
    const endpoint = `gitopia/gitopia/gitopia/user/${params.id}`;
    return await this.req.get(endpoint);
  }
  /* Queries a list of User Dao. */
  async userDaoAll(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/user/${params.userId}/dao`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a list of user items. */
  async userAll(params = {
    pagination: undefined
  }) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/user`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a list of user repositories. */
  async anyRepositoryAll(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/user/${params.id}/repository`;
    return await this.req.get(endpoint, options);
  }
  /* Queries a repository by user id and repository name */
  async anyRepository(params) {
    const endpoint = `gitopia/gitopia/gitopia/user/${params.id}/repository/${params.repositoryName}`;
    return await this.req.get(endpoint);
  }
  /* Queries a whois by id. */
  async whois(params) {
    const endpoint = `gitopia/gitopia/gitopia/whois/${params.name}`;
    return await this.req.get(endpoint);
  }
  /* Queries a list of whois items. */
  async whoisAll(params = {
    pagination: undefined
  }) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
      setPaginationParams(options, params.pagination);
    }
    const endpoint = `gitopia/gitopia/gitopia/whois`;
    return await this.req.get(endpoint, options);
  }
  /* PullRequestMergePermission */
  async pullRequestMergePermission(params) {
    const endpoint = `gitopia/gitopia/gitopia/permissions/${params.userId}/repository/${params.repositoryId}/pull/${params.pullIid}/merge`;
    return await this.req.get(endpoint);
  }
  /* CheckGitServerAuthorization */
  async checkGitServerAuthorization(params) {
    const endpoint = `gitopia/gitopia/gitopia/authorizations/git-server/${params.userAddress}/${params.providerAddress}`;
    return await this.req.get(endpoint);
  }
  /* CheckStorageProviderAuthorization */
  async checkStorageProviderAuthorization(params) {
    const endpoint = `gitopia/gitopia/gitopia/authorizations/storage-provider/${params.userAddress}/${params.providerAddress}`;
    return await this.req.get(endpoint);
  }
}