basePath: /api/v1/admin
definitions:
  entity.TenantStatus:
    enum:
    - pending
    - active
    - inactive
    - deleted
    - cleared
    type: string
    x-enum-varnames:
    - TenantStatusPending
    - TenantStatusActive
    - TenantStatusInactive
    - TenantStatusDeleted
    - TenantStatusCleared
  forms.AccessLog:
    properties:
      content:
        type: string
      happened_on:
        type: integer
      id:
        example: "0"
        type: string
      user:
        type: string
    type: object
  forms.Advertising:
    properties:
      body:
        type: string
      heading:
        type: string
      index:
        type: string
    type: object
  forms.CppoOrgReq:
    properties:
      country:
        type: string
      email:
        type: string
      name:
        type: string
    type: object
  forms.CppoOrgResp:
    properties:
      org_id:
        example: "0"
        type: string
    type: object
  forms.CreateAPIKey:
    properties:
      creator_user_id:
        example: "0"
        type: string
      key_name:
        type: string
      tenant_id:
        example: "0"
        type: string
    type: object
  forms.CreateAPIKeyResp:
    properties:
      api_key:
        type: string
    type: object
  forms.CreateMspOrgResp:
    properties:
      org_id:
        example: "0"
        type: string
    type: object
  forms.DbUserDisplay:
    properties:
      builtin_role:
        type: string
      custom_roles:
        items:
          type: string
        type: array
      plugin:
        type: string
      target_type:
        type: string
      target_value:
        type: string
      username:
        type: string
    type: object
  forms.DevTierStats:
    properties:
      aws_active_clusters_count:
        type: integer
      gcp_active_clusters_count:
        type: integer
    type: object
  forms.EmptyResponse:
    type: object
  forms.EnableDevTier:
    properties:
      enable_on_aws:
        type: boolean
      enable_on_gcp:
        type: boolean
    type: object
  forms.GetDashboardStatsResq:
    properties:
      dev_tier:
        $ref: '#/definitions/forms.DevTierStats'
    type: object
  forms.GetDbUserJwtResp:
    properties:
      db_user:
        type: string
      jwt:
        type: string
    type: object
  forms.GetOrgProjectsResp:
    properties:
      items:
        items:
          $ref: '#/definitions/forms.Project'
        type: array
      total:
        type: integer
    type: object
  forms.GetUserOrgsResp:
    properties:
      orgs:
        items:
          $ref: '#/definitions/forms.Tenant'
        type: array
    type: object
  forms.GrantRolePrivilege:
    properties:
      id:
        example: "0"
        type: string
      privilege_ids:
        items:
          type: integer
        type: array
      role_id:
        example: "0"
        type: string
    type: object
  forms.ListAccessLogResp:
    properties:
      items:
        items:
          $ref: '#/definitions/forms.AccessLog'
        type: array
      total:
        type: integer
    type: object
  forms.ListDbUsersRsp:
    properties:
      db_users:
        items:
          $ref: '#/definitions/forms.DbUserDisplay'
        type: array
      in_cluster_db_users:
        items:
          $ref: '#/definitions/forms.DbUserDisplay'
        type: array
    type: object
  forms.ListPrivilegeSystemsResp:
    properties:
      systems:
        items:
          type: string
        type: array
    type: object
  forms.ListRbacPrivilegeResp:
    properties:
      List:
        description: nolint
        items:
          $ref: '#/definitions/forms.RbacPrivilegeResp'
        type: array
      Total:
        description: nolint
        type: integer
    type: object
  forms.ListTenantResp:
    properties:
      items:
        items:
          $ref: '#/definitions/forms.Tenant'
        type: array
      total:
        type: integer
    type: object
  forms.ListUsersResp:
    properties:
      items:
        items:
          $ref: '#/definitions/forms.User'
        type: array
      total:
        type: integer
    type: object
  forms.MCPOResellerOrgReq:
    properties:
      country:
        type: string
      email:
        type: string
      name:
        type: string
    type: object
  forms.MCPOResellerOrgResp:
    properties:
      org_id:
        example: "0"
        type: string
    type: object
  forms.MspOrg:
    properties:
      advertising_arr:
        items:
          $ref: '#/definitions/forms.Advertising'
        type: array
      country:
        type: string
      created_by:
        type: string
      email:
        type: string
      logo_name:
        type: string
      logo_url:
        type: string
      name:
        type: string
      org_id:
        example: "0"
        type: string
      time_zone:
        type: string
      updated_by:
        type: string
      website:
        type: string
    type: object
  forms.OrgRoleReq:
    properties:
      org_role:
        type: string
    required:
    - org_role
    type: object
  forms.PartnerCustomer:
    properties:
      customer_org_id:
        example: "0"
        type: string
      effected_at:
        type: string
      email:
        type: string
      expired_at:
        type: string
      name:
        type: string
      partner_org_id:
        example: "0"
        type: string
      partner_type:
        type: string
      status:
        type: string
    type: object
  forms.PatchTenantReq:
    properties:
      account_manager:
        description: the email address of account manager, must end with @pingcap.com
        type: string
      alias:
        type: string
      email:
        type: string
      is_update_third_party_account_code:
        type: boolean
      is_update_third_party_account_provider:
        type: boolean
      kind:
        enum:
        - internal
        - external
        type: string
      org_tag:
        enum:
        - personal
        - enterprise
        type: string
      org_type:
        type: string
      status:
        allOf:
        - $ref: '#/definitions/entity.TenantStatus'
        enum:
        - pending
        - active
        - inactive
        - deleted
        - cleared
      third_party_account_code:
        type: string
      third_party_account_provider:
        type: string
      third_party_free_trial:
        type: boolean
    type: object
  forms.Project:
    properties:
      active_clusters_count:
        type: integer
      aws_cmek_enabled:
        type: boolean
      created_at:
        $ref: '#/definitions/timestamppb.Timestamp'
      id:
        example: "0"
        type: string
      name:
        type: string
      org_id:
        example: "0"
        type: string
      user_count:
        type: integer
    type: object
  forms.ProjectRoleReq:
    properties:
      project_role:
        type: string
    required:
    - project_role
    type: object
  forms.RbacPrivilege:
    properties:
      description:
        type: string
      id:
        example: "0"
        type: string
      resource_uri:
        type: string
      system:
        type: string
      url:
        type: string
    type: object
  forms.RbacPrivilegeResp:
    properties:
      Description:
        type: string
      ID:
        example: "0"
        type: string
      ResourceUri:
        type: string
      System:
        type: string
      Url:
        type: string
    type: object
  forms.RbacRole:
    properties:
      description:
        type: string
      display_name:
        type: string
      id:
        example: "0"
        type: string
      name:
        type: string
      scope_type:
        type: string
    type: object
  forms.RbacRolePrivilege:
    properties:
      id:
        example: "0"
        type: string
      privilege_id:
        example: "0"
        type: string
      role_id:
        example: "0"
        type: string
    type: object
  forms.RbacRoleResp:
    properties:
      Description:
        type: string
      DisplayName:
        type: string
      ID:
        example: "0"
        type: string
      Name:
        type: string
      ScopeType:
        type: string
    type: object
  forms.ResellerOrgReq:
    properties:
      country:
        type: string
      email:
        type: string
      name:
        type: string
    type: object
  forms.ResellerOrgResp:
    properties:
      org_id:
        example: "0"
        type: string
    type: object
  forms.ResourceResult:
    properties:
      backup_num:
        type: integer
      cluster_num:
        type: integer
      is_have_resource:
        type: boolean
      resources_msg:
        type: string
      vpc_peering_num:
        type: integer
    type: object
  forms.SystemSettings:
    properties:
      enable_dev_tier:
        $ref: '#/definitions/forms.EnableDevTier'
    type: object
  forms.Tenant:
    properties:
      account_manager:
        type: string
      alias:
        type: string
      country:
        type: string
      created_at:
        type: integer
      discount:
        type: integer
      discount_description:
        type: string
      email:
        type: string
      has_discount:
        type: boolean
      id:
        example: "0"
        type: string
      kind:
        type: string
      name:
        type: string
      org_tag:
        type: string
      org_type:
        type: string
      plan:
        type: string
      remaining_credit:
        type: integer
      status:
        type: string
      third_party_account_code:
        type: string
      third_party_account_provider:
        type: string
      timezone:
        type: integer
      total_credit:
        type: integer
    type: object
  forms.TestDbUserJwtReq:
    properties:
      db_user:
        type: string
      jwt:
        type: string
    type: object
  forms.TestDbUserReq:
    properties:
      cluster_id:
        type: integer
      target_type:
        type: string
      target_value:
        type: string
      test_db_user_type:
        type: string
    type: object
  forms.UploadMspLogo:
    properties:
      file:
        $ref: '#/definitions/multipart.FileHeader'
    required:
    - file
    type: object
  forms.UploadMspLogoResp:
    properties:
      logo_name:
        type: string
      logo_url:
        type: string
    type: object
  forms.User:
    properties:
      email:
        type: string
      first_name:
        type: string
      id:
        example: "0"
        type: string
      last_name:
        type: string
      login_time:
        $ref: '#/definitions/timestamppb.Timestamp'
      phone_number:
        type: string
      status:
        type: string
    type: object
  multipart.FileHeader:
    properties:
      filename:
        type: string
      header:
        $ref: '#/definitions/textproto.MIMEHeader'
      size:
        format: int64
        type: integer
    type: object
  textproto.MIMEHeader:
    additionalProperties:
      items:
        type: string
      type: array
    type: object
  timestamppb.Timestamp:
    properties:
      nanos:
        description: |-
          Non-negative fractions of a second at nanosecond resolution. Negative
          second values with fractions must still have non-negative nanos values
          that count forward in time. Must be from 0 to 999,999,999
          inclusive.
        type: integer
      seconds:
        description: |-
          Represents seconds of UTC time since Unix epoch
          1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
          9999-12-31T23:59:59Z inclusive.
        type: integer
    type: object
