sideko_netlify_api 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/sideko_netlify_api.rb +3843 -0
- metadata +64 -0
@@ -0,0 +1,3843 @@
|
|
1
|
+
# Generated by Sideko (sideko.dev)
|
2
|
+
# frozen_string_literal: true
|
3
|
+
require 'json'
|
4
|
+
require 'http'
|
5
|
+
|
6
|
+
class RequestError < StandardError
|
7
|
+
attr_reader :status_code, :method, :url, :data, :response
|
8
|
+
|
9
|
+
def initialize(method, url, response)
|
10
|
+
@status_code = response.status
|
11
|
+
@method = method
|
12
|
+
@url = url
|
13
|
+
begin
|
14
|
+
@data = response.parse
|
15
|
+
rescue
|
16
|
+
@data = nil
|
17
|
+
end
|
18
|
+
@response = response
|
19
|
+
|
20
|
+
super("received #{status_code} from #{method} #{url} with #{message}")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
module AuthProvider
|
25
|
+
def add_auth(http_client, req_kwargs)
|
26
|
+
raise NotImplementedError, "You must implement the 'add_auth' method"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
class AuthBasic
|
31
|
+
include AuthProvider
|
32
|
+
|
33
|
+
attr_accessor :username, :password
|
34
|
+
|
35
|
+
def initialize(username: nil, password: nil)
|
36
|
+
@username = username
|
37
|
+
@password = password
|
38
|
+
end
|
39
|
+
|
40
|
+
def add_auth(http_client, req_kwargs)
|
41
|
+
if !@username.nil? && !@password.nil?
|
42
|
+
http_client = http_client.basic_auth(user: @username, pass: @password)
|
43
|
+
end
|
44
|
+
|
45
|
+
return http_client, req_kwargs
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
class AuthBearer
|
50
|
+
include AuthProvider
|
51
|
+
|
52
|
+
attr_accessor :val
|
53
|
+
|
54
|
+
def initialize(val: nil)
|
55
|
+
@val = val
|
56
|
+
end
|
57
|
+
|
58
|
+
def add_auth(http_client, req_kwargs)
|
59
|
+
if !@val.nil?
|
60
|
+
headers = req_kwargs.fetch(:headers, {})
|
61
|
+
headers["Authorization"] = "Bearer " + @val
|
62
|
+
req_kwargs[:headers] = headers
|
63
|
+
end
|
64
|
+
|
65
|
+
return http_client, req_kwargs
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
class AuthKeyQuery
|
70
|
+
include AuthProvider
|
71
|
+
|
72
|
+
attr_accessor :query_name, :val
|
73
|
+
|
74
|
+
def initialize(query_name: nil, val: nil)
|
75
|
+
@query_name = query_name
|
76
|
+
@val = val
|
77
|
+
end
|
78
|
+
|
79
|
+
def add_auth(http_client, req_kwargs)
|
80
|
+
if !val.nil?
|
81
|
+
params = req_kwargs.fetch(:params, {})
|
82
|
+
params[query_name] = val
|
83
|
+
req_kwargs[:params] = params
|
84
|
+
end
|
85
|
+
|
86
|
+
return http_client, req_kwargs
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
class AuthKeyHeader
|
91
|
+
include AuthProvider
|
92
|
+
|
93
|
+
attr_accessor :header_name, :val
|
94
|
+
|
95
|
+
def initialize(header_name: nil, val: nil)
|
96
|
+
@header_name = header_name
|
97
|
+
@val = val
|
98
|
+
end
|
99
|
+
|
100
|
+
def add_auth(http_client, req_kwargs)
|
101
|
+
if !@val.nil?
|
102
|
+
headers = req_kwargs.fetch(:headers, {})
|
103
|
+
headers[@header_name] = @val
|
104
|
+
req_kwargs[:headers] = headers
|
105
|
+
end
|
106
|
+
|
107
|
+
return http_client, req_kwargs
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
class AuthKeyCookie
|
112
|
+
include AuthProvider
|
113
|
+
|
114
|
+
attr_accessor :cookie_name, :val
|
115
|
+
|
116
|
+
def initialize(cookie_name: nil, val: nil)
|
117
|
+
@cookie_name = cookie_name
|
118
|
+
@val = val
|
119
|
+
end
|
120
|
+
|
121
|
+
def add_auth(http_client, req_kwargs)
|
122
|
+
if !@val.nil?
|
123
|
+
http_client = http_client.cookies(@cookie_name => @val)
|
124
|
+
end
|
125
|
+
|
126
|
+
return http_client, req_kwargs
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
class Client
|
131
|
+
def initialize(netlify_auth: nil, base_url: 'https://api.netlify.com/api/v1')
|
132
|
+
@_base_url = base_url
|
133
|
+
# register auth providers
|
134
|
+
@_auth = {}
|
135
|
+
@_auth[:"netlifyAuth"] = AuthBearer.new(val: netlify_auth)
|
136
|
+
end
|
137
|
+
|
138
|
+
def _client_with_auth(auth_names, **req_kwargs)
|
139
|
+
http_client = HTTP
|
140
|
+
auth_names.each do |auth_name|
|
141
|
+
provider = @_auth[auth_name]
|
142
|
+
http_client, req_kwargs = provider.add_auth(http_client, req_kwargs) if provider
|
143
|
+
end
|
144
|
+
|
145
|
+
return http_client, req_kwargs
|
146
|
+
end
|
147
|
+
|
148
|
+
|
149
|
+
def cancel_account(account_id)
|
150
|
+
_url = @_base_url + "/accounts/#{account_id}"
|
151
|
+
_kwargs = {
|
152
|
+
params: {}
|
153
|
+
}
|
154
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
155
|
+
[:"netlifyAuth", ],
|
156
|
+
**_kwargs
|
157
|
+
)
|
158
|
+
|
159
|
+
|
160
|
+
_response = _http_client.delete(
|
161
|
+
_url,
|
162
|
+
|
163
|
+
**_req_kwargs
|
164
|
+
)
|
165
|
+
|
166
|
+
# Raise if not expected success code
|
167
|
+
if _response.status != 204
|
168
|
+
raise RequestError.new(
|
169
|
+
method="delete",
|
170
|
+
url=_url,
|
171
|
+
response=_response
|
172
|
+
)
|
173
|
+
end
|
174
|
+
|
175
|
+
return _response.body.empty? ? '' : _response.parse
|
176
|
+
end
|
177
|
+
|
178
|
+
# Deletes an environment variable. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>. Migrate now with the Netlify UI.
|
179
|
+
def delete_env_var(account_id, key, site_id: nil)
|
180
|
+
_url = @_base_url + "/accounts/#{account_id}/env/#{key}"
|
181
|
+
_kwargs = {
|
182
|
+
params: {}
|
183
|
+
}
|
184
|
+
if site_id != nil
|
185
|
+
_kwargs[:params][:"site_id"] = site_id
|
186
|
+
end
|
187
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
188
|
+
[:"netlifyAuth", ],
|
189
|
+
**_kwargs
|
190
|
+
)
|
191
|
+
|
192
|
+
|
193
|
+
_response = _http_client.delete(
|
194
|
+
_url,
|
195
|
+
|
196
|
+
**_req_kwargs
|
197
|
+
)
|
198
|
+
|
199
|
+
# Raise if not expected success code
|
200
|
+
if _response.status != 204
|
201
|
+
raise RequestError.new(
|
202
|
+
method="delete",
|
203
|
+
url=_url,
|
204
|
+
response=_response
|
205
|
+
)
|
206
|
+
end
|
207
|
+
|
208
|
+
return _response.body.empty? ? '' : _response.parse
|
209
|
+
end
|
210
|
+
|
211
|
+
# Deletes a specific environment variable value. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>. Migrate now with the Netlify UI.
|
212
|
+
def delete_env_var_value(account_id, key, id, site_id: nil)
|
213
|
+
_url = @_base_url + "/accounts/#{account_id}/env/#{key}/value/#{id}"
|
214
|
+
_kwargs = {
|
215
|
+
params: {}
|
216
|
+
}
|
217
|
+
if site_id != nil
|
218
|
+
_kwargs[:params][:"site_id"] = site_id
|
219
|
+
end
|
220
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
221
|
+
[:"netlifyAuth", ],
|
222
|
+
**_kwargs
|
223
|
+
)
|
224
|
+
|
225
|
+
|
226
|
+
_response = _http_client.delete(
|
227
|
+
_url,
|
228
|
+
|
229
|
+
**_req_kwargs
|
230
|
+
)
|
231
|
+
|
232
|
+
# Raise if not expected success code
|
233
|
+
if _response.status != 204
|
234
|
+
raise RequestError.new(
|
235
|
+
method="delete",
|
236
|
+
url=_url,
|
237
|
+
response=_response
|
238
|
+
)
|
239
|
+
end
|
240
|
+
|
241
|
+
return _response.body.empty? ? '' : _response.parse
|
242
|
+
end
|
243
|
+
|
244
|
+
def delete_deploy_key(key_id)
|
245
|
+
_url = @_base_url + "/deploy_keys/#{key_id}"
|
246
|
+
_kwargs = {
|
247
|
+
params: {}
|
248
|
+
}
|
249
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
250
|
+
[:"netlifyAuth", ],
|
251
|
+
**_kwargs
|
252
|
+
)
|
253
|
+
|
254
|
+
|
255
|
+
_response = _http_client.delete(
|
256
|
+
_url,
|
257
|
+
|
258
|
+
**_req_kwargs
|
259
|
+
)
|
260
|
+
|
261
|
+
# Raise if not expected success code
|
262
|
+
if _response.status != 204
|
263
|
+
raise RequestError.new(
|
264
|
+
method="delete",
|
265
|
+
url=_url,
|
266
|
+
response=_response
|
267
|
+
)
|
268
|
+
end
|
269
|
+
|
270
|
+
return _response.body.empty? ? '' : _response.parse
|
271
|
+
end
|
272
|
+
|
273
|
+
def delete_deploy(deploy_id)
|
274
|
+
_url = @_base_url + "/deploys/#{deploy_id}"
|
275
|
+
_kwargs = {
|
276
|
+
params: {}
|
277
|
+
}
|
278
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
279
|
+
[:"netlifyAuth", ],
|
280
|
+
**_kwargs
|
281
|
+
)
|
282
|
+
|
283
|
+
|
284
|
+
_response = _http_client.delete(
|
285
|
+
_url,
|
286
|
+
|
287
|
+
**_req_kwargs
|
288
|
+
)
|
289
|
+
|
290
|
+
# Raise if not expected success code
|
291
|
+
if _response.status != 204
|
292
|
+
raise RequestError.new(
|
293
|
+
method="delete",
|
294
|
+
url=_url,
|
295
|
+
response=_response
|
296
|
+
)
|
297
|
+
end
|
298
|
+
|
299
|
+
return _response.body.empty? ? '' : _response.parse
|
300
|
+
end
|
301
|
+
|
302
|
+
def delete_dns_zone(zone_id)
|
303
|
+
_url = @_base_url + "/dns_zones/#{zone_id}"
|
304
|
+
_kwargs = {
|
305
|
+
params: {}
|
306
|
+
}
|
307
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
308
|
+
[:"netlifyAuth", ],
|
309
|
+
**_kwargs
|
310
|
+
)
|
311
|
+
|
312
|
+
|
313
|
+
_response = _http_client.delete(
|
314
|
+
_url,
|
315
|
+
|
316
|
+
**_req_kwargs
|
317
|
+
)
|
318
|
+
|
319
|
+
# Raise if not expected success code
|
320
|
+
if _response.status != 204
|
321
|
+
raise RequestError.new(
|
322
|
+
method="delete",
|
323
|
+
url=_url,
|
324
|
+
response=_response
|
325
|
+
)
|
326
|
+
end
|
327
|
+
|
328
|
+
return _response.body.empty? ? '' : _response.parse
|
329
|
+
end
|
330
|
+
|
331
|
+
def delete_dns_record(zone_id, dns_record_id)
|
332
|
+
_url = @_base_url + "/dns_zones/#{zone_id}/dns_records/#{dns_record_id}"
|
333
|
+
_kwargs = {
|
334
|
+
params: {}
|
335
|
+
}
|
336
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
337
|
+
[:"netlifyAuth", ],
|
338
|
+
**_kwargs
|
339
|
+
)
|
340
|
+
|
341
|
+
|
342
|
+
_response = _http_client.delete(
|
343
|
+
_url,
|
344
|
+
|
345
|
+
**_req_kwargs
|
346
|
+
)
|
347
|
+
|
348
|
+
# Raise if not expected success code
|
349
|
+
if _response.status != 204
|
350
|
+
raise RequestError.new(
|
351
|
+
method="delete",
|
352
|
+
url=_url,
|
353
|
+
response=_response
|
354
|
+
)
|
355
|
+
end
|
356
|
+
|
357
|
+
return _response.body.empty? ? '' : _response.parse
|
358
|
+
end
|
359
|
+
|
360
|
+
def delete_hook(hook_id)
|
361
|
+
_url = @_base_url + "/hooks/#{hook_id}"
|
362
|
+
_kwargs = {
|
363
|
+
params: {}
|
364
|
+
}
|
365
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
366
|
+
[:"netlifyAuth", ],
|
367
|
+
**_kwargs
|
368
|
+
)
|
369
|
+
|
370
|
+
|
371
|
+
_response = _http_client.delete(
|
372
|
+
_url,
|
373
|
+
|
374
|
+
**_req_kwargs
|
375
|
+
)
|
376
|
+
|
377
|
+
# Raise if not expected success code
|
378
|
+
if _response.status != 204
|
379
|
+
raise RequestError.new(
|
380
|
+
method="delete",
|
381
|
+
url=_url,
|
382
|
+
response=_response
|
383
|
+
)
|
384
|
+
end
|
385
|
+
|
386
|
+
return _response.body.empty? ? '' : _response.parse
|
387
|
+
end
|
388
|
+
|
389
|
+
def delete_site(site_id)
|
390
|
+
_url = @_base_url + "/sites/#{site_id}"
|
391
|
+
_kwargs = {
|
392
|
+
params: {}
|
393
|
+
}
|
394
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
395
|
+
[:"netlifyAuth", ],
|
396
|
+
**_kwargs
|
397
|
+
)
|
398
|
+
|
399
|
+
|
400
|
+
_response = _http_client.delete(
|
401
|
+
_url,
|
402
|
+
|
403
|
+
**_req_kwargs
|
404
|
+
)
|
405
|
+
|
406
|
+
# Raise if not expected success code
|
407
|
+
if _response.status != 204
|
408
|
+
raise RequestError.new(
|
409
|
+
method="delete",
|
410
|
+
url=_url,
|
411
|
+
response=_response
|
412
|
+
)
|
413
|
+
end
|
414
|
+
|
415
|
+
return _response.body.empty? ? '' : _response.parse
|
416
|
+
end
|
417
|
+
|
418
|
+
def delete_site_asset(site_id, asset_id)
|
419
|
+
_url = @_base_url + "/sites/#{site_id}/assets/#{asset_id}"
|
420
|
+
_kwargs = {
|
421
|
+
params: {}
|
422
|
+
}
|
423
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
424
|
+
[:"netlifyAuth", ],
|
425
|
+
**_kwargs
|
426
|
+
)
|
427
|
+
|
428
|
+
|
429
|
+
_response = _http_client.delete(
|
430
|
+
_url,
|
431
|
+
|
432
|
+
**_req_kwargs
|
433
|
+
)
|
434
|
+
|
435
|
+
# Raise if not expected success code
|
436
|
+
if _response.status != 204
|
437
|
+
raise RequestError.new(
|
438
|
+
method="delete",
|
439
|
+
url=_url,
|
440
|
+
response=_response
|
441
|
+
)
|
442
|
+
end
|
443
|
+
|
444
|
+
return _response.body.empty? ? '' : _response.parse
|
445
|
+
end
|
446
|
+
|
447
|
+
def delete_site_build_hook(site_id, id)
|
448
|
+
_url = @_base_url + "/sites/#{site_id}/build_hooks/#{id}"
|
449
|
+
_kwargs = {
|
450
|
+
params: {}
|
451
|
+
}
|
452
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
453
|
+
[:"netlifyAuth", ],
|
454
|
+
**_kwargs
|
455
|
+
)
|
456
|
+
|
457
|
+
|
458
|
+
_response = _http_client.delete(
|
459
|
+
_url,
|
460
|
+
|
461
|
+
**_req_kwargs
|
462
|
+
)
|
463
|
+
|
464
|
+
# Raise if not expected success code
|
465
|
+
if _response.status != 204
|
466
|
+
raise RequestError.new(
|
467
|
+
method="delete",
|
468
|
+
url=_url,
|
469
|
+
response=_response
|
470
|
+
)
|
471
|
+
end
|
472
|
+
|
473
|
+
return _response.body.empty? ? '' : _response.parse
|
474
|
+
end
|
475
|
+
|
476
|
+
def delete_site_deploy(site_id, deploy_id)
|
477
|
+
_url = @_base_url + "/sites/#{site_id}/deploys/#{deploy_id}"
|
478
|
+
_kwargs = {
|
479
|
+
params: {}
|
480
|
+
}
|
481
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
482
|
+
[:"netlifyAuth", ],
|
483
|
+
**_kwargs
|
484
|
+
)
|
485
|
+
|
486
|
+
|
487
|
+
_response = _http_client.delete(
|
488
|
+
_url,
|
489
|
+
|
490
|
+
**_req_kwargs
|
491
|
+
)
|
492
|
+
|
493
|
+
# Raise if not expected success code
|
494
|
+
if _response.status != 204
|
495
|
+
raise RequestError.new(
|
496
|
+
method="delete",
|
497
|
+
url=_url,
|
498
|
+
response=_response
|
499
|
+
)
|
500
|
+
end
|
501
|
+
|
502
|
+
return _response.body.empty? ? '' : _response.parse
|
503
|
+
end
|
504
|
+
|
505
|
+
def delete_site_form(site_id, form_id)
|
506
|
+
_url = @_base_url + "/sites/#{site_id}/forms/#{form_id}"
|
507
|
+
_kwargs = {
|
508
|
+
params: {}
|
509
|
+
}
|
510
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
511
|
+
[:"netlifyAuth", ],
|
512
|
+
**_kwargs
|
513
|
+
)
|
514
|
+
|
515
|
+
|
516
|
+
_response = _http_client.delete(
|
517
|
+
_url,
|
518
|
+
|
519
|
+
**_req_kwargs
|
520
|
+
)
|
521
|
+
|
522
|
+
# Raise if not expected success code
|
523
|
+
if _response.status != 204
|
524
|
+
raise RequestError.new(
|
525
|
+
method="delete",
|
526
|
+
url=_url,
|
527
|
+
response=_response
|
528
|
+
)
|
529
|
+
end
|
530
|
+
|
531
|
+
return _response.body.empty? ? '' : _response.parse
|
532
|
+
end
|
533
|
+
|
534
|
+
def delete_service_instance(site_id, addon, instance_id)
|
535
|
+
_url = @_base_url + "/sites/#{site_id}/services/#{addon}/instances/#{instance_id}"
|
536
|
+
_kwargs = {
|
537
|
+
params: {}
|
538
|
+
}
|
539
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
540
|
+
[:"netlifyAuth", ],
|
541
|
+
**_kwargs
|
542
|
+
)
|
543
|
+
|
544
|
+
|
545
|
+
_response = _http_client.delete(
|
546
|
+
_url,
|
547
|
+
|
548
|
+
**_req_kwargs
|
549
|
+
)
|
550
|
+
|
551
|
+
# Raise if not expected success code
|
552
|
+
if _response.status != 204
|
553
|
+
raise RequestError.new(
|
554
|
+
method="delete",
|
555
|
+
url=_url,
|
556
|
+
response=_response
|
557
|
+
)
|
558
|
+
end
|
559
|
+
|
560
|
+
return _response.body.empty? ? '' : _response.parse
|
561
|
+
end
|
562
|
+
|
563
|
+
def delete_site_snippet(site_id, snippet_id)
|
564
|
+
_url = @_base_url + "/sites/#{site_id}/snippets/#{snippet_id}"
|
565
|
+
_kwargs = {
|
566
|
+
params: {}
|
567
|
+
}
|
568
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
569
|
+
[:"netlifyAuth", ],
|
570
|
+
**_kwargs
|
571
|
+
)
|
572
|
+
|
573
|
+
|
574
|
+
_response = _http_client.delete(
|
575
|
+
_url,
|
576
|
+
|
577
|
+
**_req_kwargs
|
578
|
+
)
|
579
|
+
|
580
|
+
# Raise if not expected success code
|
581
|
+
if _response.status != 204
|
582
|
+
raise RequestError.new(
|
583
|
+
method="delete",
|
584
|
+
url=_url,
|
585
|
+
response=_response
|
586
|
+
)
|
587
|
+
end
|
588
|
+
|
589
|
+
return _response.body.empty? ? '' : _response.parse
|
590
|
+
end
|
591
|
+
|
592
|
+
def delete_submission(submission_id)
|
593
|
+
_url = @_base_url + "/submissions/#{submission_id}"
|
594
|
+
_kwargs = {
|
595
|
+
params: {}
|
596
|
+
}
|
597
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
598
|
+
[:"netlifyAuth", ],
|
599
|
+
**_kwargs
|
600
|
+
)
|
601
|
+
|
602
|
+
|
603
|
+
_response = _http_client.delete(
|
604
|
+
_url,
|
605
|
+
|
606
|
+
**_req_kwargs
|
607
|
+
)
|
608
|
+
|
609
|
+
# Raise if not expected success code
|
610
|
+
if _response.status != 204
|
611
|
+
raise RequestError.new(
|
612
|
+
method="delete",
|
613
|
+
url=_url,
|
614
|
+
response=_response
|
615
|
+
)
|
616
|
+
end
|
617
|
+
|
618
|
+
return _response.body.empty? ? '' : _response.parse
|
619
|
+
end
|
620
|
+
|
621
|
+
def remove_account_member(account_slug, member_id)
|
622
|
+
_url = @_base_url + "/#{account_slug}/members/#{member_id}"
|
623
|
+
_kwargs = {
|
624
|
+
params: {}
|
625
|
+
}
|
626
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
627
|
+
[:"netlifyAuth", ],
|
628
|
+
**_kwargs
|
629
|
+
)
|
630
|
+
|
631
|
+
|
632
|
+
_response = _http_client.delete(
|
633
|
+
_url,
|
634
|
+
|
635
|
+
**_req_kwargs
|
636
|
+
)
|
637
|
+
|
638
|
+
# Raise if not expected success code
|
639
|
+
if _response.status != 204
|
640
|
+
raise RequestError.new(
|
641
|
+
method="delete",
|
642
|
+
url=_url,
|
643
|
+
response=_response
|
644
|
+
)
|
645
|
+
end
|
646
|
+
|
647
|
+
return _response.body.empty? ? '' : _response.parse
|
648
|
+
end
|
649
|
+
|
650
|
+
def list_accounts_for_user()
|
651
|
+
_url = @_base_url + "/accounts"
|
652
|
+
_kwargs = {
|
653
|
+
params: {}
|
654
|
+
}
|
655
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
656
|
+
[:"netlifyAuth", ],
|
657
|
+
**_kwargs
|
658
|
+
)
|
659
|
+
|
660
|
+
|
661
|
+
_response = _http_client.get(
|
662
|
+
_url,
|
663
|
+
|
664
|
+
**_req_kwargs
|
665
|
+
)
|
666
|
+
|
667
|
+
# Raise if not expected success code
|
668
|
+
if _response.status != 200
|
669
|
+
raise RequestError.new(
|
670
|
+
method="get",
|
671
|
+
url=_url,
|
672
|
+
response=_response
|
673
|
+
)
|
674
|
+
end
|
675
|
+
|
676
|
+
return _response.body.empty? ? '' : _response.parse
|
677
|
+
end
|
678
|
+
|
679
|
+
def list_account_types_for_user()
|
680
|
+
_url = @_base_url + "/accounts/types"
|
681
|
+
_kwargs = {
|
682
|
+
params: {}
|
683
|
+
}
|
684
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
685
|
+
[:"netlifyAuth", ],
|
686
|
+
**_kwargs
|
687
|
+
)
|
688
|
+
|
689
|
+
|
690
|
+
_response = _http_client.get(
|
691
|
+
_url,
|
692
|
+
|
693
|
+
**_req_kwargs
|
694
|
+
)
|
695
|
+
|
696
|
+
# Raise if not expected success code
|
697
|
+
if _response.status != 200
|
698
|
+
raise RequestError.new(
|
699
|
+
method="get",
|
700
|
+
url=_url,
|
701
|
+
response=_response
|
702
|
+
)
|
703
|
+
end
|
704
|
+
|
705
|
+
return _response.body.empty? ? '' : _response.parse
|
706
|
+
end
|
707
|
+
|
708
|
+
def get_account(account_id)
|
709
|
+
_url = @_base_url + "/accounts/#{account_id}"
|
710
|
+
_kwargs = {
|
711
|
+
params: {}
|
712
|
+
}
|
713
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
714
|
+
[:"netlifyAuth", ],
|
715
|
+
**_kwargs
|
716
|
+
)
|
717
|
+
|
718
|
+
|
719
|
+
_response = _http_client.get(
|
720
|
+
_url,
|
721
|
+
|
722
|
+
**_req_kwargs
|
723
|
+
)
|
724
|
+
|
725
|
+
# Raise if not expected success code
|
726
|
+
if _response.status != 200
|
727
|
+
raise RequestError.new(
|
728
|
+
method="get",
|
729
|
+
url=_url,
|
730
|
+
response=_response
|
731
|
+
)
|
732
|
+
end
|
733
|
+
|
734
|
+
return _response.body.empty? ? '' : _response.parse
|
735
|
+
end
|
736
|
+
|
737
|
+
def list_account_audit_events(account_id, log_type: nil, page: nil, per_page: nil, query: nil)
|
738
|
+
_url = @_base_url + "/accounts/#{account_id}/audit"
|
739
|
+
_kwargs = {
|
740
|
+
params: {}
|
741
|
+
}
|
742
|
+
if log_type != nil
|
743
|
+
_kwargs[:params][:"log_type"] = log_type
|
744
|
+
end
|
745
|
+
if page != nil
|
746
|
+
_kwargs[:params][:"page"] = page
|
747
|
+
end
|
748
|
+
if per_page != nil
|
749
|
+
_kwargs[:params][:"per_page"] = per_page
|
750
|
+
end
|
751
|
+
if query != nil
|
752
|
+
_kwargs[:params][:"query"] = query
|
753
|
+
end
|
754
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
755
|
+
[:"netlifyAuth", ],
|
756
|
+
**_kwargs
|
757
|
+
)
|
758
|
+
|
759
|
+
|
760
|
+
_response = _http_client.get(
|
761
|
+
_url,
|
762
|
+
|
763
|
+
**_req_kwargs
|
764
|
+
)
|
765
|
+
|
766
|
+
# Raise if not expected success code
|
767
|
+
if _response.status != 200
|
768
|
+
raise RequestError.new(
|
769
|
+
method="get",
|
770
|
+
url=_url,
|
771
|
+
response=_response
|
772
|
+
)
|
773
|
+
end
|
774
|
+
|
775
|
+
return _response.body.empty? ? '' : _response.parse
|
776
|
+
end
|
777
|
+
|
778
|
+
# Returns all environment variables for an account or site. An account corresponds to a team in the Netlify UI. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>. Migrate now with the Netlify UI.
|
779
|
+
def get_env_vars(account_id, context_name: nil, scope: nil, site_id: nil)
|
780
|
+
_url = @_base_url + "/accounts/#{account_id}/env"
|
781
|
+
_kwargs = {
|
782
|
+
params: {}
|
783
|
+
}
|
784
|
+
if context_name != nil
|
785
|
+
_kwargs[:params][:"context_name"] = context_name
|
786
|
+
end
|
787
|
+
if scope != nil
|
788
|
+
_kwargs[:params][:"scope"] = scope
|
789
|
+
end
|
790
|
+
if site_id != nil
|
791
|
+
_kwargs[:params][:"site_id"] = site_id
|
792
|
+
end
|
793
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
794
|
+
[:"netlifyAuth", ],
|
795
|
+
**_kwargs
|
796
|
+
)
|
797
|
+
|
798
|
+
|
799
|
+
_response = _http_client.get(
|
800
|
+
_url,
|
801
|
+
|
802
|
+
**_req_kwargs
|
803
|
+
)
|
804
|
+
|
805
|
+
# Raise if not expected success code
|
806
|
+
if _response.status != 200
|
807
|
+
raise RequestError.new(
|
808
|
+
method="get",
|
809
|
+
url=_url,
|
810
|
+
response=_response
|
811
|
+
)
|
812
|
+
end
|
813
|
+
|
814
|
+
return _response.body.empty? ? '' : _response.parse
|
815
|
+
end
|
816
|
+
|
817
|
+
# Returns an individual environment variable. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>. Migrate now with the Netlify UI.
|
818
|
+
def get_env_var(account_id, key, site_id: nil)
|
819
|
+
_url = @_base_url + "/accounts/#{account_id}/env/#{key}"
|
820
|
+
_kwargs = {
|
821
|
+
params: {}
|
822
|
+
}
|
823
|
+
if site_id != nil
|
824
|
+
_kwargs[:params][:"site_id"] = site_id
|
825
|
+
end
|
826
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
827
|
+
[:"netlifyAuth", ],
|
828
|
+
**_kwargs
|
829
|
+
)
|
830
|
+
|
831
|
+
|
832
|
+
_response = _http_client.get(
|
833
|
+
_url,
|
834
|
+
|
835
|
+
**_req_kwargs
|
836
|
+
)
|
837
|
+
|
838
|
+
# Raise if not expected success code
|
839
|
+
if _response.status != 200
|
840
|
+
raise RequestError.new(
|
841
|
+
method="get",
|
842
|
+
url=_url,
|
843
|
+
response=_response
|
844
|
+
)
|
845
|
+
end
|
846
|
+
|
847
|
+
return _response.body.empty? ? '' : _response.parse
|
848
|
+
end
|
849
|
+
|
850
|
+
# Returns all environment variables for a site. This convenience method behaves the same as `getEnvVars` but doesn't require an `account_id` as input.
|
851
|
+
def get_site_env_vars(site_id, context_name: nil, scope: nil)
|
852
|
+
_url = @_base_url + "/api/v1/sites/#{site_id}/env"
|
853
|
+
_kwargs = {
|
854
|
+
params: {}
|
855
|
+
}
|
856
|
+
if context_name != nil
|
857
|
+
_kwargs[:params][:"context_name"] = context_name
|
858
|
+
end
|
859
|
+
if scope != nil
|
860
|
+
_kwargs[:params][:"scope"] = scope
|
861
|
+
end
|
862
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
863
|
+
[:"netlifyAuth", ],
|
864
|
+
**_kwargs
|
865
|
+
)
|
866
|
+
|
867
|
+
|
868
|
+
_response = _http_client.get(
|
869
|
+
_url,
|
870
|
+
|
871
|
+
**_req_kwargs
|
872
|
+
)
|
873
|
+
|
874
|
+
# Raise if not expected success code
|
875
|
+
if _response.status != 200
|
876
|
+
raise RequestError.new(
|
877
|
+
method="get",
|
878
|
+
url=_url,
|
879
|
+
response=_response
|
880
|
+
)
|
881
|
+
end
|
882
|
+
|
883
|
+
return _response.body.empty? ? '' : _response.parse
|
884
|
+
end
|
885
|
+
|
886
|
+
def list_payment_methods_for_user()
|
887
|
+
_url = @_base_url + "/billing/payment_methods"
|
888
|
+
_kwargs = {
|
889
|
+
params: {}
|
890
|
+
}
|
891
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
892
|
+
[:"netlifyAuth", ],
|
893
|
+
**_kwargs
|
894
|
+
)
|
895
|
+
|
896
|
+
|
897
|
+
_response = _http_client.get(
|
898
|
+
_url,
|
899
|
+
|
900
|
+
**_req_kwargs
|
901
|
+
)
|
902
|
+
|
903
|
+
# Raise if not expected success code
|
904
|
+
if _response.status != 200
|
905
|
+
raise RequestError.new(
|
906
|
+
method="get",
|
907
|
+
url=_url,
|
908
|
+
response=_response
|
909
|
+
)
|
910
|
+
end
|
911
|
+
|
912
|
+
return _response.body.empty? ? '' : _response.parse
|
913
|
+
end
|
914
|
+
|
915
|
+
def get_site_build(build_id)
|
916
|
+
_url = @_base_url + "/builds/#{build_id}"
|
917
|
+
_kwargs = {
|
918
|
+
params: {}
|
919
|
+
}
|
920
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
921
|
+
[:"netlifyAuth", ],
|
922
|
+
**_kwargs
|
923
|
+
)
|
924
|
+
|
925
|
+
|
926
|
+
_response = _http_client.get(
|
927
|
+
_url,
|
928
|
+
|
929
|
+
**_req_kwargs
|
930
|
+
)
|
931
|
+
|
932
|
+
# Raise if not expected success code
|
933
|
+
if _response.status != 200
|
934
|
+
raise RequestError.new(
|
935
|
+
method="get",
|
936
|
+
url=_url,
|
937
|
+
response=_response
|
938
|
+
)
|
939
|
+
end
|
940
|
+
|
941
|
+
return _response.body.empty? ? '' : _response.parse
|
942
|
+
end
|
943
|
+
|
944
|
+
def list_deploy_keys()
|
945
|
+
_url = @_base_url + "/deploy_keys"
|
946
|
+
_kwargs = {
|
947
|
+
params: {}
|
948
|
+
}
|
949
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
950
|
+
[:"netlifyAuth", ],
|
951
|
+
**_kwargs
|
952
|
+
)
|
953
|
+
|
954
|
+
|
955
|
+
_response = _http_client.get(
|
956
|
+
_url,
|
957
|
+
|
958
|
+
**_req_kwargs
|
959
|
+
)
|
960
|
+
|
961
|
+
# Raise if not expected success code
|
962
|
+
if _response.status != 200
|
963
|
+
raise RequestError.new(
|
964
|
+
method="get",
|
965
|
+
url=_url,
|
966
|
+
response=_response
|
967
|
+
)
|
968
|
+
end
|
969
|
+
|
970
|
+
return _response.body.empty? ? '' : _response.parse
|
971
|
+
end
|
972
|
+
|
973
|
+
def get_deploy_key(key_id)
|
974
|
+
_url = @_base_url + "/deploy_keys/#{key_id}"
|
975
|
+
_kwargs = {
|
976
|
+
params: {}
|
977
|
+
}
|
978
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
979
|
+
[:"netlifyAuth", ],
|
980
|
+
**_kwargs
|
981
|
+
)
|
982
|
+
|
983
|
+
|
984
|
+
_response = _http_client.get(
|
985
|
+
_url,
|
986
|
+
|
987
|
+
**_req_kwargs
|
988
|
+
)
|
989
|
+
|
990
|
+
# Raise if not expected success code
|
991
|
+
if _response.status != 200
|
992
|
+
raise RequestError.new(
|
993
|
+
method="get",
|
994
|
+
url=_url,
|
995
|
+
response=_response
|
996
|
+
)
|
997
|
+
end
|
998
|
+
|
999
|
+
return _response.body.empty? ? '' : _response.parse
|
1000
|
+
end
|
1001
|
+
|
1002
|
+
def get_deploy(deploy_id)
|
1003
|
+
_url = @_base_url + "/deploys/#{deploy_id}"
|
1004
|
+
_kwargs = {
|
1005
|
+
params: {}
|
1006
|
+
}
|
1007
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1008
|
+
[:"netlifyAuth", ],
|
1009
|
+
**_kwargs
|
1010
|
+
)
|
1011
|
+
|
1012
|
+
|
1013
|
+
_response = _http_client.get(
|
1014
|
+
_url,
|
1015
|
+
|
1016
|
+
**_req_kwargs
|
1017
|
+
)
|
1018
|
+
|
1019
|
+
# Raise if not expected success code
|
1020
|
+
if _response.status != 200
|
1021
|
+
raise RequestError.new(
|
1022
|
+
method="get",
|
1023
|
+
url=_url,
|
1024
|
+
response=_response
|
1025
|
+
)
|
1026
|
+
end
|
1027
|
+
|
1028
|
+
return _response.body.empty? ? '' : _response.parse
|
1029
|
+
end
|
1030
|
+
|
1031
|
+
def get_dns_zones(account_slug: nil)
|
1032
|
+
_url = @_base_url + "/dns_zones"
|
1033
|
+
_kwargs = {
|
1034
|
+
params: {}
|
1035
|
+
}
|
1036
|
+
if account_slug != nil
|
1037
|
+
_kwargs[:params][:"account_slug"] = account_slug
|
1038
|
+
end
|
1039
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1040
|
+
[:"netlifyAuth", ],
|
1041
|
+
**_kwargs
|
1042
|
+
)
|
1043
|
+
|
1044
|
+
|
1045
|
+
_response = _http_client.get(
|
1046
|
+
_url,
|
1047
|
+
|
1048
|
+
**_req_kwargs
|
1049
|
+
)
|
1050
|
+
|
1051
|
+
# Raise if not expected success code
|
1052
|
+
if _response.status != 200
|
1053
|
+
raise RequestError.new(
|
1054
|
+
method="get",
|
1055
|
+
url=_url,
|
1056
|
+
response=_response
|
1057
|
+
)
|
1058
|
+
end
|
1059
|
+
|
1060
|
+
return _response.body.empty? ? '' : _response.parse
|
1061
|
+
end
|
1062
|
+
|
1063
|
+
def get_dns_zone(zone_id)
|
1064
|
+
_url = @_base_url + "/dns_zones/#{zone_id}"
|
1065
|
+
_kwargs = {
|
1066
|
+
params: {}
|
1067
|
+
}
|
1068
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1069
|
+
[:"netlifyAuth", ],
|
1070
|
+
**_kwargs
|
1071
|
+
)
|
1072
|
+
|
1073
|
+
|
1074
|
+
_response = _http_client.get(
|
1075
|
+
_url,
|
1076
|
+
|
1077
|
+
**_req_kwargs
|
1078
|
+
)
|
1079
|
+
|
1080
|
+
# Raise if not expected success code
|
1081
|
+
if _response.status != 200
|
1082
|
+
raise RequestError.new(
|
1083
|
+
method="get",
|
1084
|
+
url=_url,
|
1085
|
+
response=_response
|
1086
|
+
)
|
1087
|
+
end
|
1088
|
+
|
1089
|
+
return _response.body.empty? ? '' : _response.parse
|
1090
|
+
end
|
1091
|
+
|
1092
|
+
def get_dns_records(zone_id)
|
1093
|
+
_url = @_base_url + "/dns_zones/#{zone_id}/dns_records"
|
1094
|
+
_kwargs = {
|
1095
|
+
params: {}
|
1096
|
+
}
|
1097
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1098
|
+
[:"netlifyAuth", ],
|
1099
|
+
**_kwargs
|
1100
|
+
)
|
1101
|
+
|
1102
|
+
|
1103
|
+
_response = _http_client.get(
|
1104
|
+
_url,
|
1105
|
+
|
1106
|
+
**_req_kwargs
|
1107
|
+
)
|
1108
|
+
|
1109
|
+
# Raise if not expected success code
|
1110
|
+
if _response.status != 200
|
1111
|
+
raise RequestError.new(
|
1112
|
+
method="get",
|
1113
|
+
url=_url,
|
1114
|
+
response=_response
|
1115
|
+
)
|
1116
|
+
end
|
1117
|
+
|
1118
|
+
return _response.body.empty? ? '' : _response.parse
|
1119
|
+
end
|
1120
|
+
|
1121
|
+
def get_individual_dns_record(zone_id, dns_record_id)
|
1122
|
+
_url = @_base_url + "/dns_zones/#{zone_id}/dns_records/#{dns_record_id}"
|
1123
|
+
_kwargs = {
|
1124
|
+
params: {}
|
1125
|
+
}
|
1126
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1127
|
+
[:"netlifyAuth", ],
|
1128
|
+
**_kwargs
|
1129
|
+
)
|
1130
|
+
|
1131
|
+
|
1132
|
+
_response = _http_client.get(
|
1133
|
+
_url,
|
1134
|
+
|
1135
|
+
**_req_kwargs
|
1136
|
+
)
|
1137
|
+
|
1138
|
+
# Raise if not expected success code
|
1139
|
+
if _response.status != 200
|
1140
|
+
raise RequestError.new(
|
1141
|
+
method="get",
|
1142
|
+
url=_url,
|
1143
|
+
response=_response
|
1144
|
+
)
|
1145
|
+
end
|
1146
|
+
|
1147
|
+
return _response.body.empty? ? '' : _response.parse
|
1148
|
+
end
|
1149
|
+
|
1150
|
+
def list_form_submissions(form_id, page: nil, per_page: nil)
|
1151
|
+
_url = @_base_url + "/forms/#{form_id}/submissions"
|
1152
|
+
_kwargs = {
|
1153
|
+
params: {}
|
1154
|
+
}
|
1155
|
+
if page != nil
|
1156
|
+
_kwargs[:params][:"page"] = page
|
1157
|
+
end
|
1158
|
+
if per_page != nil
|
1159
|
+
_kwargs[:params][:"per_page"] = per_page
|
1160
|
+
end
|
1161
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1162
|
+
[:"netlifyAuth", ],
|
1163
|
+
**_kwargs
|
1164
|
+
)
|
1165
|
+
|
1166
|
+
|
1167
|
+
_response = _http_client.get(
|
1168
|
+
_url,
|
1169
|
+
|
1170
|
+
**_req_kwargs
|
1171
|
+
)
|
1172
|
+
|
1173
|
+
# Raise if not expected success code
|
1174
|
+
if _response.status != 200
|
1175
|
+
raise RequestError.new(
|
1176
|
+
method="get",
|
1177
|
+
url=_url,
|
1178
|
+
response=_response
|
1179
|
+
)
|
1180
|
+
end
|
1181
|
+
|
1182
|
+
return _response.body.empty? ? '' : _response.parse
|
1183
|
+
end
|
1184
|
+
|
1185
|
+
def list_hooks_by_site_id(site_id)
|
1186
|
+
_url = @_base_url + "/hooks"
|
1187
|
+
_kwargs = {
|
1188
|
+
params: {}
|
1189
|
+
}
|
1190
|
+
_kwargs[:params][:"site_id"] = site_id
|
1191
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1192
|
+
[:"netlifyAuth", ],
|
1193
|
+
**_kwargs
|
1194
|
+
)
|
1195
|
+
|
1196
|
+
|
1197
|
+
_response = _http_client.get(
|
1198
|
+
_url,
|
1199
|
+
|
1200
|
+
**_req_kwargs
|
1201
|
+
)
|
1202
|
+
|
1203
|
+
# Raise if not expected success code
|
1204
|
+
if _response.status != 200
|
1205
|
+
raise RequestError.new(
|
1206
|
+
method="get",
|
1207
|
+
url=_url,
|
1208
|
+
response=_response
|
1209
|
+
)
|
1210
|
+
end
|
1211
|
+
|
1212
|
+
return _response.body.empty? ? '' : _response.parse
|
1213
|
+
end
|
1214
|
+
|
1215
|
+
def list_hook_types()
|
1216
|
+
_url = @_base_url + "/hooks/types"
|
1217
|
+
_kwargs = {
|
1218
|
+
params: {}
|
1219
|
+
}
|
1220
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1221
|
+
[:"netlifyAuth", ],
|
1222
|
+
**_kwargs
|
1223
|
+
)
|
1224
|
+
|
1225
|
+
|
1226
|
+
_response = _http_client.get(
|
1227
|
+
_url,
|
1228
|
+
|
1229
|
+
**_req_kwargs
|
1230
|
+
)
|
1231
|
+
|
1232
|
+
# Raise if not expected success code
|
1233
|
+
if _response.status != 200
|
1234
|
+
raise RequestError.new(
|
1235
|
+
method="get",
|
1236
|
+
url=_url,
|
1237
|
+
response=_response
|
1238
|
+
)
|
1239
|
+
end
|
1240
|
+
|
1241
|
+
return _response.body.empty? ? '' : _response.parse
|
1242
|
+
end
|
1243
|
+
|
1244
|
+
def get_hook(hook_id)
|
1245
|
+
_url = @_base_url + "/hooks/#{hook_id}"
|
1246
|
+
_kwargs = {
|
1247
|
+
params: {}
|
1248
|
+
}
|
1249
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1250
|
+
[:"netlifyAuth", ],
|
1251
|
+
**_kwargs
|
1252
|
+
)
|
1253
|
+
|
1254
|
+
|
1255
|
+
_response = _http_client.get(
|
1256
|
+
_url,
|
1257
|
+
|
1258
|
+
**_req_kwargs
|
1259
|
+
)
|
1260
|
+
|
1261
|
+
# Raise if not expected success code
|
1262
|
+
if _response.status != 200
|
1263
|
+
raise RequestError.new(
|
1264
|
+
method="get",
|
1265
|
+
url=_url,
|
1266
|
+
response=_response
|
1267
|
+
)
|
1268
|
+
end
|
1269
|
+
|
1270
|
+
return _response.body.empty? ? '' : _response.parse
|
1271
|
+
end
|
1272
|
+
|
1273
|
+
def show_ticket(ticket_id)
|
1274
|
+
_url = @_base_url + "/oauth/tickets/#{ticket_id}"
|
1275
|
+
_kwargs = {
|
1276
|
+
params: {}
|
1277
|
+
}
|
1278
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1279
|
+
[:"netlifyAuth", ],
|
1280
|
+
**_kwargs
|
1281
|
+
)
|
1282
|
+
|
1283
|
+
|
1284
|
+
_response = _http_client.get(
|
1285
|
+
_url,
|
1286
|
+
|
1287
|
+
**_req_kwargs
|
1288
|
+
)
|
1289
|
+
|
1290
|
+
# Raise if not expected success code
|
1291
|
+
if _response.status != 200
|
1292
|
+
raise RequestError.new(
|
1293
|
+
method="get",
|
1294
|
+
url=_url,
|
1295
|
+
response=_response
|
1296
|
+
)
|
1297
|
+
end
|
1298
|
+
|
1299
|
+
return _response.body.empty? ? '' : _response.parse
|
1300
|
+
end
|
1301
|
+
|
1302
|
+
def get_services(search: nil)
|
1303
|
+
_url = @_base_url + "/services/"
|
1304
|
+
_kwargs = {
|
1305
|
+
params: {}
|
1306
|
+
}
|
1307
|
+
if search != nil
|
1308
|
+
_kwargs[:params][:"search"] = search
|
1309
|
+
end
|
1310
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1311
|
+
[:"netlifyAuth", ],
|
1312
|
+
**_kwargs
|
1313
|
+
)
|
1314
|
+
|
1315
|
+
|
1316
|
+
_response = _http_client.get(
|
1317
|
+
_url,
|
1318
|
+
|
1319
|
+
**_req_kwargs
|
1320
|
+
)
|
1321
|
+
|
1322
|
+
# Raise if not expected success code
|
1323
|
+
if _response.status != 200
|
1324
|
+
raise RequestError.new(
|
1325
|
+
method="get",
|
1326
|
+
url=_url,
|
1327
|
+
response=_response
|
1328
|
+
)
|
1329
|
+
end
|
1330
|
+
|
1331
|
+
return _response.body.empty? ? '' : _response.parse
|
1332
|
+
end
|
1333
|
+
|
1334
|
+
def show_service(addon_name)
|
1335
|
+
_url = @_base_url + "/services/#{addon_name}"
|
1336
|
+
_kwargs = {
|
1337
|
+
params: {}
|
1338
|
+
}
|
1339
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1340
|
+
[:"netlifyAuth", ],
|
1341
|
+
**_kwargs
|
1342
|
+
)
|
1343
|
+
|
1344
|
+
|
1345
|
+
_response = _http_client.get(
|
1346
|
+
_url,
|
1347
|
+
|
1348
|
+
**_req_kwargs
|
1349
|
+
)
|
1350
|
+
|
1351
|
+
# Raise if not expected success code
|
1352
|
+
if _response.status != 200
|
1353
|
+
raise RequestError.new(
|
1354
|
+
method="get",
|
1355
|
+
url=_url,
|
1356
|
+
response=_response
|
1357
|
+
)
|
1358
|
+
end
|
1359
|
+
|
1360
|
+
return _response.body.empty? ? '' : _response.parse
|
1361
|
+
end
|
1362
|
+
|
1363
|
+
def show_service_manifest(addon_name)
|
1364
|
+
_url = @_base_url + "/services/#{addon_name}/manifest"
|
1365
|
+
_kwargs = {
|
1366
|
+
params: {}
|
1367
|
+
}
|
1368
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1369
|
+
[:"netlifyAuth", ],
|
1370
|
+
**_kwargs
|
1371
|
+
)
|
1372
|
+
|
1373
|
+
|
1374
|
+
_response = _http_client.get(
|
1375
|
+
_url,
|
1376
|
+
|
1377
|
+
**_req_kwargs
|
1378
|
+
)
|
1379
|
+
|
1380
|
+
# Raise if not expected success code
|
1381
|
+
if _response.status != 201
|
1382
|
+
raise RequestError.new(
|
1383
|
+
method="get",
|
1384
|
+
url=_url,
|
1385
|
+
response=_response
|
1386
|
+
)
|
1387
|
+
end
|
1388
|
+
|
1389
|
+
return _response.body.empty? ? '' : _response.parse
|
1390
|
+
end
|
1391
|
+
|
1392
|
+
# **Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [getEnvVars](#tag/environmentVariables/operation/getEnvVars) to retrieve site environment variables.
|
1393
|
+
def list_sites(filter: nil, name: nil, page: nil, per_page: nil)
|
1394
|
+
_url = @_base_url + "/sites"
|
1395
|
+
_kwargs = {
|
1396
|
+
params: {}
|
1397
|
+
}
|
1398
|
+
if filter != nil
|
1399
|
+
_kwargs[:params][:"filter"] = filter
|
1400
|
+
end
|
1401
|
+
if name != nil
|
1402
|
+
_kwargs[:params][:"name"] = name
|
1403
|
+
end
|
1404
|
+
if page != nil
|
1405
|
+
_kwargs[:params][:"page"] = page
|
1406
|
+
end
|
1407
|
+
if per_page != nil
|
1408
|
+
_kwargs[:params][:"per_page"] = per_page
|
1409
|
+
end
|
1410
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1411
|
+
[:"netlifyAuth", ],
|
1412
|
+
**_kwargs
|
1413
|
+
)
|
1414
|
+
|
1415
|
+
|
1416
|
+
_response = _http_client.get(
|
1417
|
+
_url,
|
1418
|
+
|
1419
|
+
**_req_kwargs
|
1420
|
+
)
|
1421
|
+
|
1422
|
+
# Raise if not expected success code
|
1423
|
+
if _response.status != 200
|
1424
|
+
raise RequestError.new(
|
1425
|
+
method="get",
|
1426
|
+
url=_url,
|
1427
|
+
response=_response
|
1428
|
+
)
|
1429
|
+
end
|
1430
|
+
|
1431
|
+
return _response.body.empty? ? '' : _response.parse
|
1432
|
+
end
|
1433
|
+
|
1434
|
+
# **Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [getEnvVars](#tag/environmentVariables/operation/getEnvVars) to retrieve site environment variables.
|
1435
|
+
def get_site(site_id)
|
1436
|
+
_url = @_base_url + "/sites/#{site_id}"
|
1437
|
+
_kwargs = {
|
1438
|
+
params: {}
|
1439
|
+
}
|
1440
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1441
|
+
[:"netlifyAuth", ],
|
1442
|
+
**_kwargs
|
1443
|
+
)
|
1444
|
+
|
1445
|
+
|
1446
|
+
_response = _http_client.get(
|
1447
|
+
_url,
|
1448
|
+
|
1449
|
+
**_req_kwargs
|
1450
|
+
)
|
1451
|
+
|
1452
|
+
# Raise if not expected success code
|
1453
|
+
if _response.status != 200
|
1454
|
+
raise RequestError.new(
|
1455
|
+
method="get",
|
1456
|
+
url=_url,
|
1457
|
+
response=_response
|
1458
|
+
)
|
1459
|
+
end
|
1460
|
+
|
1461
|
+
return _response.body.empty? ? '' : _response.parse
|
1462
|
+
end
|
1463
|
+
|
1464
|
+
def list_site_assets(site_id)
|
1465
|
+
_url = @_base_url + "/sites/#{site_id}/assets"
|
1466
|
+
_kwargs = {
|
1467
|
+
params: {}
|
1468
|
+
}
|
1469
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1470
|
+
[:"netlifyAuth", ],
|
1471
|
+
**_kwargs
|
1472
|
+
)
|
1473
|
+
|
1474
|
+
|
1475
|
+
_response = _http_client.get(
|
1476
|
+
_url,
|
1477
|
+
|
1478
|
+
**_req_kwargs
|
1479
|
+
)
|
1480
|
+
|
1481
|
+
# Raise if not expected success code
|
1482
|
+
if _response.status != 200
|
1483
|
+
raise RequestError.new(
|
1484
|
+
method="get",
|
1485
|
+
url=_url,
|
1486
|
+
response=_response
|
1487
|
+
)
|
1488
|
+
end
|
1489
|
+
|
1490
|
+
return _response.body.empty? ? '' : _response.parse
|
1491
|
+
end
|
1492
|
+
|
1493
|
+
def get_site_asset_info(site_id, asset_id)
|
1494
|
+
_url = @_base_url + "/sites/#{site_id}/assets/#{asset_id}"
|
1495
|
+
_kwargs = {
|
1496
|
+
params: {}
|
1497
|
+
}
|
1498
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1499
|
+
[:"netlifyAuth", ],
|
1500
|
+
**_kwargs
|
1501
|
+
)
|
1502
|
+
|
1503
|
+
|
1504
|
+
_response = _http_client.get(
|
1505
|
+
_url,
|
1506
|
+
|
1507
|
+
**_req_kwargs
|
1508
|
+
)
|
1509
|
+
|
1510
|
+
# Raise if not expected success code
|
1511
|
+
if _response.status != 200
|
1512
|
+
raise RequestError.new(
|
1513
|
+
method="get",
|
1514
|
+
url=_url,
|
1515
|
+
response=_response
|
1516
|
+
)
|
1517
|
+
end
|
1518
|
+
|
1519
|
+
return _response.body.empty? ? '' : _response.parse
|
1520
|
+
end
|
1521
|
+
|
1522
|
+
def get_site_asset_public_signature(site_id, asset_id)
|
1523
|
+
_url = @_base_url + "/sites/#{site_id}/assets/#{asset_id}/public_signature"
|
1524
|
+
_kwargs = {
|
1525
|
+
params: {}
|
1526
|
+
}
|
1527
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1528
|
+
[:"netlifyAuth", ],
|
1529
|
+
**_kwargs
|
1530
|
+
)
|
1531
|
+
|
1532
|
+
|
1533
|
+
_response = _http_client.get(
|
1534
|
+
_url,
|
1535
|
+
|
1536
|
+
**_req_kwargs
|
1537
|
+
)
|
1538
|
+
|
1539
|
+
# Raise if not expected success code
|
1540
|
+
if _response.status != 200
|
1541
|
+
raise RequestError.new(
|
1542
|
+
method="get",
|
1543
|
+
url=_url,
|
1544
|
+
response=_response
|
1545
|
+
)
|
1546
|
+
end
|
1547
|
+
|
1548
|
+
return _response.body.empty? ? '' : _response.parse
|
1549
|
+
end
|
1550
|
+
|
1551
|
+
def list_site_build_hooks(site_id)
|
1552
|
+
_url = @_base_url + "/sites/#{site_id}/build_hooks"
|
1553
|
+
_kwargs = {
|
1554
|
+
params: {}
|
1555
|
+
}
|
1556
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1557
|
+
[:"netlifyAuth", ],
|
1558
|
+
**_kwargs
|
1559
|
+
)
|
1560
|
+
|
1561
|
+
|
1562
|
+
_response = _http_client.get(
|
1563
|
+
_url,
|
1564
|
+
|
1565
|
+
**_req_kwargs
|
1566
|
+
)
|
1567
|
+
|
1568
|
+
# Raise if not expected success code
|
1569
|
+
if _response.status != 200
|
1570
|
+
raise RequestError.new(
|
1571
|
+
method="get",
|
1572
|
+
url=_url,
|
1573
|
+
response=_response
|
1574
|
+
)
|
1575
|
+
end
|
1576
|
+
|
1577
|
+
return _response.body.empty? ? '' : _response.parse
|
1578
|
+
end
|
1579
|
+
|
1580
|
+
def get_site_build_hook(site_id, id)
|
1581
|
+
_url = @_base_url + "/sites/#{site_id}/build_hooks/#{id}"
|
1582
|
+
_kwargs = {
|
1583
|
+
params: {}
|
1584
|
+
}
|
1585
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1586
|
+
[:"netlifyAuth", ],
|
1587
|
+
**_kwargs
|
1588
|
+
)
|
1589
|
+
|
1590
|
+
|
1591
|
+
_response = _http_client.get(
|
1592
|
+
_url,
|
1593
|
+
|
1594
|
+
**_req_kwargs
|
1595
|
+
)
|
1596
|
+
|
1597
|
+
# Raise if not expected success code
|
1598
|
+
if _response.status != 200
|
1599
|
+
raise RequestError.new(
|
1600
|
+
method="get",
|
1601
|
+
url=_url,
|
1602
|
+
response=_response
|
1603
|
+
)
|
1604
|
+
end
|
1605
|
+
|
1606
|
+
return _response.body.empty? ? '' : _response.parse
|
1607
|
+
end
|
1608
|
+
|
1609
|
+
def list_site_builds(site_id, page: nil, per_page: nil)
|
1610
|
+
_url = @_base_url + "/sites/#{site_id}/builds"
|
1611
|
+
_kwargs = {
|
1612
|
+
params: {}
|
1613
|
+
}
|
1614
|
+
if page != nil
|
1615
|
+
_kwargs[:params][:"page"] = page
|
1616
|
+
end
|
1617
|
+
if per_page != nil
|
1618
|
+
_kwargs[:params][:"per_page"] = per_page
|
1619
|
+
end
|
1620
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1621
|
+
[:"netlifyAuth", ],
|
1622
|
+
**_kwargs
|
1623
|
+
)
|
1624
|
+
|
1625
|
+
|
1626
|
+
_response = _http_client.get(
|
1627
|
+
_url,
|
1628
|
+
|
1629
|
+
**_req_kwargs
|
1630
|
+
)
|
1631
|
+
|
1632
|
+
# Raise if not expected success code
|
1633
|
+
if _response.status != 200
|
1634
|
+
raise RequestError.new(
|
1635
|
+
method="get",
|
1636
|
+
url=_url,
|
1637
|
+
response=_response
|
1638
|
+
)
|
1639
|
+
end
|
1640
|
+
|
1641
|
+
return _response.body.empty? ? '' : _response.parse
|
1642
|
+
end
|
1643
|
+
|
1644
|
+
def list_site_deployed_branches(site_id)
|
1645
|
+
_url = @_base_url + "/sites/#{site_id}/deployed-branches"
|
1646
|
+
_kwargs = {
|
1647
|
+
params: {}
|
1648
|
+
}
|
1649
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1650
|
+
[:"netlifyAuth", ],
|
1651
|
+
**_kwargs
|
1652
|
+
)
|
1653
|
+
|
1654
|
+
|
1655
|
+
_response = _http_client.get(
|
1656
|
+
_url,
|
1657
|
+
|
1658
|
+
**_req_kwargs
|
1659
|
+
)
|
1660
|
+
|
1661
|
+
# Raise if not expected success code
|
1662
|
+
if _response.status != 200
|
1663
|
+
raise RequestError.new(
|
1664
|
+
method="get",
|
1665
|
+
url=_url,
|
1666
|
+
response=_response
|
1667
|
+
)
|
1668
|
+
end
|
1669
|
+
|
1670
|
+
return _response.body.empty? ? '' : _response.parse
|
1671
|
+
end
|
1672
|
+
|
1673
|
+
def list_site_deploys(site_id, branch: nil, deploy_previews: nil, latest_published: nil, page: nil, per_page: nil, production: nil, state: nil)
|
1674
|
+
_url = @_base_url + "/sites/#{site_id}/deploys"
|
1675
|
+
_kwargs = {
|
1676
|
+
params: {}
|
1677
|
+
}
|
1678
|
+
if branch != nil
|
1679
|
+
_kwargs[:params][:"branch"] = branch
|
1680
|
+
end
|
1681
|
+
if deploy_previews != nil
|
1682
|
+
_kwargs[:params][:"deploy-previews"] = deploy_previews
|
1683
|
+
end
|
1684
|
+
if latest_published != nil
|
1685
|
+
_kwargs[:params][:"latest-published"] = latest_published
|
1686
|
+
end
|
1687
|
+
if page != nil
|
1688
|
+
_kwargs[:params][:"page"] = page
|
1689
|
+
end
|
1690
|
+
if per_page != nil
|
1691
|
+
_kwargs[:params][:"per_page"] = per_page
|
1692
|
+
end
|
1693
|
+
if production != nil
|
1694
|
+
_kwargs[:params][:"production"] = production
|
1695
|
+
end
|
1696
|
+
if state != nil
|
1697
|
+
_kwargs[:params][:"state"] = state
|
1698
|
+
end
|
1699
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1700
|
+
[:"netlifyAuth", ],
|
1701
|
+
**_kwargs
|
1702
|
+
)
|
1703
|
+
|
1704
|
+
|
1705
|
+
_response = _http_client.get(
|
1706
|
+
_url,
|
1707
|
+
|
1708
|
+
**_req_kwargs
|
1709
|
+
)
|
1710
|
+
|
1711
|
+
# Raise if not expected success code
|
1712
|
+
if _response.status != 200
|
1713
|
+
raise RequestError.new(
|
1714
|
+
method="get",
|
1715
|
+
url=_url,
|
1716
|
+
response=_response
|
1717
|
+
)
|
1718
|
+
end
|
1719
|
+
|
1720
|
+
return _response.body.empty? ? '' : _response.parse
|
1721
|
+
end
|
1722
|
+
|
1723
|
+
def get_site_deploy(site_id, deploy_id)
|
1724
|
+
_url = @_base_url + "/sites/#{site_id}/deploys/#{deploy_id}"
|
1725
|
+
_kwargs = {
|
1726
|
+
params: {}
|
1727
|
+
}
|
1728
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1729
|
+
[:"netlifyAuth", ],
|
1730
|
+
**_kwargs
|
1731
|
+
)
|
1732
|
+
|
1733
|
+
|
1734
|
+
_response = _http_client.get(
|
1735
|
+
_url,
|
1736
|
+
|
1737
|
+
**_req_kwargs
|
1738
|
+
)
|
1739
|
+
|
1740
|
+
# Raise if not expected success code
|
1741
|
+
if _response.status != 200
|
1742
|
+
raise RequestError.new(
|
1743
|
+
method="get",
|
1744
|
+
url=_url,
|
1745
|
+
response=_response
|
1746
|
+
)
|
1747
|
+
end
|
1748
|
+
|
1749
|
+
return _response.body.empty? ? '' : _response.parse
|
1750
|
+
end
|
1751
|
+
|
1752
|
+
def get_dns_for_site(site_id)
|
1753
|
+
_url = @_base_url + "/sites/#{site_id}/dns"
|
1754
|
+
_kwargs = {
|
1755
|
+
params: {}
|
1756
|
+
}
|
1757
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1758
|
+
[:"netlifyAuth", ],
|
1759
|
+
**_kwargs
|
1760
|
+
)
|
1761
|
+
|
1762
|
+
|
1763
|
+
_response = _http_client.get(
|
1764
|
+
_url,
|
1765
|
+
|
1766
|
+
**_req_kwargs
|
1767
|
+
)
|
1768
|
+
|
1769
|
+
# Raise if not expected success code
|
1770
|
+
if _response.status != 200
|
1771
|
+
raise RequestError.new(
|
1772
|
+
method="get",
|
1773
|
+
url=_url,
|
1774
|
+
response=_response
|
1775
|
+
)
|
1776
|
+
end
|
1777
|
+
|
1778
|
+
return _response.body.empty? ? '' : _response.parse
|
1779
|
+
end
|
1780
|
+
|
1781
|
+
def list_site_files(site_id)
|
1782
|
+
_url = @_base_url + "/sites/#{site_id}/files"
|
1783
|
+
_kwargs = {
|
1784
|
+
params: {}
|
1785
|
+
}
|
1786
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1787
|
+
[:"netlifyAuth", ],
|
1788
|
+
**_kwargs
|
1789
|
+
)
|
1790
|
+
|
1791
|
+
|
1792
|
+
_response = _http_client.get(
|
1793
|
+
_url,
|
1794
|
+
|
1795
|
+
**_req_kwargs
|
1796
|
+
)
|
1797
|
+
|
1798
|
+
# Raise if not expected success code
|
1799
|
+
if _response.status != 200
|
1800
|
+
raise RequestError.new(
|
1801
|
+
method="get",
|
1802
|
+
url=_url,
|
1803
|
+
response=_response
|
1804
|
+
)
|
1805
|
+
end
|
1806
|
+
|
1807
|
+
return _response.body.empty? ? '' : _response.parse
|
1808
|
+
end
|
1809
|
+
|
1810
|
+
def get_site_file_by_path_name(site_id, file_path)
|
1811
|
+
_url = @_base_url + "/sites/#{site_id}/files/#{file_path}"
|
1812
|
+
_kwargs = {
|
1813
|
+
params: {}
|
1814
|
+
}
|
1815
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1816
|
+
[:"netlifyAuth", ],
|
1817
|
+
**_kwargs
|
1818
|
+
)
|
1819
|
+
|
1820
|
+
|
1821
|
+
_response = _http_client.get(
|
1822
|
+
_url,
|
1823
|
+
|
1824
|
+
**_req_kwargs
|
1825
|
+
)
|
1826
|
+
|
1827
|
+
# Raise if not expected success code
|
1828
|
+
if _response.status != 200
|
1829
|
+
raise RequestError.new(
|
1830
|
+
method="get",
|
1831
|
+
url=_url,
|
1832
|
+
response=_response
|
1833
|
+
)
|
1834
|
+
end
|
1835
|
+
|
1836
|
+
return _response.body.empty? ? '' : _response.parse
|
1837
|
+
end
|
1838
|
+
|
1839
|
+
def list_site_forms(site_id)
|
1840
|
+
_url = @_base_url + "/sites/#{site_id}/forms"
|
1841
|
+
_kwargs = {
|
1842
|
+
params: {}
|
1843
|
+
}
|
1844
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1845
|
+
[:"netlifyAuth", ],
|
1846
|
+
**_kwargs
|
1847
|
+
)
|
1848
|
+
|
1849
|
+
|
1850
|
+
_response = _http_client.get(
|
1851
|
+
_url,
|
1852
|
+
|
1853
|
+
**_req_kwargs
|
1854
|
+
)
|
1855
|
+
|
1856
|
+
# Raise if not expected success code
|
1857
|
+
if _response.status != 200
|
1858
|
+
raise RequestError.new(
|
1859
|
+
method="get",
|
1860
|
+
url=_url,
|
1861
|
+
response=_response
|
1862
|
+
)
|
1863
|
+
end
|
1864
|
+
|
1865
|
+
return _response.body.empty? ? '' : _response.parse
|
1866
|
+
end
|
1867
|
+
|
1868
|
+
def search_site_functions(site_id, filter: nil)
|
1869
|
+
_url = @_base_url + "/sites/#{site_id}/functions"
|
1870
|
+
_kwargs = {
|
1871
|
+
params: {}
|
1872
|
+
}
|
1873
|
+
if filter != nil
|
1874
|
+
_kwargs[:params][:"filter"] = filter
|
1875
|
+
end
|
1876
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1877
|
+
[:"netlifyAuth", ],
|
1878
|
+
**_kwargs
|
1879
|
+
)
|
1880
|
+
|
1881
|
+
|
1882
|
+
_response = _http_client.get(
|
1883
|
+
_url,
|
1884
|
+
|
1885
|
+
**_req_kwargs
|
1886
|
+
)
|
1887
|
+
|
1888
|
+
# Raise if not expected success code
|
1889
|
+
if _response.status != 200
|
1890
|
+
raise RequestError.new(
|
1891
|
+
method="get",
|
1892
|
+
url=_url,
|
1893
|
+
response=_response
|
1894
|
+
)
|
1895
|
+
end
|
1896
|
+
|
1897
|
+
return _response.body.empty? ? '' : _response.parse
|
1898
|
+
end
|
1899
|
+
|
1900
|
+
def get_site_metadata(site_id)
|
1901
|
+
_url = @_base_url + "/sites/#{site_id}/metadata"
|
1902
|
+
_kwargs = {
|
1903
|
+
params: {}
|
1904
|
+
}
|
1905
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1906
|
+
[:"netlifyAuth", ],
|
1907
|
+
**_kwargs
|
1908
|
+
)
|
1909
|
+
|
1910
|
+
|
1911
|
+
_response = _http_client.get(
|
1912
|
+
_url,
|
1913
|
+
|
1914
|
+
**_req_kwargs
|
1915
|
+
)
|
1916
|
+
|
1917
|
+
# Raise if not expected success code
|
1918
|
+
if _response.status != 200
|
1919
|
+
raise RequestError.new(
|
1920
|
+
method="get",
|
1921
|
+
url=_url,
|
1922
|
+
response=_response
|
1923
|
+
)
|
1924
|
+
end
|
1925
|
+
|
1926
|
+
return _response.body.empty? ? '' : _response.parse
|
1927
|
+
end
|
1928
|
+
|
1929
|
+
def list_service_instances_for_site(site_id)
|
1930
|
+
_url = @_base_url + "/sites/#{site_id}/service-instances"
|
1931
|
+
_kwargs = {
|
1932
|
+
params: {}
|
1933
|
+
}
|
1934
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1935
|
+
[:"netlifyAuth", ],
|
1936
|
+
**_kwargs
|
1937
|
+
)
|
1938
|
+
|
1939
|
+
|
1940
|
+
_response = _http_client.get(
|
1941
|
+
_url,
|
1942
|
+
|
1943
|
+
**_req_kwargs
|
1944
|
+
)
|
1945
|
+
|
1946
|
+
# Raise if not expected success code
|
1947
|
+
if _response.status != 200
|
1948
|
+
raise RequestError.new(
|
1949
|
+
method="get",
|
1950
|
+
url=_url,
|
1951
|
+
response=_response
|
1952
|
+
)
|
1953
|
+
end
|
1954
|
+
|
1955
|
+
return _response.body.empty? ? '' : _response.parse
|
1956
|
+
end
|
1957
|
+
|
1958
|
+
def show_service_instance(site_id, addon, instance_id)
|
1959
|
+
_url = @_base_url + "/sites/#{site_id}/services/#{addon}/instances/#{instance_id}"
|
1960
|
+
_kwargs = {
|
1961
|
+
params: {}
|
1962
|
+
}
|
1963
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1964
|
+
[:"netlifyAuth", ],
|
1965
|
+
**_kwargs
|
1966
|
+
)
|
1967
|
+
|
1968
|
+
|
1969
|
+
_response = _http_client.get(
|
1970
|
+
_url,
|
1971
|
+
|
1972
|
+
**_req_kwargs
|
1973
|
+
)
|
1974
|
+
|
1975
|
+
# Raise if not expected success code
|
1976
|
+
if _response.status != 200
|
1977
|
+
raise RequestError.new(
|
1978
|
+
method="get",
|
1979
|
+
url=_url,
|
1980
|
+
response=_response
|
1981
|
+
)
|
1982
|
+
end
|
1983
|
+
|
1984
|
+
return _response.body.empty? ? '' : _response.parse
|
1985
|
+
end
|
1986
|
+
|
1987
|
+
def list_site_snippets(site_id)
|
1988
|
+
_url = @_base_url + "/sites/#{site_id}/snippets"
|
1989
|
+
_kwargs = {
|
1990
|
+
params: {}
|
1991
|
+
}
|
1992
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
1993
|
+
[:"netlifyAuth", ],
|
1994
|
+
**_kwargs
|
1995
|
+
)
|
1996
|
+
|
1997
|
+
|
1998
|
+
_response = _http_client.get(
|
1999
|
+
_url,
|
2000
|
+
|
2001
|
+
**_req_kwargs
|
2002
|
+
)
|
2003
|
+
|
2004
|
+
# Raise if not expected success code
|
2005
|
+
if _response.status != 200
|
2006
|
+
raise RequestError.new(
|
2007
|
+
method="get",
|
2008
|
+
url=_url,
|
2009
|
+
response=_response
|
2010
|
+
)
|
2011
|
+
end
|
2012
|
+
|
2013
|
+
return _response.body.empty? ? '' : _response.parse
|
2014
|
+
end
|
2015
|
+
|
2016
|
+
def get_site_snippet(site_id, snippet_id)
|
2017
|
+
_url = @_base_url + "/sites/#{site_id}/snippets/#{snippet_id}"
|
2018
|
+
_kwargs = {
|
2019
|
+
params: {}
|
2020
|
+
}
|
2021
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2022
|
+
[:"netlifyAuth", ],
|
2023
|
+
**_kwargs
|
2024
|
+
)
|
2025
|
+
|
2026
|
+
|
2027
|
+
_response = _http_client.get(
|
2028
|
+
_url,
|
2029
|
+
|
2030
|
+
**_req_kwargs
|
2031
|
+
)
|
2032
|
+
|
2033
|
+
# Raise if not expected success code
|
2034
|
+
if _response.status != 200
|
2035
|
+
raise RequestError.new(
|
2036
|
+
method="get",
|
2037
|
+
url=_url,
|
2038
|
+
response=_response
|
2039
|
+
)
|
2040
|
+
end
|
2041
|
+
|
2042
|
+
return _response.body.empty? ? '' : _response.parse
|
2043
|
+
end
|
2044
|
+
|
2045
|
+
def show_site_tls_certificate(site_id)
|
2046
|
+
_url = @_base_url + "/sites/#{site_id}/ssl"
|
2047
|
+
_kwargs = {
|
2048
|
+
params: {}
|
2049
|
+
}
|
2050
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2051
|
+
[:"netlifyAuth", ],
|
2052
|
+
**_kwargs
|
2053
|
+
)
|
2054
|
+
|
2055
|
+
|
2056
|
+
_response = _http_client.get(
|
2057
|
+
_url,
|
2058
|
+
|
2059
|
+
**_req_kwargs
|
2060
|
+
)
|
2061
|
+
|
2062
|
+
# Raise if not expected success code
|
2063
|
+
if _response.status != 200
|
2064
|
+
raise RequestError.new(
|
2065
|
+
method="get",
|
2066
|
+
url=_url,
|
2067
|
+
response=_response
|
2068
|
+
)
|
2069
|
+
end
|
2070
|
+
|
2071
|
+
return _response.body.empty? ? '' : _response.parse
|
2072
|
+
end
|
2073
|
+
|
2074
|
+
def list_site_submissions(site_id, page: nil, per_page: nil)
|
2075
|
+
_url = @_base_url + "/sites/#{site_id}/submissions"
|
2076
|
+
_kwargs = {
|
2077
|
+
params: {}
|
2078
|
+
}
|
2079
|
+
if page != nil
|
2080
|
+
_kwargs[:params][:"page"] = page
|
2081
|
+
end
|
2082
|
+
if per_page != nil
|
2083
|
+
_kwargs[:params][:"per_page"] = per_page
|
2084
|
+
end
|
2085
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2086
|
+
[:"netlifyAuth", ],
|
2087
|
+
**_kwargs
|
2088
|
+
)
|
2089
|
+
|
2090
|
+
|
2091
|
+
_response = _http_client.get(
|
2092
|
+
_url,
|
2093
|
+
|
2094
|
+
**_req_kwargs
|
2095
|
+
)
|
2096
|
+
|
2097
|
+
# Raise if not expected success code
|
2098
|
+
if _response.status != 200
|
2099
|
+
raise RequestError.new(
|
2100
|
+
method="get",
|
2101
|
+
url=_url,
|
2102
|
+
response=_response
|
2103
|
+
)
|
2104
|
+
end
|
2105
|
+
|
2106
|
+
return _response.body.empty? ? '' : _response.parse
|
2107
|
+
end
|
2108
|
+
|
2109
|
+
def get_split_tests(site_id)
|
2110
|
+
_url = @_base_url + "/sites/#{site_id}/traffic_splits"
|
2111
|
+
_kwargs = {
|
2112
|
+
params: {}
|
2113
|
+
}
|
2114
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2115
|
+
[:"netlifyAuth", ],
|
2116
|
+
**_kwargs
|
2117
|
+
)
|
2118
|
+
|
2119
|
+
|
2120
|
+
_response = _http_client.get(
|
2121
|
+
_url,
|
2122
|
+
|
2123
|
+
**_req_kwargs
|
2124
|
+
)
|
2125
|
+
|
2126
|
+
# Raise if not expected success code
|
2127
|
+
if _response.status != 200
|
2128
|
+
raise RequestError.new(
|
2129
|
+
method="get",
|
2130
|
+
url=_url,
|
2131
|
+
response=_response
|
2132
|
+
)
|
2133
|
+
end
|
2134
|
+
|
2135
|
+
return _response.body.empty? ? '' : _response.parse
|
2136
|
+
end
|
2137
|
+
|
2138
|
+
def get_split_test(site_id, split_test_id)
|
2139
|
+
_url = @_base_url + "/sites/#{site_id}/traffic_splits/#{split_test_id}"
|
2140
|
+
_kwargs = {
|
2141
|
+
params: {}
|
2142
|
+
}
|
2143
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2144
|
+
[:"netlifyAuth", ],
|
2145
|
+
**_kwargs
|
2146
|
+
)
|
2147
|
+
|
2148
|
+
|
2149
|
+
_response = _http_client.get(
|
2150
|
+
_url,
|
2151
|
+
|
2152
|
+
**_req_kwargs
|
2153
|
+
)
|
2154
|
+
|
2155
|
+
# Raise if not expected success code
|
2156
|
+
if _response.status != 200
|
2157
|
+
raise RequestError.new(
|
2158
|
+
method="get",
|
2159
|
+
url=_url,
|
2160
|
+
response=_response
|
2161
|
+
)
|
2162
|
+
end
|
2163
|
+
|
2164
|
+
return _response.body.empty? ? '' : _response.parse
|
2165
|
+
end
|
2166
|
+
|
2167
|
+
def list_form_submission(submission_id, page: nil, per_page: nil, query: nil)
|
2168
|
+
_url = @_base_url + "/submissions/#{submission_id}"
|
2169
|
+
_kwargs = {
|
2170
|
+
params: {}
|
2171
|
+
}
|
2172
|
+
if page != nil
|
2173
|
+
_kwargs[:params][:"page"] = page
|
2174
|
+
end
|
2175
|
+
if per_page != nil
|
2176
|
+
_kwargs[:params][:"per_page"] = per_page
|
2177
|
+
end
|
2178
|
+
if query != nil
|
2179
|
+
_kwargs[:params][:"query"] = query
|
2180
|
+
end
|
2181
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2182
|
+
[:"netlifyAuth", ],
|
2183
|
+
**_kwargs
|
2184
|
+
)
|
2185
|
+
|
2186
|
+
|
2187
|
+
_response = _http_client.get(
|
2188
|
+
_url,
|
2189
|
+
|
2190
|
+
**_req_kwargs
|
2191
|
+
)
|
2192
|
+
|
2193
|
+
# Raise if not expected success code
|
2194
|
+
if _response.status != 200
|
2195
|
+
raise RequestError.new(
|
2196
|
+
method="get",
|
2197
|
+
url=_url,
|
2198
|
+
response=_response
|
2199
|
+
)
|
2200
|
+
end
|
2201
|
+
|
2202
|
+
return _response.body.empty? ? '' : _response.parse
|
2203
|
+
end
|
2204
|
+
|
2205
|
+
def get_current_user()
|
2206
|
+
_url = @_base_url + "/user"
|
2207
|
+
_kwargs = {
|
2208
|
+
params: {}
|
2209
|
+
}
|
2210
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2211
|
+
[:"netlifyAuth", ],
|
2212
|
+
**_kwargs
|
2213
|
+
)
|
2214
|
+
|
2215
|
+
|
2216
|
+
_response = _http_client.get(
|
2217
|
+
_url,
|
2218
|
+
|
2219
|
+
**_req_kwargs
|
2220
|
+
)
|
2221
|
+
|
2222
|
+
# Raise if not expected success code
|
2223
|
+
if _response.status != 200
|
2224
|
+
raise RequestError.new(
|
2225
|
+
method="get",
|
2226
|
+
url=_url,
|
2227
|
+
response=_response
|
2228
|
+
)
|
2229
|
+
end
|
2230
|
+
|
2231
|
+
return _response.body.empty? ? '' : _response.parse
|
2232
|
+
end
|
2233
|
+
|
2234
|
+
def get_account_build_status(account_id)
|
2235
|
+
_url = @_base_url + "/#{account_id}/builds/status"
|
2236
|
+
_kwargs = {
|
2237
|
+
params: {}
|
2238
|
+
}
|
2239
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2240
|
+
[:"netlifyAuth", ],
|
2241
|
+
**_kwargs
|
2242
|
+
)
|
2243
|
+
|
2244
|
+
|
2245
|
+
_response = _http_client.get(
|
2246
|
+
_url,
|
2247
|
+
|
2248
|
+
**_req_kwargs
|
2249
|
+
)
|
2250
|
+
|
2251
|
+
# Raise if not expected success code
|
2252
|
+
if _response.status != 200
|
2253
|
+
raise RequestError.new(
|
2254
|
+
method="get",
|
2255
|
+
url=_url,
|
2256
|
+
response=_response
|
2257
|
+
)
|
2258
|
+
end
|
2259
|
+
|
2260
|
+
return _response.body.empty? ? '' : _response.parse
|
2261
|
+
end
|
2262
|
+
|
2263
|
+
def list_members_for_account(account_slug)
|
2264
|
+
_url = @_base_url + "/#{account_slug}/members"
|
2265
|
+
_kwargs = {
|
2266
|
+
params: {}
|
2267
|
+
}
|
2268
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2269
|
+
[:"netlifyAuth", ],
|
2270
|
+
**_kwargs
|
2271
|
+
)
|
2272
|
+
|
2273
|
+
|
2274
|
+
_response = _http_client.get(
|
2275
|
+
_url,
|
2276
|
+
|
2277
|
+
**_req_kwargs
|
2278
|
+
)
|
2279
|
+
|
2280
|
+
# Raise if not expected success code
|
2281
|
+
if _response.status != 200
|
2282
|
+
raise RequestError.new(
|
2283
|
+
method="get",
|
2284
|
+
url=_url,
|
2285
|
+
response=_response
|
2286
|
+
)
|
2287
|
+
end
|
2288
|
+
|
2289
|
+
return _response.body.empty? ? '' : _response.parse
|
2290
|
+
end
|
2291
|
+
|
2292
|
+
def get_account_member(account_slug, member_id)
|
2293
|
+
_url = @_base_url + "/#{account_slug}/members/#{member_id}"
|
2294
|
+
_kwargs = {
|
2295
|
+
params: {}
|
2296
|
+
}
|
2297
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2298
|
+
[:"netlifyAuth", ],
|
2299
|
+
**_kwargs
|
2300
|
+
)
|
2301
|
+
|
2302
|
+
|
2303
|
+
_response = _http_client.get(
|
2304
|
+
_url,
|
2305
|
+
|
2306
|
+
**_req_kwargs
|
2307
|
+
)
|
2308
|
+
|
2309
|
+
# Raise if not expected success code
|
2310
|
+
if _response.status != 200
|
2311
|
+
raise RequestError.new(
|
2312
|
+
method="get",
|
2313
|
+
url=_url,
|
2314
|
+
response=_response
|
2315
|
+
)
|
2316
|
+
end
|
2317
|
+
|
2318
|
+
return _response.body.empty? ? '' : _response.parse
|
2319
|
+
end
|
2320
|
+
|
2321
|
+
# **Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [getEnvVars](#tag/environmentVariables/operation/getEnvVars) to retrieve site environment variables.
|
2322
|
+
def list_sites_for_account(account_slug, name: nil, page: nil, per_page: nil)
|
2323
|
+
_url = @_base_url + "/#{account_slug}/sites"
|
2324
|
+
_kwargs = {
|
2325
|
+
params: {}
|
2326
|
+
}
|
2327
|
+
if name != nil
|
2328
|
+
_kwargs[:params][:"name"] = name
|
2329
|
+
end
|
2330
|
+
if page != nil
|
2331
|
+
_kwargs[:params][:"page"] = page
|
2332
|
+
end
|
2333
|
+
if per_page != nil
|
2334
|
+
_kwargs[:params][:"per_page"] = per_page
|
2335
|
+
end
|
2336
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2337
|
+
[:"netlifyAuth", ],
|
2338
|
+
**_kwargs
|
2339
|
+
)
|
2340
|
+
|
2341
|
+
|
2342
|
+
_response = _http_client.get(
|
2343
|
+
_url,
|
2344
|
+
|
2345
|
+
**_req_kwargs
|
2346
|
+
)
|
2347
|
+
|
2348
|
+
# Raise if not expected success code
|
2349
|
+
if _response.status != 200
|
2350
|
+
raise RequestError.new(
|
2351
|
+
method="get",
|
2352
|
+
url=_url,
|
2353
|
+
response=_response
|
2354
|
+
)
|
2355
|
+
end
|
2356
|
+
|
2357
|
+
return _response.body.empty? ? '' : _response.parse
|
2358
|
+
end
|
2359
|
+
|
2360
|
+
# Updates or creates a new value for an existing environment variable. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>. Migrate now with the Netlify UI.
|
2361
|
+
def set_env_var_value(data: nil, account_id, key, site_id: nil)
|
2362
|
+
_url = @_base_url + "/accounts/#{account_id}/env/#{key}"
|
2363
|
+
_kwargs = {
|
2364
|
+
params: {}
|
2365
|
+
}
|
2366
|
+
if site_id != nil
|
2367
|
+
_kwargs[:params][:"site_id"] = site_id
|
2368
|
+
end
|
2369
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2370
|
+
[:"netlifyAuth", ],
|
2371
|
+
**_kwargs
|
2372
|
+
)
|
2373
|
+
|
2374
|
+
|
2375
|
+
_response = _http_client.patch(
|
2376
|
+
_url,
|
2377
|
+
json: data,
|
2378
|
+
**_req_kwargs
|
2379
|
+
)
|
2380
|
+
|
2381
|
+
# Raise if not expected success code
|
2382
|
+
if _response.status != 201
|
2383
|
+
raise RequestError.new(
|
2384
|
+
method="patch",
|
2385
|
+
url=_url,
|
2386
|
+
response=_response
|
2387
|
+
)
|
2388
|
+
end
|
2389
|
+
|
2390
|
+
return _response.body.empty? ? '' : _response.parse
|
2391
|
+
end
|
2392
|
+
|
2393
|
+
# **Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [updateEnvVar](#tag/environmentVariables/operation/updateEnvVar) to update a site's environment variables.
|
2394
|
+
def update_site(data, site_id)
|
2395
|
+
_url = @_base_url + "/sites/#{site_id}"
|
2396
|
+
_kwargs = {
|
2397
|
+
params: {}
|
2398
|
+
}
|
2399
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2400
|
+
[:"netlifyAuth", ],
|
2401
|
+
**_kwargs
|
2402
|
+
)
|
2403
|
+
|
2404
|
+
|
2405
|
+
_response = _http_client.patch(
|
2406
|
+
_url,
|
2407
|
+
json: data,
|
2408
|
+
**_req_kwargs
|
2409
|
+
)
|
2410
|
+
|
2411
|
+
# Raise if not expected success code
|
2412
|
+
if _response.status != 200
|
2413
|
+
raise RequestError.new(
|
2414
|
+
method="patch",
|
2415
|
+
url=_url,
|
2416
|
+
response=_response
|
2417
|
+
)
|
2418
|
+
end
|
2419
|
+
|
2420
|
+
return _response.body.empty? ? '' : _response.parse
|
2421
|
+
end
|
2422
|
+
|
2423
|
+
def create_account(data)
|
2424
|
+
_url = @_base_url + "/accounts"
|
2425
|
+
_kwargs = {
|
2426
|
+
params: {}
|
2427
|
+
}
|
2428
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2429
|
+
[:"netlifyAuth", ],
|
2430
|
+
**_kwargs
|
2431
|
+
)
|
2432
|
+
|
2433
|
+
|
2434
|
+
_response = _http_client.post(
|
2435
|
+
_url,
|
2436
|
+
json: data,
|
2437
|
+
**_req_kwargs
|
2438
|
+
)
|
2439
|
+
|
2440
|
+
# Raise if not expected success code
|
2441
|
+
if _response.status != 201
|
2442
|
+
raise RequestError.new(
|
2443
|
+
method="post",
|
2444
|
+
url=_url,
|
2445
|
+
response=_response
|
2446
|
+
)
|
2447
|
+
end
|
2448
|
+
|
2449
|
+
return _response.body.empty? ? '' : _response.parse
|
2450
|
+
end
|
2451
|
+
|
2452
|
+
# Creates new environment variables. Granular scopes are available on Pro plans and above. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>. Migrate now with the Netlify UI.
|
2453
|
+
def create_env_vars(data: nil, account_id, site_id: nil)
|
2454
|
+
_url = @_base_url + "/accounts/#{account_id}/env"
|
2455
|
+
_kwargs = {
|
2456
|
+
params: {}
|
2457
|
+
}
|
2458
|
+
if site_id != nil
|
2459
|
+
_kwargs[:params][:"site_id"] = site_id
|
2460
|
+
end
|
2461
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2462
|
+
[:"netlifyAuth", ],
|
2463
|
+
**_kwargs
|
2464
|
+
)
|
2465
|
+
|
2466
|
+
|
2467
|
+
_response = _http_client.post(
|
2468
|
+
_url,
|
2469
|
+
json: data,
|
2470
|
+
**_req_kwargs
|
2471
|
+
)
|
2472
|
+
|
2473
|
+
# Raise if not expected success code
|
2474
|
+
if _response.status != 201
|
2475
|
+
raise RequestError.new(
|
2476
|
+
method="post",
|
2477
|
+
url=_url,
|
2478
|
+
response=_response
|
2479
|
+
)
|
2480
|
+
end
|
2481
|
+
|
2482
|
+
return _response.body.empty? ? '' : _response.parse
|
2483
|
+
end
|
2484
|
+
|
2485
|
+
def update_site_build_log(build_id)
|
2486
|
+
_url = @_base_url + "/builds/#{build_id}/log"
|
2487
|
+
_kwargs = {
|
2488
|
+
params: {}
|
2489
|
+
}
|
2490
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2491
|
+
[:"netlifyAuth", ],
|
2492
|
+
**_kwargs
|
2493
|
+
)
|
2494
|
+
|
2495
|
+
|
2496
|
+
_response = _http_client.post(
|
2497
|
+
_url,
|
2498
|
+
|
2499
|
+
**_req_kwargs
|
2500
|
+
)
|
2501
|
+
|
2502
|
+
# Raise if not expected success code
|
2503
|
+
if _response.status != 204
|
2504
|
+
raise RequestError.new(
|
2505
|
+
method="post",
|
2506
|
+
url=_url,
|
2507
|
+
response=_response
|
2508
|
+
)
|
2509
|
+
end
|
2510
|
+
|
2511
|
+
return _response.body.empty? ? '' : _response.parse
|
2512
|
+
end
|
2513
|
+
|
2514
|
+
def notify_build_start(build_id, build_version: nil, buildbot_version: nil)
|
2515
|
+
_url = @_base_url + "/builds/#{build_id}/start"
|
2516
|
+
_kwargs = {
|
2517
|
+
params: {}
|
2518
|
+
}
|
2519
|
+
if build_version != nil
|
2520
|
+
_kwargs[:params][:"build_version"] = build_version
|
2521
|
+
end
|
2522
|
+
if buildbot_version != nil
|
2523
|
+
_kwargs[:params][:"buildbot_version"] = buildbot_version
|
2524
|
+
end
|
2525
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2526
|
+
[:"netlifyAuth", ],
|
2527
|
+
**_kwargs
|
2528
|
+
)
|
2529
|
+
|
2530
|
+
|
2531
|
+
_response = _http_client.post(
|
2532
|
+
_url,
|
2533
|
+
|
2534
|
+
**_req_kwargs
|
2535
|
+
)
|
2536
|
+
|
2537
|
+
# Raise if not expected success code
|
2538
|
+
if _response.status != 204
|
2539
|
+
raise RequestError.new(
|
2540
|
+
method="post",
|
2541
|
+
url=_url,
|
2542
|
+
response=_response
|
2543
|
+
)
|
2544
|
+
end
|
2545
|
+
|
2546
|
+
return _response.body.empty? ? '' : _response.parse
|
2547
|
+
end
|
2548
|
+
|
2549
|
+
def create_deploy_key()
|
2550
|
+
_url = @_base_url + "/deploy_keys"
|
2551
|
+
_kwargs = {
|
2552
|
+
params: {}
|
2553
|
+
}
|
2554
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2555
|
+
[:"netlifyAuth", ],
|
2556
|
+
**_kwargs
|
2557
|
+
)
|
2558
|
+
|
2559
|
+
|
2560
|
+
_response = _http_client.post(
|
2561
|
+
_url,
|
2562
|
+
|
2563
|
+
**_req_kwargs
|
2564
|
+
)
|
2565
|
+
|
2566
|
+
# Raise if not expected success code
|
2567
|
+
if _response.status != 201
|
2568
|
+
raise RequestError.new(
|
2569
|
+
method="post",
|
2570
|
+
url=_url,
|
2571
|
+
response=_response
|
2572
|
+
)
|
2573
|
+
end
|
2574
|
+
|
2575
|
+
return _response.body.empty? ? '' : _response.parse
|
2576
|
+
end
|
2577
|
+
|
2578
|
+
def cancel_site_deploy(deploy_id)
|
2579
|
+
_url = @_base_url + "/deploys/#{deploy_id}/cancel"
|
2580
|
+
_kwargs = {
|
2581
|
+
params: {}
|
2582
|
+
}
|
2583
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2584
|
+
[:"netlifyAuth", ],
|
2585
|
+
**_kwargs
|
2586
|
+
)
|
2587
|
+
|
2588
|
+
|
2589
|
+
_response = _http_client.post(
|
2590
|
+
_url,
|
2591
|
+
|
2592
|
+
**_req_kwargs
|
2593
|
+
)
|
2594
|
+
|
2595
|
+
# Raise if not expected success code
|
2596
|
+
if _response.status != 201
|
2597
|
+
raise RequestError.new(
|
2598
|
+
method="post",
|
2599
|
+
url=_url,
|
2600
|
+
response=_response
|
2601
|
+
)
|
2602
|
+
end
|
2603
|
+
|
2604
|
+
return _response.body.empty? ? '' : _response.parse
|
2605
|
+
end
|
2606
|
+
|
2607
|
+
def lock_deploy(deploy_id)
|
2608
|
+
_url = @_base_url + "/deploys/#{deploy_id}/lock"
|
2609
|
+
_kwargs = {
|
2610
|
+
params: {}
|
2611
|
+
}
|
2612
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2613
|
+
[:"netlifyAuth", ],
|
2614
|
+
**_kwargs
|
2615
|
+
)
|
2616
|
+
|
2617
|
+
|
2618
|
+
_response = _http_client.post(
|
2619
|
+
_url,
|
2620
|
+
|
2621
|
+
**_req_kwargs
|
2622
|
+
)
|
2623
|
+
|
2624
|
+
# Raise if not expected success code
|
2625
|
+
if _response.status != 200
|
2626
|
+
raise RequestError.new(
|
2627
|
+
method="post",
|
2628
|
+
url=_url,
|
2629
|
+
response=_response
|
2630
|
+
)
|
2631
|
+
end
|
2632
|
+
|
2633
|
+
return _response.body.empty? ? '' : _response.parse
|
2634
|
+
end
|
2635
|
+
|
2636
|
+
def unlock_deploy(deploy_id)
|
2637
|
+
_url = @_base_url + "/deploys/#{deploy_id}/unlock"
|
2638
|
+
_kwargs = {
|
2639
|
+
params: {}
|
2640
|
+
}
|
2641
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2642
|
+
[:"netlifyAuth", ],
|
2643
|
+
**_kwargs
|
2644
|
+
)
|
2645
|
+
|
2646
|
+
|
2647
|
+
_response = _http_client.post(
|
2648
|
+
_url,
|
2649
|
+
|
2650
|
+
**_req_kwargs
|
2651
|
+
)
|
2652
|
+
|
2653
|
+
# Raise if not expected success code
|
2654
|
+
if _response.status != 200
|
2655
|
+
raise RequestError.new(
|
2656
|
+
method="post",
|
2657
|
+
url=_url,
|
2658
|
+
response=_response
|
2659
|
+
)
|
2660
|
+
end
|
2661
|
+
|
2662
|
+
return _response.body.empty? ? '' : _response.parse
|
2663
|
+
end
|
2664
|
+
|
2665
|
+
def create_dns_zone(data)
|
2666
|
+
_url = @_base_url + "/dns_zones"
|
2667
|
+
_kwargs = {
|
2668
|
+
params: {}
|
2669
|
+
}
|
2670
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2671
|
+
[:"netlifyAuth", ],
|
2672
|
+
**_kwargs
|
2673
|
+
)
|
2674
|
+
|
2675
|
+
|
2676
|
+
_response = _http_client.post(
|
2677
|
+
_url,
|
2678
|
+
json: data,
|
2679
|
+
**_req_kwargs
|
2680
|
+
)
|
2681
|
+
|
2682
|
+
# Raise if not expected success code
|
2683
|
+
if _response.status != 201
|
2684
|
+
raise RequestError.new(
|
2685
|
+
method="post",
|
2686
|
+
url=_url,
|
2687
|
+
response=_response
|
2688
|
+
)
|
2689
|
+
end
|
2690
|
+
|
2691
|
+
return _response.body.empty? ? '' : _response.parse
|
2692
|
+
end
|
2693
|
+
|
2694
|
+
def create_dns_record(data, zone_id)
|
2695
|
+
_url = @_base_url + "/dns_zones/#{zone_id}/dns_records"
|
2696
|
+
_kwargs = {
|
2697
|
+
params: {}
|
2698
|
+
}
|
2699
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2700
|
+
[:"netlifyAuth", ],
|
2701
|
+
**_kwargs
|
2702
|
+
)
|
2703
|
+
|
2704
|
+
|
2705
|
+
_response = _http_client.post(
|
2706
|
+
_url,
|
2707
|
+
json: data,
|
2708
|
+
**_req_kwargs
|
2709
|
+
)
|
2710
|
+
|
2711
|
+
# Raise if not expected success code
|
2712
|
+
if _response.status != 201
|
2713
|
+
raise RequestError.new(
|
2714
|
+
method="post",
|
2715
|
+
url=_url,
|
2716
|
+
response=_response
|
2717
|
+
)
|
2718
|
+
end
|
2719
|
+
|
2720
|
+
return _response.body.empty? ? '' : _response.parse
|
2721
|
+
end
|
2722
|
+
|
2723
|
+
def create_hook_by_site_id(data, site_id)
|
2724
|
+
_url = @_base_url + "/hooks"
|
2725
|
+
_kwargs = {
|
2726
|
+
params: {}
|
2727
|
+
}
|
2728
|
+
_kwargs[:params][:"site_id"] = site_id
|
2729
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2730
|
+
[:"netlifyAuth", ],
|
2731
|
+
**_kwargs
|
2732
|
+
)
|
2733
|
+
|
2734
|
+
|
2735
|
+
_response = _http_client.post(
|
2736
|
+
_url,
|
2737
|
+
json: data,
|
2738
|
+
**_req_kwargs
|
2739
|
+
)
|
2740
|
+
|
2741
|
+
# Raise if not expected success code
|
2742
|
+
if _response.status != 201
|
2743
|
+
raise RequestError.new(
|
2744
|
+
method="post",
|
2745
|
+
url=_url,
|
2746
|
+
response=_response
|
2747
|
+
)
|
2748
|
+
end
|
2749
|
+
|
2750
|
+
return _response.body.empty? ? '' : _response.parse
|
2751
|
+
end
|
2752
|
+
|
2753
|
+
def enable_hook(hook_id)
|
2754
|
+
_url = @_base_url + "/hooks/#{hook_id}/enable"
|
2755
|
+
_kwargs = {
|
2756
|
+
params: {}
|
2757
|
+
}
|
2758
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2759
|
+
[:"netlifyAuth", ],
|
2760
|
+
**_kwargs
|
2761
|
+
)
|
2762
|
+
|
2763
|
+
|
2764
|
+
_response = _http_client.post(
|
2765
|
+
_url,
|
2766
|
+
|
2767
|
+
**_req_kwargs
|
2768
|
+
)
|
2769
|
+
|
2770
|
+
# Raise if not expected success code
|
2771
|
+
if _response.status != 200
|
2772
|
+
raise RequestError.new(
|
2773
|
+
method="post",
|
2774
|
+
url=_url,
|
2775
|
+
response=_response
|
2776
|
+
)
|
2777
|
+
end
|
2778
|
+
|
2779
|
+
return _response.body.empty? ? '' : _response.parse
|
2780
|
+
end
|
2781
|
+
|
2782
|
+
def create_ticket(client_id)
|
2783
|
+
_url = @_base_url + "/oauth/tickets"
|
2784
|
+
_kwargs = {
|
2785
|
+
params: {}
|
2786
|
+
}
|
2787
|
+
_kwargs[:params][:"client_id"] = client_id
|
2788
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2789
|
+
[:"netlifyAuth", ],
|
2790
|
+
**_kwargs
|
2791
|
+
)
|
2792
|
+
|
2793
|
+
|
2794
|
+
_response = _http_client.post(
|
2795
|
+
_url,
|
2796
|
+
|
2797
|
+
**_req_kwargs
|
2798
|
+
)
|
2799
|
+
|
2800
|
+
# Raise if not expected success code
|
2801
|
+
if _response.status != 201
|
2802
|
+
raise RequestError.new(
|
2803
|
+
method="post",
|
2804
|
+
url=_url,
|
2805
|
+
response=_response
|
2806
|
+
)
|
2807
|
+
end
|
2808
|
+
|
2809
|
+
return _response.body.empty? ? '' : _response.parse
|
2810
|
+
end
|
2811
|
+
|
2812
|
+
def exchange_ticket(ticket_id)
|
2813
|
+
_url = @_base_url + "/oauth/tickets/#{ticket_id}/exchange"
|
2814
|
+
_kwargs = {
|
2815
|
+
params: {}
|
2816
|
+
}
|
2817
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2818
|
+
[:"netlifyAuth", ],
|
2819
|
+
**_kwargs
|
2820
|
+
)
|
2821
|
+
|
2822
|
+
|
2823
|
+
_response = _http_client.post(
|
2824
|
+
_url,
|
2825
|
+
|
2826
|
+
**_req_kwargs
|
2827
|
+
)
|
2828
|
+
|
2829
|
+
# Raise if not expected success code
|
2830
|
+
if _response.status != 201
|
2831
|
+
raise RequestError.new(
|
2832
|
+
method="post",
|
2833
|
+
url=_url,
|
2834
|
+
response=_response
|
2835
|
+
)
|
2836
|
+
end
|
2837
|
+
|
2838
|
+
return _response.body.empty? ? '' : _response.parse
|
2839
|
+
end
|
2840
|
+
|
2841
|
+
# Purges cached content from Netlify's CDN. Supports purging by Cache-Tag.
|
2842
|
+
def purge_cache(data)
|
2843
|
+
_url = @_base_url + "/purge"
|
2844
|
+
_kwargs = {
|
2845
|
+
params: {}
|
2846
|
+
}
|
2847
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2848
|
+
[:"netlifyAuth", ],
|
2849
|
+
**_kwargs
|
2850
|
+
)
|
2851
|
+
|
2852
|
+
|
2853
|
+
_response = _http_client.post(
|
2854
|
+
_url,
|
2855
|
+
json: data,
|
2856
|
+
**_req_kwargs
|
2857
|
+
)
|
2858
|
+
|
2859
|
+
# Raise if not expected success code
|
2860
|
+
if _response.status != 202
|
2861
|
+
raise RequestError.new(
|
2862
|
+
method="post",
|
2863
|
+
url=_url,
|
2864
|
+
response=_response
|
2865
|
+
)
|
2866
|
+
end
|
2867
|
+
|
2868
|
+
return _response.body.empty? ? '' : _response.parse
|
2869
|
+
end
|
2870
|
+
|
2871
|
+
# **Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [createEnvVars](#tag/environmentVariables/operation/createEnvVars) to create environment variables for a site.
|
2872
|
+
def create_site(data, configure_dns: nil)
|
2873
|
+
_url = @_base_url + "/sites"
|
2874
|
+
_kwargs = {
|
2875
|
+
params: {}
|
2876
|
+
}
|
2877
|
+
if configure_dns != nil
|
2878
|
+
_kwargs[:params][:"configure_dns"] = configure_dns
|
2879
|
+
end
|
2880
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2881
|
+
[:"netlifyAuth", ],
|
2882
|
+
**_kwargs
|
2883
|
+
)
|
2884
|
+
|
2885
|
+
|
2886
|
+
_response = _http_client.post(
|
2887
|
+
_url,
|
2888
|
+
json: data,
|
2889
|
+
**_req_kwargs
|
2890
|
+
)
|
2891
|
+
|
2892
|
+
# Raise if not expected success code
|
2893
|
+
if _response.status != 201
|
2894
|
+
raise RequestError.new(
|
2895
|
+
method="post",
|
2896
|
+
url=_url,
|
2897
|
+
response=_response
|
2898
|
+
)
|
2899
|
+
end
|
2900
|
+
|
2901
|
+
return _response.body.empty? ? '' : _response.parse
|
2902
|
+
end
|
2903
|
+
|
2904
|
+
def create_site_asset(site_id, content_type, name, size, visibility: nil)
|
2905
|
+
_url = @_base_url + "/sites/#{site_id}/assets"
|
2906
|
+
_kwargs = {
|
2907
|
+
params: {}
|
2908
|
+
}
|
2909
|
+
_kwargs[:params][:"content_type"] = content_type
|
2910
|
+
_kwargs[:params][:"name"] = name
|
2911
|
+
_kwargs[:params][:"size"] = size
|
2912
|
+
if visibility != nil
|
2913
|
+
_kwargs[:params][:"visibility"] = visibility
|
2914
|
+
end
|
2915
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2916
|
+
[:"netlifyAuth", ],
|
2917
|
+
**_kwargs
|
2918
|
+
)
|
2919
|
+
|
2920
|
+
|
2921
|
+
_response = _http_client.post(
|
2922
|
+
_url,
|
2923
|
+
|
2924
|
+
**_req_kwargs
|
2925
|
+
)
|
2926
|
+
|
2927
|
+
# Raise if not expected success code
|
2928
|
+
if _response.status != 201
|
2929
|
+
raise RequestError.new(
|
2930
|
+
method="post",
|
2931
|
+
url=_url,
|
2932
|
+
response=_response
|
2933
|
+
)
|
2934
|
+
end
|
2935
|
+
|
2936
|
+
return _response.body.empty? ? '' : _response.parse
|
2937
|
+
end
|
2938
|
+
|
2939
|
+
def create_site_build_hook(data, site_id)
|
2940
|
+
_url = @_base_url + "/sites/#{site_id}/build_hooks"
|
2941
|
+
_kwargs = {
|
2942
|
+
params: {}
|
2943
|
+
}
|
2944
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2945
|
+
[:"netlifyAuth", ],
|
2946
|
+
**_kwargs
|
2947
|
+
)
|
2948
|
+
|
2949
|
+
|
2950
|
+
_response = _http_client.post(
|
2951
|
+
_url,
|
2952
|
+
json: data,
|
2953
|
+
**_req_kwargs
|
2954
|
+
)
|
2955
|
+
|
2956
|
+
# Raise if not expected success code
|
2957
|
+
if _response.status != 201
|
2958
|
+
raise RequestError.new(
|
2959
|
+
method="post",
|
2960
|
+
url=_url,
|
2961
|
+
response=_response
|
2962
|
+
)
|
2963
|
+
end
|
2964
|
+
|
2965
|
+
return _response.body.empty? ? '' : _response.parse
|
2966
|
+
end
|
2967
|
+
|
2968
|
+
def create_site_build(data: nil, site_id)
|
2969
|
+
_url = @_base_url + "/sites/#{site_id}/builds"
|
2970
|
+
_kwargs = {
|
2971
|
+
params: {}
|
2972
|
+
}
|
2973
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
2974
|
+
[:"netlifyAuth", ],
|
2975
|
+
**_kwargs
|
2976
|
+
)
|
2977
|
+
|
2978
|
+
|
2979
|
+
_response = _http_client.post(
|
2980
|
+
_url,
|
2981
|
+
json: data,
|
2982
|
+
**_req_kwargs
|
2983
|
+
)
|
2984
|
+
|
2985
|
+
# Raise if not expected success code
|
2986
|
+
if _response.status != 200
|
2987
|
+
raise RequestError.new(
|
2988
|
+
method="post",
|
2989
|
+
url=_url,
|
2990
|
+
response=_response
|
2991
|
+
)
|
2992
|
+
end
|
2993
|
+
|
2994
|
+
return _response.body.empty? ? '' : _response.parse
|
2995
|
+
end
|
2996
|
+
|
2997
|
+
def create_site_deploy(data, site_id, branch: nil, deploy_previews: nil, latest_published: nil, production: nil, state: nil, title: nil)
|
2998
|
+
_url = @_base_url + "/sites/#{site_id}/deploys"
|
2999
|
+
_kwargs = {
|
3000
|
+
params: {}
|
3001
|
+
}
|
3002
|
+
if branch != nil
|
3003
|
+
_kwargs[:params][:"branch"] = branch
|
3004
|
+
end
|
3005
|
+
if deploy_previews != nil
|
3006
|
+
_kwargs[:params][:"deploy-previews"] = deploy_previews
|
3007
|
+
end
|
3008
|
+
if latest_published != nil
|
3009
|
+
_kwargs[:params][:"latest-published"] = latest_published
|
3010
|
+
end
|
3011
|
+
if production != nil
|
3012
|
+
_kwargs[:params][:"production"] = production
|
3013
|
+
end
|
3014
|
+
if state != nil
|
3015
|
+
_kwargs[:params][:"state"] = state
|
3016
|
+
end
|
3017
|
+
if title != nil
|
3018
|
+
_kwargs[:params][:"title"] = title
|
3019
|
+
end
|
3020
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3021
|
+
[:"netlifyAuth", ],
|
3022
|
+
**_kwargs
|
3023
|
+
)
|
3024
|
+
|
3025
|
+
|
3026
|
+
_response = _http_client.post(
|
3027
|
+
_url,
|
3028
|
+
json: data,
|
3029
|
+
**_req_kwargs
|
3030
|
+
)
|
3031
|
+
|
3032
|
+
# Raise if not expected success code
|
3033
|
+
if _response.status != 200
|
3034
|
+
raise RequestError.new(
|
3035
|
+
method="post",
|
3036
|
+
url=_url,
|
3037
|
+
response=_response
|
3038
|
+
)
|
3039
|
+
end
|
3040
|
+
|
3041
|
+
return _response.body.empty? ? '' : _response.parse
|
3042
|
+
end
|
3043
|
+
|
3044
|
+
def restore_site_deploy(site_id, deploy_id)
|
3045
|
+
_url = @_base_url + "/sites/#{site_id}/deploys/#{deploy_id}/restore"
|
3046
|
+
_kwargs = {
|
3047
|
+
params: {}
|
3048
|
+
}
|
3049
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3050
|
+
[:"netlifyAuth", ],
|
3051
|
+
**_kwargs
|
3052
|
+
)
|
3053
|
+
|
3054
|
+
|
3055
|
+
_response = _http_client.post(
|
3056
|
+
_url,
|
3057
|
+
|
3058
|
+
**_req_kwargs
|
3059
|
+
)
|
3060
|
+
|
3061
|
+
# Raise if not expected success code
|
3062
|
+
if _response.status != 201
|
3063
|
+
raise RequestError.new(
|
3064
|
+
method="post",
|
3065
|
+
url=_url,
|
3066
|
+
response=_response
|
3067
|
+
)
|
3068
|
+
end
|
3069
|
+
|
3070
|
+
return _response.body.empty? ? '' : _response.parse
|
3071
|
+
end
|
3072
|
+
|
3073
|
+
def create_service_instance(data, site_id, addon)
|
3074
|
+
_url = @_base_url + "/sites/#{site_id}/services/#{addon}/instances"
|
3075
|
+
_kwargs = {
|
3076
|
+
params: {}
|
3077
|
+
}
|
3078
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3079
|
+
[:"netlifyAuth", ],
|
3080
|
+
**_kwargs
|
3081
|
+
)
|
3082
|
+
|
3083
|
+
|
3084
|
+
_response = _http_client.post(
|
3085
|
+
_url,
|
3086
|
+
json: data,
|
3087
|
+
**_req_kwargs
|
3088
|
+
)
|
3089
|
+
|
3090
|
+
# Raise if not expected success code
|
3091
|
+
if _response.status != 201
|
3092
|
+
raise RequestError.new(
|
3093
|
+
method="post",
|
3094
|
+
url=_url,
|
3095
|
+
response=_response
|
3096
|
+
)
|
3097
|
+
end
|
3098
|
+
|
3099
|
+
return _response.body.empty? ? '' : _response.parse
|
3100
|
+
end
|
3101
|
+
|
3102
|
+
def create_site_snippet(data, site_id)
|
3103
|
+
_url = @_base_url + "/sites/#{site_id}/snippets"
|
3104
|
+
_kwargs = {
|
3105
|
+
params: {}
|
3106
|
+
}
|
3107
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3108
|
+
[:"netlifyAuth", ],
|
3109
|
+
**_kwargs
|
3110
|
+
)
|
3111
|
+
|
3112
|
+
|
3113
|
+
_response = _http_client.post(
|
3114
|
+
_url,
|
3115
|
+
json: data,
|
3116
|
+
**_req_kwargs
|
3117
|
+
)
|
3118
|
+
|
3119
|
+
# Raise if not expected success code
|
3120
|
+
if _response.status != 201
|
3121
|
+
raise RequestError.new(
|
3122
|
+
method="post",
|
3123
|
+
url=_url,
|
3124
|
+
response=_response
|
3125
|
+
)
|
3126
|
+
end
|
3127
|
+
|
3128
|
+
return _response.body.empty? ? '' : _response.parse
|
3129
|
+
end
|
3130
|
+
|
3131
|
+
def provision_site_tls_certificate(site_id, ca_certificates: nil, certificate: nil, key: nil)
|
3132
|
+
_url = @_base_url + "/sites/#{site_id}/ssl"
|
3133
|
+
_kwargs = {
|
3134
|
+
params: {}
|
3135
|
+
}
|
3136
|
+
if ca_certificates != nil
|
3137
|
+
_kwargs[:params][:"ca_certificates"] = ca_certificates
|
3138
|
+
end
|
3139
|
+
if certificate != nil
|
3140
|
+
_kwargs[:params][:"certificate"] = certificate
|
3141
|
+
end
|
3142
|
+
if key != nil
|
3143
|
+
_kwargs[:params][:"key"] = key
|
3144
|
+
end
|
3145
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3146
|
+
[:"netlifyAuth", ],
|
3147
|
+
**_kwargs
|
3148
|
+
)
|
3149
|
+
|
3150
|
+
|
3151
|
+
_response = _http_client.post(
|
3152
|
+
_url,
|
3153
|
+
|
3154
|
+
**_req_kwargs
|
3155
|
+
)
|
3156
|
+
|
3157
|
+
# Raise if not expected success code
|
3158
|
+
if _response.status != 200
|
3159
|
+
raise RequestError.new(
|
3160
|
+
method="post",
|
3161
|
+
url=_url,
|
3162
|
+
response=_response
|
3163
|
+
)
|
3164
|
+
end
|
3165
|
+
|
3166
|
+
return _response.body.empty? ? '' : _response.parse
|
3167
|
+
end
|
3168
|
+
|
3169
|
+
def create_split_test(data, site_id)
|
3170
|
+
_url = @_base_url + "/sites/#{site_id}/traffic_splits"
|
3171
|
+
_kwargs = {
|
3172
|
+
params: {}
|
3173
|
+
}
|
3174
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3175
|
+
[:"netlifyAuth", ],
|
3176
|
+
**_kwargs
|
3177
|
+
)
|
3178
|
+
|
3179
|
+
|
3180
|
+
_response = _http_client.post(
|
3181
|
+
_url,
|
3182
|
+
json: data,
|
3183
|
+
**_req_kwargs
|
3184
|
+
)
|
3185
|
+
|
3186
|
+
# Raise if not expected success code
|
3187
|
+
if _response.status != 201
|
3188
|
+
raise RequestError.new(
|
3189
|
+
method="post",
|
3190
|
+
url=_url,
|
3191
|
+
response=_response
|
3192
|
+
)
|
3193
|
+
end
|
3194
|
+
|
3195
|
+
return _response.body.empty? ? '' : _response.parse
|
3196
|
+
end
|
3197
|
+
|
3198
|
+
def enable_split_test(site_id, split_test_id)
|
3199
|
+
_url = @_base_url + "/sites/#{site_id}/traffic_splits/#{split_test_id}/publish"
|
3200
|
+
_kwargs = {
|
3201
|
+
params: {}
|
3202
|
+
}
|
3203
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3204
|
+
[:"netlifyAuth", ],
|
3205
|
+
**_kwargs
|
3206
|
+
)
|
3207
|
+
|
3208
|
+
|
3209
|
+
_response = _http_client.post(
|
3210
|
+
_url,
|
3211
|
+
|
3212
|
+
**_req_kwargs
|
3213
|
+
)
|
3214
|
+
|
3215
|
+
# Raise if not expected success code
|
3216
|
+
if _response.status != 204
|
3217
|
+
raise RequestError.new(
|
3218
|
+
method="post",
|
3219
|
+
url=_url,
|
3220
|
+
response=_response
|
3221
|
+
)
|
3222
|
+
end
|
3223
|
+
|
3224
|
+
return _response.body.empty? ? '' : _response.parse
|
3225
|
+
end
|
3226
|
+
|
3227
|
+
def disable_split_test(site_id, split_test_id)
|
3228
|
+
_url = @_base_url + "/sites/#{site_id}/traffic_splits/#{split_test_id}/unpublish"
|
3229
|
+
_kwargs = {
|
3230
|
+
params: {}
|
3231
|
+
}
|
3232
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3233
|
+
[:"netlifyAuth", ],
|
3234
|
+
**_kwargs
|
3235
|
+
)
|
3236
|
+
|
3237
|
+
|
3238
|
+
_response = _http_client.post(
|
3239
|
+
_url,
|
3240
|
+
|
3241
|
+
**_req_kwargs
|
3242
|
+
)
|
3243
|
+
|
3244
|
+
# Raise if not expected success code
|
3245
|
+
if _response.status != 204
|
3246
|
+
raise RequestError.new(
|
3247
|
+
method="post",
|
3248
|
+
url=_url,
|
3249
|
+
response=_response
|
3250
|
+
)
|
3251
|
+
end
|
3252
|
+
|
3253
|
+
return _response.body.empty? ? '' : _response.parse
|
3254
|
+
end
|
3255
|
+
|
3256
|
+
def add_member_to_account(data, account_slug)
|
3257
|
+
_url = @_base_url + "/#{account_slug}/members"
|
3258
|
+
_kwargs = {
|
3259
|
+
params: {}
|
3260
|
+
}
|
3261
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3262
|
+
[:"netlifyAuth", ],
|
3263
|
+
**_kwargs
|
3264
|
+
)
|
3265
|
+
|
3266
|
+
|
3267
|
+
_response = _http_client.post(
|
3268
|
+
_url,
|
3269
|
+
json: data,
|
3270
|
+
**_req_kwargs
|
3271
|
+
)
|
3272
|
+
|
3273
|
+
# Raise if not expected success code
|
3274
|
+
if _response.status != 200
|
3275
|
+
raise RequestError.new(
|
3276
|
+
method="post",
|
3277
|
+
url=_url,
|
3278
|
+
response=_response
|
3279
|
+
)
|
3280
|
+
end
|
3281
|
+
|
3282
|
+
return _response.body.empty? ? '' : _response.parse
|
3283
|
+
end
|
3284
|
+
|
3285
|
+
# **Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [createEnvVars](#tag/environmentVariables/operation/createEnvVars) to create environment variables for a site.
|
3286
|
+
def create_site_in_team(data: nil, account_slug, configure_dns: nil)
|
3287
|
+
_url = @_base_url + "/#{account_slug}/sites"
|
3288
|
+
_kwargs = {
|
3289
|
+
params: {}
|
3290
|
+
}
|
3291
|
+
if configure_dns != nil
|
3292
|
+
_kwargs[:params][:"configure_dns"] = configure_dns
|
3293
|
+
end
|
3294
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3295
|
+
[:"netlifyAuth", ],
|
3296
|
+
**_kwargs
|
3297
|
+
)
|
3298
|
+
|
3299
|
+
|
3300
|
+
_response = _http_client.post(
|
3301
|
+
_url,
|
3302
|
+
json: data,
|
3303
|
+
**_req_kwargs
|
3304
|
+
)
|
3305
|
+
|
3306
|
+
# Raise if not expected success code
|
3307
|
+
if _response.status != 201
|
3308
|
+
raise RequestError.new(
|
3309
|
+
method="post",
|
3310
|
+
url=_url,
|
3311
|
+
response=_response
|
3312
|
+
)
|
3313
|
+
end
|
3314
|
+
|
3315
|
+
return _response.body.empty? ? '' : _response.parse
|
3316
|
+
end
|
3317
|
+
|
3318
|
+
def update_account(data: nil, account_id)
|
3319
|
+
_url = @_base_url + "/accounts/#{account_id}"
|
3320
|
+
_kwargs = {
|
3321
|
+
params: {}
|
3322
|
+
}
|
3323
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3324
|
+
[:"netlifyAuth", ],
|
3325
|
+
**_kwargs
|
3326
|
+
)
|
3327
|
+
|
3328
|
+
|
3329
|
+
_response = _http_client.put(
|
3330
|
+
_url,
|
3331
|
+
json: data,
|
3332
|
+
**_req_kwargs
|
3333
|
+
)
|
3334
|
+
|
3335
|
+
# Raise if not expected success code
|
3336
|
+
if _response.status != 200
|
3337
|
+
raise RequestError.new(
|
3338
|
+
method="put",
|
3339
|
+
url=_url,
|
3340
|
+
response=_response
|
3341
|
+
)
|
3342
|
+
end
|
3343
|
+
|
3344
|
+
return _response.body.empty? ? '' : _response.parse
|
3345
|
+
end
|
3346
|
+
|
3347
|
+
# Updates an existing environment variable and all of its values. Existing values will be replaced by values provided. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>. Migrate now with the Netlify UI.
|
3348
|
+
def update_env_var(data: nil, account_id, key, site_id: nil)
|
3349
|
+
_url = @_base_url + "/accounts/#{account_id}/env/#{key}"
|
3350
|
+
_kwargs = {
|
3351
|
+
params: {}
|
3352
|
+
}
|
3353
|
+
if site_id != nil
|
3354
|
+
_kwargs[:params][:"site_id"] = site_id
|
3355
|
+
end
|
3356
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3357
|
+
[:"netlifyAuth", ],
|
3358
|
+
**_kwargs
|
3359
|
+
)
|
3360
|
+
|
3361
|
+
|
3362
|
+
_response = _http_client.put(
|
3363
|
+
_url,
|
3364
|
+
json: data,
|
3365
|
+
**_req_kwargs
|
3366
|
+
)
|
3367
|
+
|
3368
|
+
# Raise if not expected success code
|
3369
|
+
if _response.status != 200
|
3370
|
+
raise RequestError.new(
|
3371
|
+
method="put",
|
3372
|
+
url=_url,
|
3373
|
+
response=_response
|
3374
|
+
)
|
3375
|
+
end
|
3376
|
+
|
3377
|
+
return _response.body.empty? ? '' : _response.parse
|
3378
|
+
end
|
3379
|
+
|
3380
|
+
def upload_deploy_file(data, deploy_id, path, size: nil)
|
3381
|
+
_url = @_base_url + "/deploys/#{deploy_id}/files/#{path}"
|
3382
|
+
_kwargs = {
|
3383
|
+
params: {}
|
3384
|
+
}
|
3385
|
+
if size != nil
|
3386
|
+
_kwargs[:params][:"size"] = size
|
3387
|
+
end
|
3388
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3389
|
+
[:"netlifyAuth", ],
|
3390
|
+
**_kwargs
|
3391
|
+
)
|
3392
|
+
|
3393
|
+
_data = {}
|
3394
|
+
_data[:""] = HTTP::FormData::File.new(data[:"x"])
|
3395
|
+
|
3396
|
+
|
3397
|
+
_response = _http_client.put(
|
3398
|
+
_url,
|
3399
|
+
form: _data,
|
3400
|
+
**_req_kwargs
|
3401
|
+
)
|
3402
|
+
|
3403
|
+
# Raise if not expected success code
|
3404
|
+
if _response.status != 200
|
3405
|
+
raise RequestError.new(
|
3406
|
+
method="put",
|
3407
|
+
url=_url,
|
3408
|
+
response=_response
|
3409
|
+
)
|
3410
|
+
end
|
3411
|
+
|
3412
|
+
return _response.body.empty? ? '' : _response.parse
|
3413
|
+
end
|
3414
|
+
|
3415
|
+
def upload_deploy_function(data, deploy_id, name, invocation_mode: nil, runtime: nil, size: nil)
|
3416
|
+
_url = @_base_url + "/deploys/#{deploy_id}/functions/#{name}"
|
3417
|
+
_kwargs = {
|
3418
|
+
params: {}
|
3419
|
+
}
|
3420
|
+
if invocation_mode != nil
|
3421
|
+
_kwargs[:params][:"invocation_mode"] = invocation_mode
|
3422
|
+
end
|
3423
|
+
if runtime != nil
|
3424
|
+
_kwargs[:params][:"runtime"] = runtime
|
3425
|
+
end
|
3426
|
+
if size != nil
|
3427
|
+
_kwargs[:params][:"size"] = size
|
3428
|
+
end
|
3429
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3430
|
+
[:"netlifyAuth", ],
|
3431
|
+
**_kwargs
|
3432
|
+
)
|
3433
|
+
|
3434
|
+
_data = {}
|
3435
|
+
_data[:""] = HTTP::FormData::File.new(data[:"x"])
|
3436
|
+
|
3437
|
+
|
3438
|
+
_response = _http_client.put(
|
3439
|
+
_url,
|
3440
|
+
form: _data,
|
3441
|
+
**_req_kwargs
|
3442
|
+
)
|
3443
|
+
|
3444
|
+
# Raise if not expected success code
|
3445
|
+
if _response.status != 200
|
3446
|
+
raise RequestError.new(
|
3447
|
+
method="put",
|
3448
|
+
url=_url,
|
3449
|
+
response=_response
|
3450
|
+
)
|
3451
|
+
end
|
3452
|
+
|
3453
|
+
return _response.body.empty? ? '' : _response.parse
|
3454
|
+
end
|
3455
|
+
|
3456
|
+
def transfer_dns_zone(zone_id, account_id, transfer_account_id, transfer_user_id)
|
3457
|
+
_url = @_base_url + "/dns_zones/#{zone_id}/transfer"
|
3458
|
+
_kwargs = {
|
3459
|
+
params: {}
|
3460
|
+
}
|
3461
|
+
_kwargs[:params][:"account_id"] = account_id
|
3462
|
+
_kwargs[:params][:"transfer_account_id"] = transfer_account_id
|
3463
|
+
_kwargs[:params][:"transfer_user_id"] = transfer_user_id
|
3464
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3465
|
+
[:"netlifyAuth", ],
|
3466
|
+
**_kwargs
|
3467
|
+
)
|
3468
|
+
|
3469
|
+
|
3470
|
+
_response = _http_client.put(
|
3471
|
+
_url,
|
3472
|
+
|
3473
|
+
**_req_kwargs
|
3474
|
+
)
|
3475
|
+
|
3476
|
+
# Raise if not expected success code
|
3477
|
+
if _response.status != 200
|
3478
|
+
raise RequestError.new(
|
3479
|
+
method="put",
|
3480
|
+
url=_url,
|
3481
|
+
response=_response
|
3482
|
+
)
|
3483
|
+
end
|
3484
|
+
|
3485
|
+
return _response.body.empty? ? '' : _response.parse
|
3486
|
+
end
|
3487
|
+
|
3488
|
+
def update_hook(data, hook_id)
|
3489
|
+
_url = @_base_url + "/hooks/#{hook_id}"
|
3490
|
+
_kwargs = {
|
3491
|
+
params: {}
|
3492
|
+
}
|
3493
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3494
|
+
[:"netlifyAuth", ],
|
3495
|
+
**_kwargs
|
3496
|
+
)
|
3497
|
+
|
3498
|
+
|
3499
|
+
_response = _http_client.put(
|
3500
|
+
_url,
|
3501
|
+
json: data,
|
3502
|
+
**_req_kwargs
|
3503
|
+
)
|
3504
|
+
|
3505
|
+
# Raise if not expected success code
|
3506
|
+
if _response.status != 200
|
3507
|
+
raise RequestError.new(
|
3508
|
+
method="put",
|
3509
|
+
url=_url,
|
3510
|
+
response=_response
|
3511
|
+
)
|
3512
|
+
end
|
3513
|
+
|
3514
|
+
return _response.body.empty? ? '' : _response.parse
|
3515
|
+
end
|
3516
|
+
|
3517
|
+
def update_site_asset(site_id, asset_id, state)
|
3518
|
+
_url = @_base_url + "/sites/#{site_id}/assets/#{asset_id}"
|
3519
|
+
_kwargs = {
|
3520
|
+
params: {}
|
3521
|
+
}
|
3522
|
+
_kwargs[:params][:"state"] = state
|
3523
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3524
|
+
[:"netlifyAuth", ],
|
3525
|
+
**_kwargs
|
3526
|
+
)
|
3527
|
+
|
3528
|
+
|
3529
|
+
_response = _http_client.put(
|
3530
|
+
_url,
|
3531
|
+
|
3532
|
+
**_req_kwargs
|
3533
|
+
)
|
3534
|
+
|
3535
|
+
# Raise if not expected success code
|
3536
|
+
if _response.status != 200
|
3537
|
+
raise RequestError.new(
|
3538
|
+
method="put",
|
3539
|
+
url=_url,
|
3540
|
+
response=_response
|
3541
|
+
)
|
3542
|
+
end
|
3543
|
+
|
3544
|
+
return _response.body.empty? ? '' : _response.parse
|
3545
|
+
end
|
3546
|
+
|
3547
|
+
def update_site_build_hook(data, site_id, id)
|
3548
|
+
_url = @_base_url + "/sites/#{site_id}/build_hooks/#{id}"
|
3549
|
+
_kwargs = {
|
3550
|
+
params: {}
|
3551
|
+
}
|
3552
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3553
|
+
[:"netlifyAuth", ],
|
3554
|
+
**_kwargs
|
3555
|
+
)
|
3556
|
+
|
3557
|
+
|
3558
|
+
_response = _http_client.put(
|
3559
|
+
_url,
|
3560
|
+
json: data,
|
3561
|
+
**_req_kwargs
|
3562
|
+
)
|
3563
|
+
|
3564
|
+
# Raise if not expected success code
|
3565
|
+
if _response.status != 204
|
3566
|
+
raise RequestError.new(
|
3567
|
+
method="put",
|
3568
|
+
url=_url,
|
3569
|
+
response=_response
|
3570
|
+
)
|
3571
|
+
end
|
3572
|
+
|
3573
|
+
return _response.body.empty? ? '' : _response.parse
|
3574
|
+
end
|
3575
|
+
|
3576
|
+
def update_site_deploy(data, site_id, deploy_id)
|
3577
|
+
_url = @_base_url + "/sites/#{site_id}/deploys/#{deploy_id}"
|
3578
|
+
_kwargs = {
|
3579
|
+
params: {}
|
3580
|
+
}
|
3581
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3582
|
+
[:"netlifyAuth", ],
|
3583
|
+
**_kwargs
|
3584
|
+
)
|
3585
|
+
|
3586
|
+
|
3587
|
+
_response = _http_client.put(
|
3588
|
+
_url,
|
3589
|
+
json: data,
|
3590
|
+
**_req_kwargs
|
3591
|
+
)
|
3592
|
+
|
3593
|
+
# Raise if not expected success code
|
3594
|
+
if _response.status != 200
|
3595
|
+
raise RequestError.new(
|
3596
|
+
method="put",
|
3597
|
+
url=_url,
|
3598
|
+
response=_response
|
3599
|
+
)
|
3600
|
+
end
|
3601
|
+
|
3602
|
+
return _response.body.empty? ? '' : _response.parse
|
3603
|
+
end
|
3604
|
+
|
3605
|
+
def configure_dns_for_site(site_id)
|
3606
|
+
_url = @_base_url + "/sites/#{site_id}/dns"
|
3607
|
+
_kwargs = {
|
3608
|
+
params: {}
|
3609
|
+
}
|
3610
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3611
|
+
[:"netlifyAuth", ],
|
3612
|
+
**_kwargs
|
3613
|
+
)
|
3614
|
+
|
3615
|
+
|
3616
|
+
_response = _http_client.put(
|
3617
|
+
_url,
|
3618
|
+
|
3619
|
+
**_req_kwargs
|
3620
|
+
)
|
3621
|
+
|
3622
|
+
# Raise if not expected success code
|
3623
|
+
if _response.status != 200
|
3624
|
+
raise RequestError.new(
|
3625
|
+
method="put",
|
3626
|
+
url=_url,
|
3627
|
+
response=_response
|
3628
|
+
)
|
3629
|
+
end
|
3630
|
+
|
3631
|
+
return _response.body.empty? ? '' : _response.parse
|
3632
|
+
end
|
3633
|
+
|
3634
|
+
def update_site_metadata(data, site_id)
|
3635
|
+
_url = @_base_url + "/sites/#{site_id}/metadata"
|
3636
|
+
_kwargs = {
|
3637
|
+
params: {}
|
3638
|
+
}
|
3639
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3640
|
+
[:"netlifyAuth", ],
|
3641
|
+
**_kwargs
|
3642
|
+
)
|
3643
|
+
|
3644
|
+
|
3645
|
+
_response = _http_client.put(
|
3646
|
+
_url,
|
3647
|
+
json: data,
|
3648
|
+
**_req_kwargs
|
3649
|
+
)
|
3650
|
+
|
3651
|
+
# Raise if not expected success code
|
3652
|
+
if _response.status != 204
|
3653
|
+
raise RequestError.new(
|
3654
|
+
method="put",
|
3655
|
+
url=_url,
|
3656
|
+
response=_response
|
3657
|
+
)
|
3658
|
+
end
|
3659
|
+
|
3660
|
+
return _response.body.empty? ? '' : _response.parse
|
3661
|
+
end
|
3662
|
+
|
3663
|
+
def rollback_site_deploy(site_id)
|
3664
|
+
_url = @_base_url + "/sites/#{site_id}/rollback"
|
3665
|
+
_kwargs = {
|
3666
|
+
params: {}
|
3667
|
+
}
|
3668
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3669
|
+
[:"netlifyAuth", ],
|
3670
|
+
**_kwargs
|
3671
|
+
)
|
3672
|
+
|
3673
|
+
|
3674
|
+
_response = _http_client.put(
|
3675
|
+
_url,
|
3676
|
+
|
3677
|
+
**_req_kwargs
|
3678
|
+
)
|
3679
|
+
|
3680
|
+
# Raise if not expected success code
|
3681
|
+
if _response.status != 204
|
3682
|
+
raise RequestError.new(
|
3683
|
+
method="put",
|
3684
|
+
url=_url,
|
3685
|
+
response=_response
|
3686
|
+
)
|
3687
|
+
end
|
3688
|
+
|
3689
|
+
return _response.body.empty? ? '' : _response.parse
|
3690
|
+
end
|
3691
|
+
|
3692
|
+
def update_service_instance(data, site_id, addon, instance_id)
|
3693
|
+
_url = @_base_url + "/sites/#{site_id}/services/#{addon}/instances/#{instance_id}"
|
3694
|
+
_kwargs = {
|
3695
|
+
params: {}
|
3696
|
+
}
|
3697
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3698
|
+
[:"netlifyAuth", ],
|
3699
|
+
**_kwargs
|
3700
|
+
)
|
3701
|
+
|
3702
|
+
|
3703
|
+
_response = _http_client.put(
|
3704
|
+
_url,
|
3705
|
+
json: data,
|
3706
|
+
**_req_kwargs
|
3707
|
+
)
|
3708
|
+
|
3709
|
+
# Raise if not expected success code
|
3710
|
+
if _response.status != 204
|
3711
|
+
raise RequestError.new(
|
3712
|
+
method="put",
|
3713
|
+
url=_url,
|
3714
|
+
response=_response
|
3715
|
+
)
|
3716
|
+
end
|
3717
|
+
|
3718
|
+
return _response.body.empty? ? '' : _response.parse
|
3719
|
+
end
|
3720
|
+
|
3721
|
+
def update_site_snippet(data, site_id, snippet_id)
|
3722
|
+
_url = @_base_url + "/sites/#{site_id}/snippets/#{snippet_id}"
|
3723
|
+
_kwargs = {
|
3724
|
+
params: {}
|
3725
|
+
}
|
3726
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3727
|
+
[:"netlifyAuth", ],
|
3728
|
+
**_kwargs
|
3729
|
+
)
|
3730
|
+
|
3731
|
+
|
3732
|
+
_response = _http_client.put(
|
3733
|
+
_url,
|
3734
|
+
json: data,
|
3735
|
+
**_req_kwargs
|
3736
|
+
)
|
3737
|
+
|
3738
|
+
# Raise if not expected success code
|
3739
|
+
if _response.status != 204
|
3740
|
+
raise RequestError.new(
|
3741
|
+
method="put",
|
3742
|
+
url=_url,
|
3743
|
+
response=_response
|
3744
|
+
)
|
3745
|
+
end
|
3746
|
+
|
3747
|
+
return _response.body.empty? ? '' : _response.parse
|
3748
|
+
end
|
3749
|
+
|
3750
|
+
def update_split_test(data, site_id, split_test_id)
|
3751
|
+
_url = @_base_url + "/sites/#{site_id}/traffic_splits/#{split_test_id}"
|
3752
|
+
_kwargs = {
|
3753
|
+
params: {}
|
3754
|
+
}
|
3755
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3756
|
+
[:"netlifyAuth", ],
|
3757
|
+
**_kwargs
|
3758
|
+
)
|
3759
|
+
|
3760
|
+
|
3761
|
+
_response = _http_client.put(
|
3762
|
+
_url,
|
3763
|
+
json: data,
|
3764
|
+
**_req_kwargs
|
3765
|
+
)
|
3766
|
+
|
3767
|
+
# Raise if not expected success code
|
3768
|
+
if _response.status != 201
|
3769
|
+
raise RequestError.new(
|
3770
|
+
method="put",
|
3771
|
+
url=_url,
|
3772
|
+
response=_response
|
3773
|
+
)
|
3774
|
+
end
|
3775
|
+
|
3776
|
+
return _response.body.empty? ? '' : _response.parse
|
3777
|
+
end
|
3778
|
+
|
3779
|
+
# [Beta] Unlinks the repo from the site.
|
3780
|
+
#
|
3781
|
+
# This action will also:
|
3782
|
+
# - Delete associated deploy keys
|
3783
|
+
# - Delete outgoing webhooks for the repo
|
3784
|
+
# - Delete the site's build hooks
|
3785
|
+
def unlink_site_repo(site_id)
|
3786
|
+
_url = @_base_url + "/sites/#{site_id}/unlink_repo"
|
3787
|
+
_kwargs = {
|
3788
|
+
params: {}
|
3789
|
+
}
|
3790
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3791
|
+
[:"netlifyAuth", ],
|
3792
|
+
**_kwargs
|
3793
|
+
)
|
3794
|
+
|
3795
|
+
|
3796
|
+
_response = _http_client.put(
|
3797
|
+
_url,
|
3798
|
+
|
3799
|
+
**_req_kwargs
|
3800
|
+
)
|
3801
|
+
|
3802
|
+
# Raise if not expected success code
|
3803
|
+
if _response.status != 200
|
3804
|
+
raise RequestError.new(
|
3805
|
+
method="put",
|
3806
|
+
url=_url,
|
3807
|
+
response=_response
|
3808
|
+
)
|
3809
|
+
end
|
3810
|
+
|
3811
|
+
return _response.body.empty? ? '' : _response.parse
|
3812
|
+
end
|
3813
|
+
|
3814
|
+
def update_account_member(data, account_slug, member_id)
|
3815
|
+
_url = @_base_url + "/#{account_slug}/members/#{member_id}"
|
3816
|
+
_kwargs = {
|
3817
|
+
params: {}
|
3818
|
+
}
|
3819
|
+
_http_client, _req_kwargs = self._client_with_auth(
|
3820
|
+
[:"netlifyAuth", ],
|
3821
|
+
**_kwargs
|
3822
|
+
)
|
3823
|
+
|
3824
|
+
|
3825
|
+
_response = _http_client.put(
|
3826
|
+
_url,
|
3827
|
+
json: data,
|
3828
|
+
**_req_kwargs
|
3829
|
+
)
|
3830
|
+
|
3831
|
+
# Raise if not expected success code
|
3832
|
+
if _response.status != 200
|
3833
|
+
raise RequestError.new(
|
3834
|
+
method="put",
|
3835
|
+
url=_url,
|
3836
|
+
response=_response
|
3837
|
+
)
|
3838
|
+
end
|
3839
|
+
|
3840
|
+
return _response.body.empty? ? '' : _response.parse
|
3841
|
+
end
|
3842
|
+
|
3843
|
+
end
|