Skip to content

Commit eb95d6b

Browse files
committed
API generation
1 parent 69844fa commit eb95d6b

18 files changed

+26
-750
lines changed

api/api/ccr.follow_info.js

Lines changed: 0 additions & 116 deletions
This file was deleted.

api/api/create.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,8 @@ function buildCreate (opts) {
9696
return handleError(err, callback)
9797
}
9898
if (params['type'] == null) {
99-
return callback(
100-
new ConfigurationError('Missing required parameter: type'),
101-
result
102-
)
99+
const err = new ConfigurationError('Missing required parameter: type')
100+
return handleError(err, callback)
103101
}
104102
if (params['body'] == null) {
105103
const err = new ConfigurationError('Missing required parameter: body')

api/api/delete.js

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -99,33 +99,21 @@ function buildDelete (opts) {
9999
return handleError(err, callback)
100100
}
101101
if (params['type'] == null) {
102-
return callback(
103-
new ConfigurationError('Missing required parameter: type'),
104-
result
105-
)
102+
const err = new ConfigurationError('Missing required parameter: type')
103+
return handleError(err, callback)
106104
}
107105
if (params.body != null) {
108106
const err = new ConfigurationError('This API does not require a body')
109107
return handleError(err, callback)
110108
}
111109

112110
// check required url components
113-
<<<<<<< HEAD
114111
if (params['id'] != null && (params['type'] == null || params['index'] == null)) {
115-
return callback(
116-
new ConfigurationError('Missing required parameter of the url: type, index'),
117-
result
118-
)
112+
const err = new ConfigurationError('Missing required parameter of the url: type, index')
113+
return handleError(err, callback)
119114
} else if (params['type'] != null && (params['index'] == null)) {
120-
return callback(
121-
new ConfigurationError('Missing required parameter of the url: index'),
122-
result
123-
)
124-
=======
125-
if (params['id'] != null && (params['index'] == null)) {
126115
const err = new ConfigurationError('Missing required parameter of the url: index')
127116
return handleError(err, callback)
128-
>>>>>>> master
129117
}
130118

131119
// validate headers object

api/api/exists.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,8 @@ function buildExists (opts) {
103103
return handleError(err, callback)
104104
}
105105
if (params['type'] == null) {
106-
return callback(
107-
new ConfigurationError('Missing required parameter: type'),
108-
result
109-
)
106+
const err = new ConfigurationError('Missing required parameter: type')
107+
return handleError(err, callback)
110108
}
111109
if (params.body != null) {
112110
const err = new ConfigurationError('This API does not require a body')

api/api/exists_source.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,8 @@ function buildExistsSource (opts) {
100100
return handleError(err, callback)
101101
}
102102
if (params['type'] == null) {
103-
return callback(
104-
new ConfigurationError('Missing required parameter: type'),
105-
result
106-
)
103+
const err = new ConfigurationError('Missing required parameter: type')
104+
return handleError(err, callback)
107105
}
108106
if (params.body != null) {
109107
const err = new ConfigurationError('This API does not require a body')

api/api/explain.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,8 @@ function buildExplain (opts) {
109109
return handleError(err, callback)
110110
}
111111
if (params['type'] == null) {
112-
return callback(
113-
new ConfigurationError('Missing required parameter: type'),
114-
result
115-
)
112+
const err = new ConfigurationError('Missing required parameter: type')
113+
return handleError(err, callback)
116114
}
117115

118116
// validate headers object

api/api/field_caps.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,13 @@ function buildFieldCaps (opts) {
6868
options = {}
6969
}
7070

71-
<<<<<<< HEAD
7271
// promises support
7372
if (callback == null) {
7473
return new Promise((resolve, reject) => {
7574
fieldCaps(params, options, (err, body) => {
7675
err ? reject(err) : resolve(body)
7776
})
7877
})
79-
=======
80-
// check required parameters
81-
if (params.body != null) {
82-
const err = new ConfigurationError('This API does not require a body')
83-
return handleError(err, callback)
84-
>>>>>>> master
8578
}
8679

8780
// validate headers object

api/api/get.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,8 @@ function buildGet (opts) {
109109
return handleError(err, callback)
110110
}
111111
if (params['type'] == null) {
112-
return callback(
113-
new ConfigurationError('Missing required parameter: type'),
114-
result
115-
)
112+
const err = new ConfigurationError('Missing required parameter: type')
113+
return handleError(err, callback)
116114
}
117115
if (params.body != null) {
118116
const err = new ConfigurationError('This API does not require a body')

api/api/get_source.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,8 @@ function buildGetSource (opts) {
100100
return handleError(err, callback)
101101
}
102102
if (params['type'] == null) {
103-
return callback(
104-
new ConfigurationError('Missing required parameter: type'),
105-
result
106-
)
103+
const err = new ConfigurationError('Missing required parameter: type')
104+
return handleError(err, callback)
107105
}
108106
if (params.body != null) {
109107
const err = new ConfigurationError('This API does not require a body')

api/api/index.js

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -101,33 +101,21 @@ function buildIndex (opts) {
101101
return handleError(err, callback)
102102
}
103103
if (params['type'] == null) {
104-
return callback(
105-
new ConfigurationError('Missing required parameter: type'),
106-
result
107-
)
104+
const err = new ConfigurationError('Missing required parameter: type')
105+
return handleError(err, callback)
108106
}
109107
if (params['body'] == null) {
110108
const err = new ConfigurationError('Missing required parameter: body')
111109
return handleError(err, callback)
112110
}
113111

114112
// check required url components
115-
<<<<<<< HEAD
116113
if (params['id'] != null && (params['type'] == null || params['index'] == null)) {
117-
return callback(
118-
new ConfigurationError('Missing required parameter of the url: type, index'),
119-
result
120-
)
114+
const err = new ConfigurationError('Missing required parameter of the url: type, index')
115+
return handleError(err, callback)
121116
} else if (params['type'] != null && (params['index'] == null)) {
122-
return callback(
123-
new ConfigurationError('Missing required parameter of the url: index'),
124-
result
125-
)
126-
=======
127-
if (params['id'] != null && (params['index'] == null)) {
128117
const err = new ConfigurationError('Missing required parameter of the url: index')
129118
return handleError(err, callback)
130-
>>>>>>> master
131119
}
132120

133121
// validate headers object

api/api/indices.put_mapping.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,8 @@ function buildIndicesPutMapping (opts) {
8686

8787
// check required parameters
8888
if (params['type'] == null) {
89-
return callback(
90-
new ConfigurationError('Missing required parameter: type'),
91-
result
92-
)
89+
const err = new ConfigurationError('Missing required parameter: type')
90+
return handleError(err, callback)
9391
}
9492
if (params['body'] == null) {
9593
const err = new ConfigurationError('Missing required parameter: body')

0 commit comments

Comments
 (0)