|
1 | 1 | import yaml from 'js-yaml' |
2 | 2 | import fs from 'fs' |
3 | 3 | import * as R from 'ramda' |
4 | | -import { pascalCase, titleCase } from 'change-case' |
| 4 | +import { pascalCase, capitalCase } from 'change-case' |
5 | 5 | import { lowerCaseFirst } from 'lower-case-first' |
6 | 6 | import path from 'path' |
7 | 7 |
|
8 | 8 | import { normalizePath, deNormalizePath, getResponseType, appendCodeToFile } from './utils' |
9 | 9 |
|
10 | 10 | const outputDir = '../src/main/java/com/ringcentral/paths' |
11 | 11 |
|
12 | | -const doc = yaml.safeLoad(fs.readFileSync('/Users/tyler.liu/src/dotnet/RingCentral.Net/code-generator/rc-platform-adjusted.yml', 'utf8')) |
| 12 | +const doc = yaml.safeLoad(fs.readFileSync('/Users/tyler.liu/src/dotnet/RingCentral.Net/code-generator/rc-platform.yml', 'utf8')) |
13 | 13 |
|
14 | 14 | // Delete /restapi/oauth/authorize: https://git.ringcentral.com/platform/api-metadata-specs/issues/26 |
15 | 15 | delete doc.paths['/restapi/oauth/authorize'] |
@@ -181,7 +181,7 @@ const generate = (prefix = '/') => { |
181 | 181 | code += ` |
182 | 182 |
|
183 | 183 | /** |
184 | | - * Operation: ${operation.detail.summary || titleCase(operation.detail.operationId)} |
| 184 | + * Operation: ${operation.detail.summary || capitalCase(operation.detail.operationId)} |
185 | 185 | * Http ${method} ${operation.endpoint} |
186 | 186 | */ |
187 | 187 | ${methodParams.join(', ').includes(' = ') ? '@JvmOverloads ' : ''}fun ${smartMethod.toLowerCase()}(${methodParams.join(', ')}) : ${responseType}? |
@@ -246,14 +246,3 @@ const generate = (prefix = '/') => { |
246 | 246 | } |
247 | 247 |
|
248 | 248 | generate('/') |
249 | | - |
250 | | -const mmsFolderPath = path.join(outputDir, 'restapi', 'account', 'extension', 'mms') |
251 | | -// fs.mkdirSync(mmsFolderPath) |
252 | | -appendCodeToFile(path.join(mmsFolderPath, 'Index.kt'), `/** |
253 | | - * Operation: Create MMS Message |
254 | | - * Http Post /restapi/v1.0/account/{accountId}/extension/{extensionId}/mms |
255 | | - */ |
256 | | - fun post(createMMSMessage: com.ringcentral.definitions.CreateMMSMessage): com.ringcentral.definitions.GetMessageInfoResponse? { |
257 | | - val rb: okhttp3.ResponseBody = rc.post(this.path(), createMMSMessage, null, com.ringcentral.ContentType.MULTIPART) |
258 | | - return com.ringcentral.Utils.gson.fromJson(rb.string(), com.ringcentral.definitions.GetMessageInfoResponse::class.java) |
259 | | - }`) |
0 commit comments