vendor acme
name docusign

defaults {
  http {
    format: "json"
    auth {
      headers: {
        Authorization: `Bearer {config.auth.accessToken.token}`
      }
    }
  }
}

config {
  baseUrl: string title("API Base URL") example("https://demo.docusign.net/restapi")

  auth: oauth2.jwtBearer {
    tokenUrl: "https://account-d.docusign.com/oauth/token"
    audience: "account-d.docusign.com"
    scope: "signature impersonation"
    consentUrl: "https://account-d.docusign.com/oauth/auth?response_type=code&scope={scope}&client_id={clientId}&redirect_uri={redirectUri}"
  }
}

model Account {
  accountId: string
  accountName: string

  resource {
    query account(accountId: string): Account -> {
      http.get(`/v2.1/accounts/{accountId}`)
    }
  }
}