host: 127.0.0.1:8080
info:
  contact: {}
  description: This is a management portal server
  title: Management Portal API
  version: "1.0"
paths:
  /access-logs:
    get:
      consumes:
      - application/json
      parameters:
      - in: query
        name: content
        type: string
      - in: query
        name: end_time
        type: integer
      - in: query
        name: org_id
        type: integer
      - in: query
        name: start_time
        type: integer
      - in: query
        name: user
        type: string
      - in: query
        name: page
        type: integer
      - in: query
        name: per_page
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ListAccessLogResp'
      summary: Search Management Portal access logs
      tags:
      - AccessLog
  /api_key:
    post:
      consumes:
      - application/json
      parameters:
      - description: Add API key
        in: body
        name: user
        required: true
        schema:
          $ref: '#/definitions/forms.CreateAPIKey'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.CreateAPIKeyResp'
      summary: Add API Key
      tags:
      - ApiKey
  /clusters/:cluster_id/db-users:
    get:
      consumes:
      - application/json
      parameters:
      - description: cluster_id
        in: path
        name: cluster_id
        required: true
        type: string
      - collectionFormat: csv
        in: query
        items:
          type: string
        name: account_locked
        type: array
      - in: query
        name: cluster_id
        type: integer
      - collectionFormat: csv
        in: query
        items:
          type: string
        name: ignore_users
        type: array
      - in: query
        name: list_dbuser_type
        type: string
      - collectionFormat: csv
        in: query
        items:
          type: string
        name: password_expired
        type: array
      - collectionFormat: csv
        in: query
        items:
          type: string
        name: plugin
        type: array
      - collectionFormat: csv
        in: query
        items:
          type: string
        name: users
        type: array
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ListDbUsersRsp'
      summary: ListDbUsers
      tags:
      - DbUsers
  /clusters/:cluster_id/jwt:
    get:
      consumes:
      - application/json
      parameters:
      - description: cluster_id
        in: path
        name: cluster_id
        required: true
        type: string
      - in: query
        name: target_type
        type: string
      - in: query
        name: target_value
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.GetDbUserJwtResp'
      summary: GetDbUserJwt
      tags:
      - DbUsers
    post:
      consumes:
      - application/json
      parameters:
      - description: TestDbUser
        in: body
        name: DbUsers
        required: true
        schema:
          $ref: '#/definitions/forms.TestDbUserJwtReq'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: TestDbUserJwt
      tags:
      - DbUsers
  /clusters/:cluster_id/test-db-user:
    post:
      consumes:
      - application/json
      parameters:
      - description: TestDbUser
        in: body
        name: DbUsers
        required: true
        schema:
          $ref: '#/definitions/forms.TestDbUserReq'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: TestDbUser
      tags:
      - DbUsers
  /dashboard/stats:
    get:
      consumes:
      - application/json
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.GetDashboardStatsResq'
      summary: GetDashboardStats
      tags:
      - System
  /orgs:
    get:
      consumes:
      - application/json
      parameters:
      - in: query
        name: page
        type: integer
      - in: query
        name: per_page
        type: integer
      - in: query
        name: alias
        type: string
      - in: query
        name: brief
        type: boolean
      - in: query
        name: email
        type: string
      - in: query
        name: id
        type: integer
      - collectionFormat: csv
        in: query
        items:
          type: string
        name: kind
        type: array
      - in: query
        name: name
        type: string
      - in: query
        name: no-limit
        type: boolean
      - description: 'options: asc or desc'
        in: query
        name: order
        type: string
      - description: OrgTag *string  `form:"org_tag" json:"org_tags" binding:"dive,oneof=msp
          msp_customer"`
        in: query
        name: org_tag
        type: string
      - collectionFormat: csv
        in: query
        items:
          type: string
        name: plan
        type: array
      - in: query
        name: search
        type: string
      - description: 'options: timezone, created_at'
        enum:
        - timezone
        - created_at
        in: query
        name: sort_by
        type: string
      - collectionFormat: csv
        in: query
        items:
          type: string
        name: status
        type: array
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ListTenantResp'
      summary: List Tenant
      tags:
      - Tenant
  /orgs/{org_id}:
    delete:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: Delete Tenant By ID
      tags:
      - Tenant
    get:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.Tenant'
      summary: Get Tenant By ID
      tags:
      - Tenant
    patch:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      - description: patch tenant
        in: body
        name: req
        required: true
        schema:
          $ref: '#/definitions/forms.PatchTenantReq'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: UpdateTenant
      tags:
      - Tenant
  /orgs/{org_id}/access-logs:
    get:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      - in: query
        name: content
        type: string
      - in: query
        name: end_time
        type: integer
      - in: query
        name: org_id
        type: integer
      - in: query
        name: start_time
        type: integer
      - in: query
        name: user
        type: string
      - in: query
        name: page
        type: integer
      - in: query
        name: per_page
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ListAccessLogResp'
      summary: Serach Tenant access logs
      tags:
      - AccessLog
  /orgs/{org_id}/data-resource:
    get:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ResourceResult'
      summary: GetTenantResource
      tags:
      - Tenant
  /orgs/{org_id}/impersonation:
    delete:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: Delete Impersonation
      tags:
      - Impersonation
    post:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: AddImpersonation
      tags:
      - Impersonation
  /orgs/{org_id}/projects:
    get:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      - description: one of [asc,desc]
        in: query
        name: order
        type: string
      - in: query
        name: page
        type: integer
      - in: query
        name: page_size
        type: integer
      - description: one of [email,invite_time,role,status]
        in: query
        name: sort_by
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.GetOrgProjectsResp'
      summary: GetOrgProjects
      tags:
      - Project
  /orgs/{org_id}/projects/:project_id/data-resource:
    get:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ResourceResult'
      summary: GetProjectResource
      tags:
      - Tenant
  /orgs/{org_id}/projects/{project_id}:
    delete:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      - description: project_id
        in: path
        name: project_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: Delete Tenant Project
      tags:
      - TenantProject
  /orgs/{org_id}/projects/{project_id}/users:
    get:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      - description: project_id
        in: path
        name: org_id
        required: true
        type: string
      - description: one of [asc,desc]
        in: query
        name: order
        type: string
      - in: query
        name: page
        type: integer
      - in: query
        name: page_size
        type: integer
      - description: email like
        in: query
        name: search
        type: string
      - description: one of [email,invite_time,role,status]
        in: query
        name: sort_by
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ListUsersResp'
      summary: GetProjectUsers
      tags:
      - Tenant
  /orgs/{org_id}/projects/{project_id}/users/{user_id}:
    delete:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      - description: user_id
        in: path
        name: org_id
        required: true
        type: string
      - description: project_role
        in: body
        name: req
        required: true
        schema:
          $ref: '#/definitions/forms.ProjectRoleReq'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: RemoveUserFromeProject
      tags:
      - Project
    post:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      - description: user_id
        in: path
        name: org_id
        required: true
        type: string
      - description: project_role
        in: body
        name: req
        required: true
        schema:
          $ref: '#/definitions/forms.ProjectRoleReq'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: AddUserToProject
      tags:
      - Project
  /orgs/{org_id}/salesforce:
    post:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: Sync Salesforce Leads
      tags:
      - Salesforce
  /orgs/{org_id}/user/{id}:
    delete:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      - description: user_id
        in: path
        name: org_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: RemoveUserFromOrg
      tags:
      - Tenant
  /orgs/{org_id}/users:
    get:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      - description: one of [asc,desc]
        in: query
        name: order
        type: string
      - in: query
        name: page
        type: integer
      - in: query
        name: page_size
        type: integer
      - description: email like
        in: query
        name: search
        type: string
      - description: one of [email,invite_time,role,status]
        in: query
        name: sort_by
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ListUsersResp'
      summary: GetOrgUsers
      tags:
      - Tenant
  /orgs/{org_id}/users/{user_id}:
    post:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      - description: user_id
        in: path
        name: org_id
        required: true
        type: string
      - description: org_role
        in: body
        name: req
        required: true
        schema:
          $ref: '#/definitions/forms.OrgRoleReq'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: AddUserToOrg
      tags:
      - Tenant
  /orgs/user-org:
    get:
      consumes:
      - application/json
      parameters:
      - in: query
        name: user_id
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.GetUserOrgsResp'
      summary: GetUserOrgs
      tags:
      - Tenant
  /partner/{org_id}/customers:
    get:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              $ref: '#/definitions/forms.PartnerCustomer'
            type: array
      summary: GetCustomersByPartnerId
      tags:
      - msp
  /partner/cppo/create:
    post:
      consumes:
      - application/json
      parameters:
      - description: CreateCppoOrg
        in: body
        name: cppoOrg
        required: true
        schema:
          $ref: '#/definitions/forms.CppoOrgReq'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.CppoOrgResp'
      summary: CreateCppoOrg
      tags:
      - msp
  /partner/mcpo/create:
    post:
      consumes:
      - application/json
      parameters:
      - description: CreateMCPOResellerOrg
        in: body
        name: MCPOOrg
        required: true
        schema:
          $ref: '#/definitions/forms.MCPOResellerOrgReq'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.MCPOResellerOrgResp'
      summary: CreateMCPOResellerOrg
      tags:
      - msp
  /partner/msp/{org_id}:
    get:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.MspOrg'
      summary: GetMspByOrgId
      tags:
      - msp
  /partner/msp/{org_id}/create-apikey:
    post:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: CreateMspApiKey
      tags:
      - msp
  /partner/msp/{org_id}/customers:
    get:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              $ref: '#/definitions/forms.PartnerCustomer'
            type: array
      summary: GetCustomersByMspId
      tags:
      - msp
  /partner/msp/{org_id}/signup-url:
    get:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: signup_url
          schema:
            type: string
      summary: GetSignupUrl
      tags:
      - msp
  /partner/msp/create:
    post:
      consumes:
      - application/json
      parameters:
      - description: CreateMspOrg
        in: body
        name: msp
        required: true
        schema:
          $ref: '#/definitions/forms.MspOrg'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.CreateMspOrgResp'
      summary: CreateMspOrg
      tags:
      - msp
  /partner/msp/update:
    post:
      consumes:
      - application/json
      parameters:
      - description: UpdateMspOrg
        in: body
        name: msp
        required: true
        schema:
          $ref: '#/definitions/forms.MspOrg'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: UpdateMspOrg
      tags:
      - msp
  /partner/msp/upload-logo:
    post:
      consumes:
      - application/json
      parameters:
      - description: UploadMspLogo
        in: body
        name: msp
        required: true
        schema:
          $ref: '#/definitions/forms.UploadMspLogo'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.UploadMspLogoResp'
      summary: UploadMspLogo
      tags:
      - msp
  /partner/partner-customer/{org_id}:
    get:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.PartnerCustomer'
      summary: GetCustomerByOrgId
      tags:
      - msp
  /partner/partner-customer/cancel:
    post:
      consumes:
      - application/json
      parameters:
      - description: PartnerCustomer
        in: body
        name: msp
        required: true
        schema:
          $ref: '#/definitions/forms.PartnerCustomer'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: CancelCustomer
      tags:
      - msp
  /partner/partner-customer/create:
    post:
      consumes:
      - application/json
      parameters:
      - description: CreateCustomer
        in: body
        name: msp
        required: true
        schema:
          $ref: '#/definitions/forms.PartnerCustomer'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: CreateCustomer
      tags:
      - msp
  /partner/partner-customer/delete:
    delete:
      consumes:
      - application/json
      parameters:
      - description: DeleteCustomer
        in: body
        name: msp
        required: true
        schema:
          $ref: '#/definitions/forms.PartnerCustomer'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: DeleteCustomer
      tags:
      - msp
  /partner/resale/{org_id}/signup-url:
    get:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: signup_url
          schema:
            type: string
      summary: GetResaleCustomerSignupUrl
      tags:
      - msp
  /partner/resale/create:
    post:
      consumes:
      - application/json
      parameters:
      - description: resale org
        in: body
        name: resaleOrg
        required: true
        schema:
          $ref: '#/definitions/forms.ResellerOrgReq'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ResellerOrgResp'
      summary: CreateResalePartnerOrg
      tags:
      - msp
  /rbac/privilege/create:
    post:
      consumes:
      - application/json
      parameters:
      - description: CreateRbacPrivilege
        in: body
        name: role
        required: true
        schema:
          $ref: '#/definitions/forms.RbacPrivilege'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: CreateRbacPrivilege
      tags:
      - ManagementPortalUser
  /rbac/privilege/delete/{id}:
    post:
      consumes:
      - application/json
      parameters:
      - description: id
        format: int64
        in: path
        name: id
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: DeleteRbacPrivilege
      tags:
      - ManagementPortalUser
  /rbac/privilege/list:
    get:
      consumes:
      - application/json
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ListRbacPrivilegeResp'
      summary: ListRbacPrivileges
      tags:
      - ManagementPortalUser
  /rbac/privilege/system-list:
    get:
      consumes:
      - application/json
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ListPrivilegeSystemsResp'
      summary: ListPrivilegeSystems
      tags:
      - ManagementPortalUser
  /rbac/privilege/update:
    post:
      consumes:
      - application/json
      parameters:
      - description: UpdateRbacPrivilege
        in: body
        name: role
        required: true
        schema:
          $ref: '#/definitions/forms.RbacPrivilege'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: UpdateRbacPrivilege
      tags:
      - ManagementPortalUser
  /rbac/role-privilege/add:
    post:
      consumes:
      - application/json
      parameters:
      - description: AddRbacRolePrivilege
        in: body
        name: role
        required: true
        schema:
          $ref: '#/definitions/forms.GrantRolePrivilege'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: AddRbacRolePrivilege
      tags:
      - ManagementPortalUser
  /rbac/role-privilege/create:
    post:
      consumes:
      - application/json
      parameters:
      - description: CreateRbacRolePrivilege
        in: body
        name: role
        required: true
        schema:
          $ref: '#/definitions/forms.GrantRolePrivilege'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: CreateRbacRolePrivilege
      tags:
      - ManagementPortalUser
  /rbac/role-privilege/delete:
    post:
      consumes:
      - application/json
      parameters:
      - description: DeleteRbacRolePrivilege
        in: body
        name: role
        required: true
        schema:
          $ref: '#/definitions/forms.RbacRolePrivilege'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: DeleteRbacRolePrivilege
      tags:
      - ManagementPortalUser
  /rbac/role-privilege/list/{role_id}:
    get:
      consumes:
      - application/json
      parameters:
      - description: role_id
        format: int64
        in: path
        name: role_id
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              $ref: '#/definitions/forms.RbacRolePrivilege'
            type: array
      summary: ListRbacRoleRelatePrivileges
      tags:
      - ManagementPortalUser
  /rbac/role/{id}:
    get:
      consumes:
      - application/json
      parameters:
      - description: id
        format: int64
        in: path
        name: id
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.RbacRole'
      summary: GetRbacRoleById
      tags:
      - ManagementPortalUser
  /rbac/role/create:
    post:
      consumes:
      - application/json
      parameters:
      - description: CreateRbacRole
        in: body
        name: role
        required: true
        schema:
          $ref: '#/definitions/forms.RbacRole'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: CreateRbacRole
      tags:
      - ManagementPortalUser
  /rbac/role/delete/{id}:
    post:
      consumes:
      - application/json
      parameters:
      - description: id
        format: int64
        in: path
        name: id
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: DeleteRbacRole
      tags:
      - ManagementPortalUser
  /rbac/role/list:
    get:
      consumes:
      - application/json
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              $ref: '#/definitions/forms.RbacRoleResp'
            type: array
      summary: ListRbacRoles
      tags:
      - ManagementPortalUser
  /rbac/role/update:
    post:
      consumes:
      - application/json
      parameters:
      - description: UpdateRbacRole
        in: body
        name: role
        required: true
        schema:
          $ref: '#/definitions/forms.RbacRole'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: UpdateRbacRole
      tags:
      - ManagementPortalUser
  /system-settings:
    get:
      consumes:
      - application/json
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.SystemSettings'
      summary: GetSystemSettings
      tags:
      - System
    put:
      consumes:
      - application/json
      parameters:
      - description: update system settings
        in: body
        name: settings
        required: true
        schema:
          $ref: '#/definitions/forms.SystemSettings'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.SystemSettings'
      summary: UpdateSystemSettings
      tags:
      - System
  /users:
    get:
      consumes:
      - application/json
      parameters:
      - in: query
        name: email_eq
        type: string
      - in: query
        name: email_like
        type: string
      - in: query
        name: first_name
        type: string
      - in: query
        name: last_name
        type: string
      - description: one of [asc,desc]
        in: query
        name: order
        type: string
      - in: query
        name: page
        type: integer
      - in: query
        name: page_size
        type: integer
      - in: query
        name: phone_number_like
        type: string
      - description: one of [email,invite_time,role,status]
        in: query
        name: sort_by
        type: string
      - in: query
        name: status
        type: string
      - in: query
        name: user_id
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ListUsersResp'
      summary: ListUsers
      tags:
      - User
  /users/{user_id}:
    delete:
      consumes:
      - application/json
      parameters:
      - description: user_id
        in: path
        name: org_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: DeleteUserFromAllOrg
      tags:
      - ScopeUser
swagger: "2.0"
