files.com 1.1.18 → 1.2.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.
- package/.eslintrc.js +0 -3
- package/_VERSION +1 -1
- package/docs/Errors.md +1 -0
- package/lib/Api.js +1 -1
- package/lib/Errors.js +957 -933
- package/lib/Files.js +1 -1
- package/lib/models/ActionNotificationExport.js +25 -25
- package/lib/models/ActionNotificationExportResult.js +10 -10
- package/lib/models/ActionWebhookFailure.js +5 -9
- package/lib/models/ApiKey.js +62 -70
- package/lib/models/App.js +5 -5
- package/lib/models/As2IncomingMessage.js +7 -7
- package/lib/models/As2OutgoingMessage.js +7 -7
- package/lib/models/As2Partner.js +54 -58
- package/lib/models/As2Station.js +51 -55
- package/lib/models/Automation.js +102 -110
- package/lib/models/AutomationRun.js +13 -13
- package/lib/models/BandwidthSnapshot.js +5 -5
- package/lib/models/Behavior.js +77 -85
- package/lib/models/Bundle.js +102 -110
- package/lib/models/BundleDownload.js +9 -9
- package/lib/models/BundleNotification.js +37 -41
- package/lib/models/BundleRecipient.js +22 -22
- package/lib/models/BundleRegistration.js +7 -7
- package/lib/models/Clickwrap.js +52 -56
- package/lib/models/DnsRecord.js +5 -5
- package/lib/models/EmailIncomingMessage.js +5 -5
- package/lib/models/ExternalEvent.js +18 -18
- package/lib/models/File.js +89 -93
- package/lib/models/FileComment.js +41 -45
- package/lib/models/FileCommentReaction.js +15 -19
- package/lib/models/FileMigration.js +5 -5
- package/lib/models/Folder.js +24 -24
- package/lib/models/FormFieldSet.js +44 -48
- package/lib/models/GpgKey.js +53 -57
- package/lib/models/Group.js +51 -55
- package/lib/models/GroupUser.js +53 -57
- package/lib/models/History.js +72 -72
- package/lib/models/HistoryExport.js +51 -51
- package/lib/models/HistoryExportResult.js +10 -10
- package/lib/models/InboxRecipient.js +22 -22
- package/lib/models/InboxRegistration.js +7 -7
- package/lib/models/InboxUpload.js +9 -9
- package/lib/models/Invoice.js +12 -12
- package/lib/models/IpAddress.js +17 -17
- package/lib/models/Lock.js +27 -31
- package/lib/models/Message.js +60 -64
- package/lib/models/MessageComment.js +46 -50
- package/lib/models/MessageCommentReaction.js +27 -31
- package/lib/models/MessageReaction.js +27 -31
- package/lib/models/Notification.js +66 -70
- package/lib/models/Payment.js +12 -12
- package/lib/models/Permission.js +28 -32
- package/lib/models/Priority.js +9 -9
- package/lib/models/Project.js +39 -43
- package/lib/models/PublicKey.js +46 -50
- package/lib/models/RemoteBandwidthSnapshot.js +5 -5
- package/lib/models/RemoteServer.js +306 -310
- package/lib/models/Request.js +33 -37
- package/lib/models/Session.js +11 -15
- package/lib/models/SettingsChange.js +5 -5
- package/lib/models/SftpHostKey.js +40 -44
- package/lib/models/ShareGroup.js +50 -54
- package/lib/models/Site.js +138 -138
- package/lib/models/Snapshot.js +44 -48
- package/lib/models/SsoStrategy.js +15 -19
- package/lib/models/Style.js +17 -21
- package/lib/models/UsageDailySnapshot.js +5 -5
- package/lib/models/UsageSnapshot.js +5 -5
- package/lib/models/User.js +156 -172
- package/lib/models/UserCipherUse.js +7 -7
- package/lib/models/UserRequest.js +26 -30
- package/lib/models/WebhookTest.js +15 -15
- package/package.json +6 -2
- package/src/Api.js +2 -1
- package/src/Errors.js +189 -177
- package/src/Files.js +1 -1
- package/src/models/AccountLineItem.js +5 -2
- package/src/models/Action.js +5 -2
- package/src/models/ActionNotificationExport.js +36 -35
- package/src/models/ActionNotificationExportResult.js +15 -13
- package/src/models/ActionWebhookFailure.js +9 -8
- package/src/models/ApiKey.js +69 -72
- package/src/models/App.js +10 -8
- package/src/models/As2IncomingMessage.js +12 -10
- package/src/models/As2OutgoingMessage.js +12 -10
- package/src/models/As2Partner.js +61 -60
- package/src/models/As2Station.js +58 -57
- package/src/models/Auto.js +5 -2
- package/src/models/Automation.js +121 -110
- package/src/models/AutomationRun.js +18 -17
- package/src/models/BandwidthSnapshot.js +10 -8
- package/src/models/Behavior.js +85 -86
- package/src/models/Bundle.js +121 -110
- package/src/models/BundleDownload.js +14 -12
- package/src/models/BundleNotification.js +40 -43
- package/src/models/BundleRecipient.js +33 -32
- package/src/models/BundleRegistration.js +12 -10
- package/src/models/Clickwrap.js +60 -58
- package/src/models/DnsRecord.js +10 -8
- package/src/models/EmailIncomingMessage.js +10 -8
- package/src/models/Errors.js +5 -2
- package/src/models/ExternalEvent.js +29 -29
- package/src/models/File.js +116 -108
- package/src/models/FileAction.js +5 -2
- package/src/models/FileComment.js +45 -46
- package/src/models/FileCommentReaction.js +26 -26
- package/src/models/FileMigration.js +10 -8
- package/src/models/FileUploadPart.js +5 -2
- package/src/models/Folder.js +32 -29
- package/src/models/FormField.js +5 -2
- package/src/models/FormFieldSet.js +49 -50
- package/src/models/GpgKey.js +60 -59
- package/src/models/Group.js +58 -57
- package/src/models/GroupUser.js +60 -58
- package/src/models/History.js +77 -74
- package/src/models/HistoryExport.js +62 -61
- package/src/models/HistoryExportResult.js +15 -13
- package/src/models/Image.js +5 -2
- package/src/models/InboxRecipient.js +33 -32
- package/src/models/InboxRegistration.js +12 -10
- package/src/models/InboxUpload.js +14 -12
- package/src/models/Invoice.js +17 -14
- package/src/models/InvoiceLineItem.js +5 -2
- package/src/models/IpAddress.js +22 -20
- package/src/models/Lock.js +36 -36
- package/src/models/Message.js +66 -66
- package/src/models/MessageComment.js +50 -52
- package/src/models/MessageCommentReaction.js +38 -40
- package/src/models/MessageReaction.js +38 -40
- package/src/models/Notification.js +74 -72
- package/src/models/Payment.js +17 -14
- package/src/models/PaymentLineItem.js +5 -2
- package/src/models/Permission.js +39 -40
- package/src/models/Preview.js +5 -2
- package/src/models/Priority.js +14 -12
- package/src/models/Project.js +43 -45
- package/src/models/PublicIpAddress.js +5 -2
- package/src/models/PublicKey.js +50 -52
- package/src/models/RemoteBandwidthSnapshot.js +10 -8
- package/src/models/RemoteServer.js +380 -312
- package/src/models/RemoteServerConfigurationFile.js +5 -2
- package/src/models/Request.js +44 -46
- package/src/models/Session.js +22 -22
- package/src/models/SettingsChange.js +10 -8
- package/src/models/SftpHostKey.js +45 -46
- package/src/models/ShareGroup.js +56 -56
- package/src/models/ShareGroupMember.js +5 -2
- package/src/models/Site.js +143 -142
- package/src/models/Snapshot.js +50 -50
- package/src/models/SsoStrategy.js +20 -21
- package/src/models/Status.js +5 -2
- package/src/models/Style.js +22 -23
- package/src/models/UsageDailySnapshot.js +10 -8
- package/src/models/UsageSnapshot.js +10 -8
- package/src/models/User.js +185 -168
- package/src/models/UserCipherUse.js +12 -10
- package/src/models/UserRequest.js +37 -39
- package/src/models/WebhookTest.js +26 -24
- package/test/Api.test.js +163 -0
- package/test/{package.json → integration/package.json} +1 -1
- package/test/{src → integration/src}/index.js +1 -1
- package/test.sh +2 -1
- /package/test/{.babelrc → integration/.babelrc} +0 -0
- /package/test/{index.js → integration/index.js} +0 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
2
|
import Api from '../Api'
|
|
3
3
|
import * as errors from '../Errors'
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
getType, isArray, isInt, isObject, isString,
|
|
6
|
+
} from '../utils'
|
|
5
7
|
/* eslint-enable no-unused-vars */
|
|
6
8
|
|
|
7
9
|
/**
|
|
@@ -9,6 +11,7 @@ import { getType, isArray, isInt, isObject, isString } from '../utils'
|
|
|
9
11
|
*/
|
|
10
12
|
class RemoteServer {
|
|
11
13
|
attributes = {}
|
|
14
|
+
|
|
12
15
|
options = {}
|
|
13
16
|
|
|
14
17
|
constructor(attributes = {}, options = {}) {
|
|
@@ -24,6 +27,7 @@ class RemoteServer {
|
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
isLoaded = () => !!this.attributes.id
|
|
30
|
+
|
|
27
31
|
// int64 # Remote server ID
|
|
28
32
|
getId = () => this.attributes.id
|
|
29
33
|
|
|
@@ -542,7 +546,6 @@ class RemoteServer {
|
|
|
542
546
|
this.attributes.linode_secret_key = value
|
|
543
547
|
}
|
|
544
548
|
|
|
545
|
-
|
|
546
549
|
// Post local changes, check in, and download configuration file (used by some Remote Server integrations, such as the Files.com Agent)
|
|
547
550
|
//
|
|
548
551
|
// Parameters:
|
|
@@ -567,54 +570,65 @@ class RemoteServer {
|
|
|
567
570
|
}
|
|
568
571
|
|
|
569
572
|
params.id = this.attributes.id
|
|
570
|
-
if (params
|
|
571
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params
|
|
573
|
+
if (params.id && !isInt(params.id)) {
|
|
574
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params.id)}`)
|
|
572
575
|
}
|
|
573
|
-
|
|
574
|
-
|
|
576
|
+
|
|
577
|
+
if (params.api_token && !isString(params.api_token)) {
|
|
578
|
+
throw new errors.InvalidParameterError(`Bad parameter: api_token must be of type String, received ${getType(params.api_token)}`)
|
|
575
579
|
}
|
|
576
|
-
|
|
577
|
-
|
|
580
|
+
|
|
581
|
+
if (params.permission_set && !isString(params.permission_set)) {
|
|
582
|
+
throw new errors.InvalidParameterError(`Bad parameter: permission_set must be of type String, received ${getType(params.permission_set)}`)
|
|
578
583
|
}
|
|
579
|
-
|
|
580
|
-
|
|
584
|
+
|
|
585
|
+
if (params.root && !isString(params.root)) {
|
|
586
|
+
throw new errors.InvalidParameterError(`Bad parameter: root must be of type String, received ${getType(params.root)}`)
|
|
581
587
|
}
|
|
582
|
-
|
|
583
|
-
|
|
588
|
+
|
|
589
|
+
if (params.hostname && !isString(params.hostname)) {
|
|
590
|
+
throw new errors.InvalidParameterError(`Bad parameter: hostname must be of type String, received ${getType(params.hostname)}`)
|
|
584
591
|
}
|
|
585
|
-
|
|
586
|
-
|
|
592
|
+
|
|
593
|
+
if (params.port && !isInt(params.port)) {
|
|
594
|
+
throw new errors.InvalidParameterError(`Bad parameter: port must be of type Int, received ${getType(params.port)}`)
|
|
587
595
|
}
|
|
588
|
-
|
|
589
|
-
|
|
596
|
+
|
|
597
|
+
if (params.status && !isString(params.status)) {
|
|
598
|
+
throw new errors.InvalidParameterError(`Bad parameter: status must be of type String, received ${getType(params.status)}`)
|
|
590
599
|
}
|
|
591
|
-
|
|
592
|
-
|
|
600
|
+
|
|
601
|
+
if (params.config_version && !isString(params.config_version)) {
|
|
602
|
+
throw new errors.InvalidParameterError(`Bad parameter: config_version must be of type String, received ${getType(params.config_version)}`)
|
|
593
603
|
}
|
|
594
|
-
|
|
595
|
-
|
|
604
|
+
|
|
605
|
+
if (params.private_key && !isString(params.private_key)) {
|
|
606
|
+
throw new errors.InvalidParameterError(`Bad parameter: private_key must be of type String, received ${getType(params.private_key)}`)
|
|
596
607
|
}
|
|
597
|
-
|
|
598
|
-
|
|
608
|
+
|
|
609
|
+
if (params.public_key && !isString(params.public_key)) {
|
|
610
|
+
throw new errors.InvalidParameterError(`Bad parameter: public_key must be of type String, received ${getType(params.public_key)}`)
|
|
599
611
|
}
|
|
600
|
-
|
|
601
|
-
|
|
612
|
+
|
|
613
|
+
if (params.server_host_key && !isString(params.server_host_key)) {
|
|
614
|
+
throw new errors.InvalidParameterError(`Bad parameter: server_host_key must be of type String, received ${getType(params.server_host_key)}`)
|
|
602
615
|
}
|
|
603
|
-
|
|
604
|
-
|
|
616
|
+
|
|
617
|
+
if (params.subdomain && !isString(params.subdomain)) {
|
|
618
|
+
throw new errors.InvalidParameterError(`Bad parameter: subdomain must be of type String, received ${getType(params.subdomain)}`)
|
|
605
619
|
}
|
|
606
620
|
|
|
607
|
-
if (!params
|
|
621
|
+
if (!params.id) {
|
|
608
622
|
if (this.attributes.id) {
|
|
609
|
-
params
|
|
623
|
+
params.id = this.id
|
|
610
624
|
} else {
|
|
611
625
|
throw new errors.MissingParameterError('Parameter missing: id')
|
|
612
626
|
}
|
|
613
627
|
}
|
|
614
628
|
|
|
615
|
-
const response = await Api.sendRequest(`/remote_servers/${encodeURIComponent(params
|
|
629
|
+
const response = await Api.sendRequest(`/remote_servers/${encodeURIComponent(params.id)}/configuration_file`, 'POST', params, this.options)
|
|
616
630
|
|
|
617
|
-
const RemoteServerConfigurationFile = require(
|
|
631
|
+
const RemoteServerConfigurationFile = require('./RemoteServerConfigurationFile.js').default
|
|
618
632
|
return new RemoteServerConfigurationFile(response?.data, this.options)
|
|
619
633
|
}
|
|
620
634
|
|
|
@@ -694,201 +708,260 @@ class RemoteServer {
|
|
|
694
708
|
}
|
|
695
709
|
|
|
696
710
|
params.id = this.attributes.id
|
|
697
|
-
if (params
|
|
698
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params
|
|
711
|
+
if (params.id && !isInt(params.id)) {
|
|
712
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params.id)}`)
|
|
699
713
|
}
|
|
700
|
-
|
|
701
|
-
|
|
714
|
+
|
|
715
|
+
if (params.aws_access_key && !isString(params.aws_access_key)) {
|
|
716
|
+
throw new errors.InvalidParameterError(`Bad parameter: aws_access_key must be of type String, received ${getType(params.aws_access_key)}`)
|
|
702
717
|
}
|
|
703
|
-
|
|
704
|
-
|
|
718
|
+
|
|
719
|
+
if (params.aws_secret_key && !isString(params.aws_secret_key)) {
|
|
720
|
+
throw new errors.InvalidParameterError(`Bad parameter: aws_secret_key must be of type String, received ${getType(params.aws_secret_key)}`)
|
|
705
721
|
}
|
|
706
|
-
|
|
707
|
-
|
|
722
|
+
|
|
723
|
+
if (params.password && !isString(params.password)) {
|
|
724
|
+
throw new errors.InvalidParameterError(`Bad parameter: password must be of type String, received ${getType(params.password)}`)
|
|
708
725
|
}
|
|
709
|
-
|
|
710
|
-
|
|
726
|
+
|
|
727
|
+
if (params.private_key && !isString(params.private_key)) {
|
|
728
|
+
throw new errors.InvalidParameterError(`Bad parameter: private_key must be of type String, received ${getType(params.private_key)}`)
|
|
711
729
|
}
|
|
712
|
-
|
|
713
|
-
|
|
730
|
+
|
|
731
|
+
if (params.private_key_passphrase && !isString(params.private_key_passphrase)) {
|
|
732
|
+
throw new errors.InvalidParameterError(`Bad parameter: private_key_passphrase must be of type String, received ${getType(params.private_key_passphrase)}`)
|
|
714
733
|
}
|
|
715
|
-
|
|
716
|
-
|
|
734
|
+
|
|
735
|
+
if (params.ssl_certificate && !isString(params.ssl_certificate)) {
|
|
736
|
+
throw new errors.InvalidParameterError(`Bad parameter: ssl_certificate must be of type String, received ${getType(params.ssl_certificate)}`)
|
|
717
737
|
}
|
|
718
|
-
|
|
719
|
-
|
|
738
|
+
|
|
739
|
+
if (params.google_cloud_storage_credentials_json && !isString(params.google_cloud_storage_credentials_json)) {
|
|
740
|
+
throw new errors.InvalidParameterError(`Bad parameter: google_cloud_storage_credentials_json must be of type String, received ${getType(params.google_cloud_storage_credentials_json)}`)
|
|
720
741
|
}
|
|
721
|
-
|
|
722
|
-
|
|
742
|
+
|
|
743
|
+
if (params.wasabi_access_key && !isString(params.wasabi_access_key)) {
|
|
744
|
+
throw new errors.InvalidParameterError(`Bad parameter: wasabi_access_key must be of type String, received ${getType(params.wasabi_access_key)}`)
|
|
723
745
|
}
|
|
724
|
-
|
|
725
|
-
|
|
746
|
+
|
|
747
|
+
if (params.wasabi_secret_key && !isString(params.wasabi_secret_key)) {
|
|
748
|
+
throw new errors.InvalidParameterError(`Bad parameter: wasabi_secret_key must be of type String, received ${getType(params.wasabi_secret_key)}`)
|
|
726
749
|
}
|
|
727
|
-
|
|
728
|
-
|
|
750
|
+
|
|
751
|
+
if (params.backblaze_b2_key_id && !isString(params.backblaze_b2_key_id)) {
|
|
752
|
+
throw new errors.InvalidParameterError(`Bad parameter: backblaze_b2_key_id must be of type String, received ${getType(params.backblaze_b2_key_id)}`)
|
|
729
753
|
}
|
|
730
|
-
|
|
731
|
-
|
|
754
|
+
|
|
755
|
+
if (params.backblaze_b2_application_key && !isString(params.backblaze_b2_application_key)) {
|
|
756
|
+
throw new errors.InvalidParameterError(`Bad parameter: backblaze_b2_application_key must be of type String, received ${getType(params.backblaze_b2_application_key)}`)
|
|
732
757
|
}
|
|
733
|
-
|
|
734
|
-
|
|
758
|
+
|
|
759
|
+
if (params.rackspace_api_key && !isString(params.rackspace_api_key)) {
|
|
760
|
+
throw new errors.InvalidParameterError(`Bad parameter: rackspace_api_key must be of type String, received ${getType(params.rackspace_api_key)}`)
|
|
735
761
|
}
|
|
736
|
-
|
|
737
|
-
|
|
762
|
+
|
|
763
|
+
if (params.azure_blob_storage_access_key && !isString(params.azure_blob_storage_access_key)) {
|
|
764
|
+
throw new errors.InvalidParameterError(`Bad parameter: azure_blob_storage_access_key must be of type String, received ${getType(params.azure_blob_storage_access_key)}`)
|
|
738
765
|
}
|
|
739
|
-
|
|
740
|
-
|
|
766
|
+
|
|
767
|
+
if (params.azure_files_storage_access_key && !isString(params.azure_files_storage_access_key)) {
|
|
768
|
+
throw new errors.InvalidParameterError(`Bad parameter: azure_files_storage_access_key must be of type String, received ${getType(params.azure_files_storage_access_key)}`)
|
|
741
769
|
}
|
|
742
|
-
|
|
743
|
-
|
|
770
|
+
|
|
771
|
+
if (params.hostname && !isString(params.hostname)) {
|
|
772
|
+
throw new errors.InvalidParameterError(`Bad parameter: hostname must be of type String, received ${getType(params.hostname)}`)
|
|
744
773
|
}
|
|
745
|
-
|
|
746
|
-
|
|
774
|
+
|
|
775
|
+
if (params.name && !isString(params.name)) {
|
|
776
|
+
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params.name)}`)
|
|
747
777
|
}
|
|
748
|
-
|
|
749
|
-
|
|
778
|
+
|
|
779
|
+
if (params.max_connections && !isInt(params.max_connections)) {
|
|
780
|
+
throw new errors.InvalidParameterError(`Bad parameter: max_connections must be of type Int, received ${getType(params.max_connections)}`)
|
|
750
781
|
}
|
|
751
|
-
|
|
752
|
-
|
|
782
|
+
|
|
783
|
+
if (params.port && !isInt(params.port)) {
|
|
784
|
+
throw new errors.InvalidParameterError(`Bad parameter: port must be of type Int, received ${getType(params.port)}`)
|
|
753
785
|
}
|
|
754
|
-
|
|
755
|
-
|
|
786
|
+
|
|
787
|
+
if (params.s3_bucket && !isString(params.s3_bucket)) {
|
|
788
|
+
throw new errors.InvalidParameterError(`Bad parameter: s3_bucket must be of type String, received ${getType(params.s3_bucket)}`)
|
|
756
789
|
}
|
|
757
|
-
|
|
758
|
-
|
|
790
|
+
|
|
791
|
+
if (params.s3_region && !isString(params.s3_region)) {
|
|
792
|
+
throw new errors.InvalidParameterError(`Bad parameter: s3_region must be of type String, received ${getType(params.s3_region)}`)
|
|
759
793
|
}
|
|
760
|
-
|
|
761
|
-
|
|
794
|
+
|
|
795
|
+
if (params.server_certificate && !isString(params.server_certificate)) {
|
|
796
|
+
throw new errors.InvalidParameterError(`Bad parameter: server_certificate must be of type String, received ${getType(params.server_certificate)}`)
|
|
762
797
|
}
|
|
763
|
-
|
|
764
|
-
|
|
798
|
+
|
|
799
|
+
if (params.server_host_key && !isString(params.server_host_key)) {
|
|
800
|
+
throw new errors.InvalidParameterError(`Bad parameter: server_host_key must be of type String, received ${getType(params.server_host_key)}`)
|
|
765
801
|
}
|
|
766
|
-
|
|
767
|
-
|
|
802
|
+
|
|
803
|
+
if (params.server_type && !isString(params.server_type)) {
|
|
804
|
+
throw new errors.InvalidParameterError(`Bad parameter: server_type must be of type String, received ${getType(params.server_type)}`)
|
|
768
805
|
}
|
|
769
|
-
|
|
770
|
-
|
|
806
|
+
|
|
807
|
+
if (params.ssl && !isString(params.ssl)) {
|
|
808
|
+
throw new errors.InvalidParameterError(`Bad parameter: ssl must be of type String, received ${getType(params.ssl)}`)
|
|
771
809
|
}
|
|
772
|
-
|
|
773
|
-
|
|
810
|
+
|
|
811
|
+
if (params.username && !isString(params.username)) {
|
|
812
|
+
throw new errors.InvalidParameterError(`Bad parameter: username must be of type String, received ${getType(params.username)}`)
|
|
774
813
|
}
|
|
775
|
-
|
|
776
|
-
|
|
814
|
+
|
|
815
|
+
if (params.google_cloud_storage_bucket && !isString(params.google_cloud_storage_bucket)) {
|
|
816
|
+
throw new errors.InvalidParameterError(`Bad parameter: google_cloud_storage_bucket must be of type String, received ${getType(params.google_cloud_storage_bucket)}`)
|
|
777
817
|
}
|
|
778
|
-
|
|
779
|
-
|
|
818
|
+
|
|
819
|
+
if (params.google_cloud_storage_project_id && !isString(params.google_cloud_storage_project_id)) {
|
|
820
|
+
throw new errors.InvalidParameterError(`Bad parameter: google_cloud_storage_project_id must be of type String, received ${getType(params.google_cloud_storage_project_id)}`)
|
|
780
821
|
}
|
|
781
|
-
|
|
782
|
-
|
|
822
|
+
|
|
823
|
+
if (params.backblaze_b2_bucket && !isString(params.backblaze_b2_bucket)) {
|
|
824
|
+
throw new errors.InvalidParameterError(`Bad parameter: backblaze_b2_bucket must be of type String, received ${getType(params.backblaze_b2_bucket)}`)
|
|
783
825
|
}
|
|
784
|
-
|
|
785
|
-
|
|
826
|
+
|
|
827
|
+
if (params.backblaze_b2_s3_endpoint && !isString(params.backblaze_b2_s3_endpoint)) {
|
|
828
|
+
throw new errors.InvalidParameterError(`Bad parameter: backblaze_b2_s3_endpoint must be of type String, received ${getType(params.backblaze_b2_s3_endpoint)}`)
|
|
786
829
|
}
|
|
787
|
-
|
|
788
|
-
|
|
830
|
+
|
|
831
|
+
if (params.wasabi_bucket && !isString(params.wasabi_bucket)) {
|
|
832
|
+
throw new errors.InvalidParameterError(`Bad parameter: wasabi_bucket must be of type String, received ${getType(params.wasabi_bucket)}`)
|
|
789
833
|
}
|
|
790
|
-
|
|
791
|
-
|
|
834
|
+
|
|
835
|
+
if (params.wasabi_region && !isString(params.wasabi_region)) {
|
|
836
|
+
throw new errors.InvalidParameterError(`Bad parameter: wasabi_region must be of type String, received ${getType(params.wasabi_region)}`)
|
|
792
837
|
}
|
|
793
|
-
|
|
794
|
-
|
|
838
|
+
|
|
839
|
+
if (params.rackspace_username && !isString(params.rackspace_username)) {
|
|
840
|
+
throw new errors.InvalidParameterError(`Bad parameter: rackspace_username must be of type String, received ${getType(params.rackspace_username)}`)
|
|
795
841
|
}
|
|
796
|
-
|
|
797
|
-
|
|
842
|
+
|
|
843
|
+
if (params.rackspace_region && !isString(params.rackspace_region)) {
|
|
844
|
+
throw new errors.InvalidParameterError(`Bad parameter: rackspace_region must be of type String, received ${getType(params.rackspace_region)}`)
|
|
798
845
|
}
|
|
799
|
-
|
|
800
|
-
|
|
846
|
+
|
|
847
|
+
if (params.rackspace_container && !isString(params.rackspace_container)) {
|
|
848
|
+
throw new errors.InvalidParameterError(`Bad parameter: rackspace_container must be of type String, received ${getType(params.rackspace_container)}`)
|
|
801
849
|
}
|
|
802
|
-
|
|
803
|
-
|
|
850
|
+
|
|
851
|
+
if (params.one_drive_account_type && !isString(params.one_drive_account_type)) {
|
|
852
|
+
throw new errors.InvalidParameterError(`Bad parameter: one_drive_account_type must be of type String, received ${getType(params.one_drive_account_type)}`)
|
|
804
853
|
}
|
|
805
|
-
|
|
806
|
-
|
|
854
|
+
|
|
855
|
+
if (params.azure_blob_storage_account && !isString(params.azure_blob_storage_account)) {
|
|
856
|
+
throw new errors.InvalidParameterError(`Bad parameter: azure_blob_storage_account must be of type String, received ${getType(params.azure_blob_storage_account)}`)
|
|
807
857
|
}
|
|
808
|
-
|
|
809
|
-
|
|
858
|
+
|
|
859
|
+
if (params.azure_blob_storage_container && !isString(params.azure_blob_storage_container)) {
|
|
860
|
+
throw new errors.InvalidParameterError(`Bad parameter: azure_blob_storage_container must be of type String, received ${getType(params.azure_blob_storage_container)}`)
|
|
810
861
|
}
|
|
811
|
-
|
|
812
|
-
|
|
862
|
+
|
|
863
|
+
if (params.azure_blob_storage_sas_token && !isString(params.azure_blob_storage_sas_token)) {
|
|
864
|
+
throw new errors.InvalidParameterError(`Bad parameter: azure_blob_storage_sas_token must be of type String, received ${getType(params.azure_blob_storage_sas_token)}`)
|
|
813
865
|
}
|
|
814
|
-
|
|
815
|
-
|
|
866
|
+
|
|
867
|
+
if (params.azure_files_storage_account && !isString(params.azure_files_storage_account)) {
|
|
868
|
+
throw new errors.InvalidParameterError(`Bad parameter: azure_files_storage_account must be of type String, received ${getType(params.azure_files_storage_account)}`)
|
|
816
869
|
}
|
|
817
|
-
|
|
818
|
-
|
|
870
|
+
|
|
871
|
+
if (params.azure_files_storage_share_name && !isString(params.azure_files_storage_share_name)) {
|
|
872
|
+
throw new errors.InvalidParameterError(`Bad parameter: azure_files_storage_share_name must be of type String, received ${getType(params.azure_files_storage_share_name)}`)
|
|
819
873
|
}
|
|
820
|
-
|
|
821
|
-
|
|
874
|
+
|
|
875
|
+
if (params.azure_files_storage_sas_token && !isString(params.azure_files_storage_sas_token)) {
|
|
876
|
+
throw new errors.InvalidParameterError(`Bad parameter: azure_files_storage_sas_token must be of type String, received ${getType(params.azure_files_storage_sas_token)}`)
|
|
822
877
|
}
|
|
823
|
-
|
|
824
|
-
|
|
878
|
+
|
|
879
|
+
if (params.s3_compatible_bucket && !isString(params.s3_compatible_bucket)) {
|
|
880
|
+
throw new errors.InvalidParameterError(`Bad parameter: s3_compatible_bucket must be of type String, received ${getType(params.s3_compatible_bucket)}`)
|
|
825
881
|
}
|
|
826
|
-
|
|
827
|
-
|
|
882
|
+
|
|
883
|
+
if (params.s3_compatible_endpoint && !isString(params.s3_compatible_endpoint)) {
|
|
884
|
+
throw new errors.InvalidParameterError(`Bad parameter: s3_compatible_endpoint must be of type String, received ${getType(params.s3_compatible_endpoint)}`)
|
|
828
885
|
}
|
|
829
|
-
|
|
830
|
-
|
|
886
|
+
|
|
887
|
+
if (params.s3_compatible_region && !isString(params.s3_compatible_region)) {
|
|
888
|
+
throw new errors.InvalidParameterError(`Bad parameter: s3_compatible_region must be of type String, received ${getType(params.s3_compatible_region)}`)
|
|
831
889
|
}
|
|
832
|
-
|
|
833
|
-
|
|
890
|
+
|
|
891
|
+
if (params.s3_compatible_access_key && !isString(params.s3_compatible_access_key)) {
|
|
892
|
+
throw new errors.InvalidParameterError(`Bad parameter: s3_compatible_access_key must be of type String, received ${getType(params.s3_compatible_access_key)}`)
|
|
834
893
|
}
|
|
835
|
-
|
|
836
|
-
|
|
894
|
+
|
|
895
|
+
if (params.s3_compatible_secret_key && !isString(params.s3_compatible_secret_key)) {
|
|
896
|
+
throw new errors.InvalidParameterError(`Bad parameter: s3_compatible_secret_key must be of type String, received ${getType(params.s3_compatible_secret_key)}`)
|
|
837
897
|
}
|
|
838
|
-
|
|
839
|
-
|
|
898
|
+
|
|
899
|
+
if (params.files_agent_root && !isString(params.files_agent_root)) {
|
|
900
|
+
throw new errors.InvalidParameterError(`Bad parameter: files_agent_root must be of type String, received ${getType(params.files_agent_root)}`)
|
|
840
901
|
}
|
|
841
|
-
|
|
842
|
-
|
|
902
|
+
|
|
903
|
+
if (params.files_agent_permission_set && !isString(params.files_agent_permission_set)) {
|
|
904
|
+
throw new errors.InvalidParameterError(`Bad parameter: files_agent_permission_set must be of type String, received ${getType(params.files_agent_permission_set)}`)
|
|
843
905
|
}
|
|
844
|
-
|
|
845
|
-
|
|
906
|
+
|
|
907
|
+
if (params.files_agent_version && !isString(params.files_agent_version)) {
|
|
908
|
+
throw new errors.InvalidParameterError(`Bad parameter: files_agent_version must be of type String, received ${getType(params.files_agent_version)}`)
|
|
846
909
|
}
|
|
847
|
-
|
|
848
|
-
|
|
910
|
+
|
|
911
|
+
if (params.filebase_access_key && !isString(params.filebase_access_key)) {
|
|
912
|
+
throw new errors.InvalidParameterError(`Bad parameter: filebase_access_key must be of type String, received ${getType(params.filebase_access_key)}`)
|
|
849
913
|
}
|
|
850
|
-
|
|
851
|
-
|
|
914
|
+
|
|
915
|
+
if (params.filebase_secret_key && !isString(params.filebase_secret_key)) {
|
|
916
|
+
throw new errors.InvalidParameterError(`Bad parameter: filebase_secret_key must be of type String, received ${getType(params.filebase_secret_key)}`)
|
|
852
917
|
}
|
|
853
|
-
|
|
854
|
-
|
|
918
|
+
|
|
919
|
+
if (params.filebase_bucket && !isString(params.filebase_bucket)) {
|
|
920
|
+
throw new errors.InvalidParameterError(`Bad parameter: filebase_bucket must be of type String, received ${getType(params.filebase_bucket)}`)
|
|
855
921
|
}
|
|
856
|
-
|
|
857
|
-
|
|
922
|
+
|
|
923
|
+
if (params.cloudflare_access_key && !isString(params.cloudflare_access_key)) {
|
|
924
|
+
throw new errors.InvalidParameterError(`Bad parameter: cloudflare_access_key must be of type String, received ${getType(params.cloudflare_access_key)}`)
|
|
858
925
|
}
|
|
859
|
-
|
|
860
|
-
|
|
926
|
+
|
|
927
|
+
if (params.cloudflare_secret_key && !isString(params.cloudflare_secret_key)) {
|
|
928
|
+
throw new errors.InvalidParameterError(`Bad parameter: cloudflare_secret_key must be of type String, received ${getType(params.cloudflare_secret_key)}`)
|
|
861
929
|
}
|
|
862
|
-
|
|
863
|
-
|
|
930
|
+
|
|
931
|
+
if (params.cloudflare_bucket && !isString(params.cloudflare_bucket)) {
|
|
932
|
+
throw new errors.InvalidParameterError(`Bad parameter: cloudflare_bucket must be of type String, received ${getType(params.cloudflare_bucket)}`)
|
|
864
933
|
}
|
|
865
|
-
|
|
866
|
-
|
|
934
|
+
|
|
935
|
+
if (params.cloudflare_endpoint && !isString(params.cloudflare_endpoint)) {
|
|
936
|
+
throw new errors.InvalidParameterError(`Bad parameter: cloudflare_endpoint must be of type String, received ${getType(params.cloudflare_endpoint)}`)
|
|
867
937
|
}
|
|
868
|
-
|
|
869
|
-
|
|
938
|
+
|
|
939
|
+
if (params.linode_access_key && !isString(params.linode_access_key)) {
|
|
940
|
+
throw new errors.InvalidParameterError(`Bad parameter: linode_access_key must be of type String, received ${getType(params.linode_access_key)}`)
|
|
870
941
|
}
|
|
871
|
-
|
|
872
|
-
|
|
942
|
+
|
|
943
|
+
if (params.linode_secret_key && !isString(params.linode_secret_key)) {
|
|
944
|
+
throw new errors.InvalidParameterError(`Bad parameter: linode_secret_key must be of type String, received ${getType(params.linode_secret_key)}`)
|
|
873
945
|
}
|
|
874
|
-
|
|
875
|
-
|
|
946
|
+
|
|
947
|
+
if (params.linode_bucket && !isString(params.linode_bucket)) {
|
|
948
|
+
throw new errors.InvalidParameterError(`Bad parameter: linode_bucket must be of type String, received ${getType(params.linode_bucket)}`)
|
|
876
949
|
}
|
|
877
|
-
|
|
878
|
-
|
|
950
|
+
|
|
951
|
+
if (params.linode_region && !isString(params.linode_region)) {
|
|
952
|
+
throw new errors.InvalidParameterError(`Bad parameter: linode_region must be of type String, received ${getType(params.linode_region)}`)
|
|
879
953
|
}
|
|
880
954
|
|
|
881
|
-
if (!params
|
|
955
|
+
if (!params.id) {
|
|
882
956
|
if (this.attributes.id) {
|
|
883
|
-
params
|
|
957
|
+
params.id = this.id
|
|
884
958
|
} else {
|
|
885
959
|
throw new errors.MissingParameterError('Parameter missing: id')
|
|
886
960
|
}
|
|
887
961
|
}
|
|
888
962
|
|
|
889
|
-
const response = await Api.sendRequest(`/remote_servers/${encodeURIComponent(params
|
|
963
|
+
const response = await Api.sendRequest(`/remote_servers/${encodeURIComponent(params.id)}`, 'PATCH', params, this.options)
|
|
890
964
|
|
|
891
|
-
|
|
892
965
|
return new RemoteServer(response?.data, this.options)
|
|
893
966
|
}
|
|
894
967
|
|
|
@@ -902,53 +975,50 @@ class RemoteServer {
|
|
|
902
975
|
}
|
|
903
976
|
|
|
904
977
|
params.id = this.attributes.id
|
|
905
|
-
if (params
|
|
906
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params
|
|
978
|
+
if (params.id && !isInt(params.id)) {
|
|
979
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params.id)}`)
|
|
907
980
|
}
|
|
908
981
|
|
|
909
|
-
if (!params
|
|
982
|
+
if (!params.id) {
|
|
910
983
|
if (this.attributes.id) {
|
|
911
|
-
params
|
|
984
|
+
params.id = this.id
|
|
912
985
|
} else {
|
|
913
986
|
throw new errors.MissingParameterError('Parameter missing: id')
|
|
914
987
|
}
|
|
915
988
|
}
|
|
916
989
|
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
return
|
|
990
|
+
await Api.sendRequest(`/remote_servers/${encodeURIComponent(params.id)}`, 'DELETE', params, this.options)
|
|
920
991
|
}
|
|
921
992
|
|
|
922
993
|
destroy = (params = {}) =>
|
|
923
994
|
this.delete(params)
|
|
924
995
|
|
|
925
996
|
save = async () => {
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
997
|
+
if (this.attributes.id) {
|
|
998
|
+
const newObject = await this.update(this.attributes)
|
|
999
|
+
this.attributes = { ...newObject.attributes }
|
|
1000
|
+
return true
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
const newObject = await RemoteServer.create(this.attributes, this.options)
|
|
1004
|
+
this.attributes = { ...newObject.attributes }
|
|
1005
|
+
return true
|
|
935
1006
|
}
|
|
936
1007
|
|
|
937
1008
|
// Parameters:
|
|
938
1009
|
// cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
|
|
939
1010
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
940
1011
|
static list = async (params = {}, options = {}) => {
|
|
941
|
-
if (params
|
|
942
|
-
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params
|
|
1012
|
+
if (params.cursor && !isString(params.cursor)) {
|
|
1013
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`)
|
|
943
1014
|
}
|
|
944
1015
|
|
|
945
|
-
if (params
|
|
946
|
-
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params
|
|
1016
|
+
if (params.per_page && !isInt(params.per_page)) {
|
|
1017
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`)
|
|
947
1018
|
}
|
|
948
1019
|
|
|
949
|
-
const response = await Api.sendRequest(
|
|
1020
|
+
const response = await Api.sendRequest('/remote_servers', 'GET', params, options)
|
|
950
1021
|
|
|
951
|
-
|
|
952
1022
|
return response?.data?.map(obj => new RemoteServer(obj, options)) || []
|
|
953
1023
|
}
|
|
954
1024
|
|
|
@@ -962,19 +1032,18 @@ class RemoteServer {
|
|
|
962
1032
|
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
|
963
1033
|
}
|
|
964
1034
|
|
|
965
|
-
params
|
|
1035
|
+
params.id = id
|
|
966
1036
|
|
|
967
|
-
if (!params
|
|
1037
|
+
if (!params.id) {
|
|
968
1038
|
throw new errors.MissingParameterError('Parameter missing: id')
|
|
969
1039
|
}
|
|
970
1040
|
|
|
971
|
-
if (params
|
|
972
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params
|
|
1041
|
+
if (params.id && !isInt(params.id)) {
|
|
1042
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params.id)}`)
|
|
973
1043
|
}
|
|
974
1044
|
|
|
975
|
-
const response = await Api.sendRequest(`/remote_servers/${encodeURIComponent(params
|
|
1045
|
+
const response = await Api.sendRequest(`/remote_servers/${encodeURIComponent(params.id)}`, 'GET', params, options)
|
|
976
1046
|
|
|
977
|
-
|
|
978
1047
|
return new RemoteServer(response?.data, options)
|
|
979
1048
|
}
|
|
980
1049
|
|
|
@@ -988,19 +1057,19 @@ class RemoteServer {
|
|
|
988
1057
|
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
|
989
1058
|
}
|
|
990
1059
|
|
|
991
|
-
params
|
|
1060
|
+
params.id = id
|
|
992
1061
|
|
|
993
|
-
if (!params
|
|
1062
|
+
if (!params.id) {
|
|
994
1063
|
throw new errors.MissingParameterError('Parameter missing: id')
|
|
995
1064
|
}
|
|
996
1065
|
|
|
997
|
-
if (params
|
|
998
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params
|
|
1066
|
+
if (params.id && !isInt(params.id)) {
|
|
1067
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params.id)}`)
|
|
999
1068
|
}
|
|
1000
1069
|
|
|
1001
|
-
const response = await Api.sendRequest(`/remote_servers/${encodeURIComponent(params
|
|
1070
|
+
const response = await Api.sendRequest(`/remote_servers/${encodeURIComponent(params.id)}/configuration_file`, 'GET', params, options)
|
|
1002
1071
|
|
|
1003
|
-
const RemoteServerConfigurationFile = require(
|
|
1072
|
+
const RemoteServerConfigurationFile = require('./RemoteServerConfigurationFile.js').default
|
|
1004
1073
|
return new RemoteServerConfigurationFile(response?.data, options)
|
|
1005
1074
|
}
|
|
1006
1075
|
|
|
@@ -1071,249 +1140,248 @@ class RemoteServer {
|
|
|
1071
1140
|
// linode_bucket - string - Linode Bucket name
|
|
1072
1141
|
// linode_region - string - Linode region
|
|
1073
1142
|
static create = async (params = {}, options = {}) => {
|
|
1074
|
-
if (params
|
|
1075
|
-
throw new errors.InvalidParameterError(`Bad parameter: aws_access_key must be of type String, received ${getType(params
|
|
1143
|
+
if (params.aws_access_key && !isString(params.aws_access_key)) {
|
|
1144
|
+
throw new errors.InvalidParameterError(`Bad parameter: aws_access_key must be of type String, received ${getType(params.aws_access_key)}`)
|
|
1076
1145
|
}
|
|
1077
1146
|
|
|
1078
|
-
if (params
|
|
1079
|
-
throw new errors.InvalidParameterError(`Bad parameter: aws_secret_key must be of type String, received ${getType(params
|
|
1147
|
+
if (params.aws_secret_key && !isString(params.aws_secret_key)) {
|
|
1148
|
+
throw new errors.InvalidParameterError(`Bad parameter: aws_secret_key must be of type String, received ${getType(params.aws_secret_key)}`)
|
|
1080
1149
|
}
|
|
1081
1150
|
|
|
1082
|
-
if (params
|
|
1083
|
-
throw new errors.InvalidParameterError(`Bad parameter: password must be of type String, received ${getType(params
|
|
1151
|
+
if (params.password && !isString(params.password)) {
|
|
1152
|
+
throw new errors.InvalidParameterError(`Bad parameter: password must be of type String, received ${getType(params.password)}`)
|
|
1084
1153
|
}
|
|
1085
1154
|
|
|
1086
|
-
if (params
|
|
1087
|
-
throw new errors.InvalidParameterError(`Bad parameter: private_key must be of type String, received ${getType(params
|
|
1155
|
+
if (params.private_key && !isString(params.private_key)) {
|
|
1156
|
+
throw new errors.InvalidParameterError(`Bad parameter: private_key must be of type String, received ${getType(params.private_key)}`)
|
|
1088
1157
|
}
|
|
1089
1158
|
|
|
1090
|
-
if (params
|
|
1091
|
-
throw new errors.InvalidParameterError(`Bad parameter: private_key_passphrase must be of type String, received ${getType(params
|
|
1159
|
+
if (params.private_key_passphrase && !isString(params.private_key_passphrase)) {
|
|
1160
|
+
throw new errors.InvalidParameterError(`Bad parameter: private_key_passphrase must be of type String, received ${getType(params.private_key_passphrase)}`)
|
|
1092
1161
|
}
|
|
1093
1162
|
|
|
1094
|
-
if (params
|
|
1095
|
-
throw new errors.InvalidParameterError(`Bad parameter: ssl_certificate must be of type String, received ${getType(params
|
|
1163
|
+
if (params.ssl_certificate && !isString(params.ssl_certificate)) {
|
|
1164
|
+
throw new errors.InvalidParameterError(`Bad parameter: ssl_certificate must be of type String, received ${getType(params.ssl_certificate)}`)
|
|
1096
1165
|
}
|
|
1097
1166
|
|
|
1098
|
-
if (params
|
|
1099
|
-
throw new errors.InvalidParameterError(`Bad parameter: google_cloud_storage_credentials_json must be of type String, received ${getType(params
|
|
1167
|
+
if (params.google_cloud_storage_credentials_json && !isString(params.google_cloud_storage_credentials_json)) {
|
|
1168
|
+
throw new errors.InvalidParameterError(`Bad parameter: google_cloud_storage_credentials_json must be of type String, received ${getType(params.google_cloud_storage_credentials_json)}`)
|
|
1100
1169
|
}
|
|
1101
1170
|
|
|
1102
|
-
if (params
|
|
1103
|
-
throw new errors.InvalidParameterError(`Bad parameter: wasabi_access_key must be of type String, received ${getType(params
|
|
1171
|
+
if (params.wasabi_access_key && !isString(params.wasabi_access_key)) {
|
|
1172
|
+
throw new errors.InvalidParameterError(`Bad parameter: wasabi_access_key must be of type String, received ${getType(params.wasabi_access_key)}`)
|
|
1104
1173
|
}
|
|
1105
1174
|
|
|
1106
|
-
if (params
|
|
1107
|
-
throw new errors.InvalidParameterError(`Bad parameter: wasabi_secret_key must be of type String, received ${getType(params
|
|
1175
|
+
if (params.wasabi_secret_key && !isString(params.wasabi_secret_key)) {
|
|
1176
|
+
throw new errors.InvalidParameterError(`Bad parameter: wasabi_secret_key must be of type String, received ${getType(params.wasabi_secret_key)}`)
|
|
1108
1177
|
}
|
|
1109
1178
|
|
|
1110
|
-
if (params
|
|
1111
|
-
throw new errors.InvalidParameterError(`Bad parameter: backblaze_b2_key_id must be of type String, received ${getType(params
|
|
1179
|
+
if (params.backblaze_b2_key_id && !isString(params.backblaze_b2_key_id)) {
|
|
1180
|
+
throw new errors.InvalidParameterError(`Bad parameter: backblaze_b2_key_id must be of type String, received ${getType(params.backblaze_b2_key_id)}`)
|
|
1112
1181
|
}
|
|
1113
1182
|
|
|
1114
|
-
if (params
|
|
1115
|
-
throw new errors.InvalidParameterError(`Bad parameter: backblaze_b2_application_key must be of type String, received ${getType(params
|
|
1183
|
+
if (params.backblaze_b2_application_key && !isString(params.backblaze_b2_application_key)) {
|
|
1184
|
+
throw new errors.InvalidParameterError(`Bad parameter: backblaze_b2_application_key must be of type String, received ${getType(params.backblaze_b2_application_key)}`)
|
|
1116
1185
|
}
|
|
1117
1186
|
|
|
1118
|
-
if (params
|
|
1119
|
-
throw new errors.InvalidParameterError(`Bad parameter: rackspace_api_key must be of type String, received ${getType(params
|
|
1187
|
+
if (params.rackspace_api_key && !isString(params.rackspace_api_key)) {
|
|
1188
|
+
throw new errors.InvalidParameterError(`Bad parameter: rackspace_api_key must be of type String, received ${getType(params.rackspace_api_key)}`)
|
|
1120
1189
|
}
|
|
1121
1190
|
|
|
1122
|
-
if (params
|
|
1123
|
-
throw new errors.InvalidParameterError(`Bad parameter: azure_blob_storage_access_key must be of type String, received ${getType(params
|
|
1191
|
+
if (params.azure_blob_storage_access_key && !isString(params.azure_blob_storage_access_key)) {
|
|
1192
|
+
throw new errors.InvalidParameterError(`Bad parameter: azure_blob_storage_access_key must be of type String, received ${getType(params.azure_blob_storage_access_key)}`)
|
|
1124
1193
|
}
|
|
1125
1194
|
|
|
1126
|
-
if (params
|
|
1127
|
-
throw new errors.InvalidParameterError(`Bad parameter: azure_files_storage_access_key must be of type String, received ${getType(params
|
|
1195
|
+
if (params.azure_files_storage_access_key && !isString(params.azure_files_storage_access_key)) {
|
|
1196
|
+
throw new errors.InvalidParameterError(`Bad parameter: azure_files_storage_access_key must be of type String, received ${getType(params.azure_files_storage_access_key)}`)
|
|
1128
1197
|
}
|
|
1129
1198
|
|
|
1130
|
-
if (params
|
|
1131
|
-
throw new errors.InvalidParameterError(`Bad parameter: hostname must be of type String, received ${getType(params
|
|
1199
|
+
if (params.hostname && !isString(params.hostname)) {
|
|
1200
|
+
throw new errors.InvalidParameterError(`Bad parameter: hostname must be of type String, received ${getType(params.hostname)}`)
|
|
1132
1201
|
}
|
|
1133
1202
|
|
|
1134
|
-
if (params
|
|
1135
|
-
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params
|
|
1203
|
+
if (params.name && !isString(params.name)) {
|
|
1204
|
+
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params.name)}`)
|
|
1136
1205
|
}
|
|
1137
1206
|
|
|
1138
|
-
if (params
|
|
1139
|
-
throw new errors.InvalidParameterError(`Bad parameter: max_connections must be of type Int, received ${getType(params
|
|
1207
|
+
if (params.max_connections && !isInt(params.max_connections)) {
|
|
1208
|
+
throw new errors.InvalidParameterError(`Bad parameter: max_connections must be of type Int, received ${getType(params.max_connections)}`)
|
|
1140
1209
|
}
|
|
1141
1210
|
|
|
1142
|
-
if (params
|
|
1143
|
-
throw new errors.InvalidParameterError(`Bad parameter: port must be of type Int, received ${getType(params
|
|
1211
|
+
if (params.port && !isInt(params.port)) {
|
|
1212
|
+
throw new errors.InvalidParameterError(`Bad parameter: port must be of type Int, received ${getType(params.port)}`)
|
|
1144
1213
|
}
|
|
1145
1214
|
|
|
1146
|
-
if (params
|
|
1147
|
-
throw new errors.InvalidParameterError(`Bad parameter: s3_bucket must be of type String, received ${getType(params
|
|
1215
|
+
if (params.s3_bucket && !isString(params.s3_bucket)) {
|
|
1216
|
+
throw new errors.InvalidParameterError(`Bad parameter: s3_bucket must be of type String, received ${getType(params.s3_bucket)}`)
|
|
1148
1217
|
}
|
|
1149
1218
|
|
|
1150
|
-
if (params
|
|
1151
|
-
throw new errors.InvalidParameterError(`Bad parameter: s3_region must be of type String, received ${getType(params
|
|
1219
|
+
if (params.s3_region && !isString(params.s3_region)) {
|
|
1220
|
+
throw new errors.InvalidParameterError(`Bad parameter: s3_region must be of type String, received ${getType(params.s3_region)}`)
|
|
1152
1221
|
}
|
|
1153
1222
|
|
|
1154
|
-
if (params
|
|
1155
|
-
throw new errors.InvalidParameterError(`Bad parameter: server_certificate must be of type String, received ${getType(params
|
|
1223
|
+
if (params.server_certificate && !isString(params.server_certificate)) {
|
|
1224
|
+
throw new errors.InvalidParameterError(`Bad parameter: server_certificate must be of type String, received ${getType(params.server_certificate)}`)
|
|
1156
1225
|
}
|
|
1157
1226
|
|
|
1158
|
-
if (params
|
|
1159
|
-
throw new errors.InvalidParameterError(`Bad parameter: server_host_key must be of type String, received ${getType(params
|
|
1227
|
+
if (params.server_host_key && !isString(params.server_host_key)) {
|
|
1228
|
+
throw new errors.InvalidParameterError(`Bad parameter: server_host_key must be of type String, received ${getType(params.server_host_key)}`)
|
|
1160
1229
|
}
|
|
1161
1230
|
|
|
1162
|
-
if (params
|
|
1163
|
-
throw new errors.InvalidParameterError(`Bad parameter: server_type must be of type String, received ${getType(params
|
|
1231
|
+
if (params.server_type && !isString(params.server_type)) {
|
|
1232
|
+
throw new errors.InvalidParameterError(`Bad parameter: server_type must be of type String, received ${getType(params.server_type)}`)
|
|
1164
1233
|
}
|
|
1165
1234
|
|
|
1166
|
-
if (params
|
|
1167
|
-
throw new errors.InvalidParameterError(`Bad parameter: ssl must be of type String, received ${getType(params
|
|
1235
|
+
if (params.ssl && !isString(params.ssl)) {
|
|
1236
|
+
throw new errors.InvalidParameterError(`Bad parameter: ssl must be of type String, received ${getType(params.ssl)}`)
|
|
1168
1237
|
}
|
|
1169
1238
|
|
|
1170
|
-
if (params
|
|
1171
|
-
throw new errors.InvalidParameterError(`Bad parameter: username must be of type String, received ${getType(params
|
|
1239
|
+
if (params.username && !isString(params.username)) {
|
|
1240
|
+
throw new errors.InvalidParameterError(`Bad parameter: username must be of type String, received ${getType(params.username)}`)
|
|
1172
1241
|
}
|
|
1173
1242
|
|
|
1174
|
-
if (params
|
|
1175
|
-
throw new errors.InvalidParameterError(`Bad parameter: google_cloud_storage_bucket must be of type String, received ${getType(params
|
|
1243
|
+
if (params.google_cloud_storage_bucket && !isString(params.google_cloud_storage_bucket)) {
|
|
1244
|
+
throw new errors.InvalidParameterError(`Bad parameter: google_cloud_storage_bucket must be of type String, received ${getType(params.google_cloud_storage_bucket)}`)
|
|
1176
1245
|
}
|
|
1177
1246
|
|
|
1178
|
-
if (params
|
|
1179
|
-
throw new errors.InvalidParameterError(`Bad parameter: google_cloud_storage_project_id must be of type String, received ${getType(params
|
|
1247
|
+
if (params.google_cloud_storage_project_id && !isString(params.google_cloud_storage_project_id)) {
|
|
1248
|
+
throw new errors.InvalidParameterError(`Bad parameter: google_cloud_storage_project_id must be of type String, received ${getType(params.google_cloud_storage_project_id)}`)
|
|
1180
1249
|
}
|
|
1181
1250
|
|
|
1182
|
-
if (params
|
|
1183
|
-
throw new errors.InvalidParameterError(`Bad parameter: backblaze_b2_bucket must be of type String, received ${getType(params
|
|
1251
|
+
if (params.backblaze_b2_bucket && !isString(params.backblaze_b2_bucket)) {
|
|
1252
|
+
throw new errors.InvalidParameterError(`Bad parameter: backblaze_b2_bucket must be of type String, received ${getType(params.backblaze_b2_bucket)}`)
|
|
1184
1253
|
}
|
|
1185
1254
|
|
|
1186
|
-
if (params
|
|
1187
|
-
throw new errors.InvalidParameterError(`Bad parameter: backblaze_b2_s3_endpoint must be of type String, received ${getType(params
|
|
1255
|
+
if (params.backblaze_b2_s3_endpoint && !isString(params.backblaze_b2_s3_endpoint)) {
|
|
1256
|
+
throw new errors.InvalidParameterError(`Bad parameter: backblaze_b2_s3_endpoint must be of type String, received ${getType(params.backblaze_b2_s3_endpoint)}`)
|
|
1188
1257
|
}
|
|
1189
1258
|
|
|
1190
|
-
if (params
|
|
1191
|
-
throw new errors.InvalidParameterError(`Bad parameter: wasabi_bucket must be of type String, received ${getType(params
|
|
1259
|
+
if (params.wasabi_bucket && !isString(params.wasabi_bucket)) {
|
|
1260
|
+
throw new errors.InvalidParameterError(`Bad parameter: wasabi_bucket must be of type String, received ${getType(params.wasabi_bucket)}`)
|
|
1192
1261
|
}
|
|
1193
1262
|
|
|
1194
|
-
if (params
|
|
1195
|
-
throw new errors.InvalidParameterError(`Bad parameter: wasabi_region must be of type String, received ${getType(params
|
|
1263
|
+
if (params.wasabi_region && !isString(params.wasabi_region)) {
|
|
1264
|
+
throw new errors.InvalidParameterError(`Bad parameter: wasabi_region must be of type String, received ${getType(params.wasabi_region)}`)
|
|
1196
1265
|
}
|
|
1197
1266
|
|
|
1198
|
-
if (params
|
|
1199
|
-
throw new errors.InvalidParameterError(`Bad parameter: rackspace_username must be of type String, received ${getType(params
|
|
1267
|
+
if (params.rackspace_username && !isString(params.rackspace_username)) {
|
|
1268
|
+
throw new errors.InvalidParameterError(`Bad parameter: rackspace_username must be of type String, received ${getType(params.rackspace_username)}`)
|
|
1200
1269
|
}
|
|
1201
1270
|
|
|
1202
|
-
if (params
|
|
1203
|
-
throw new errors.InvalidParameterError(`Bad parameter: rackspace_region must be of type String, received ${getType(params
|
|
1271
|
+
if (params.rackspace_region && !isString(params.rackspace_region)) {
|
|
1272
|
+
throw new errors.InvalidParameterError(`Bad parameter: rackspace_region must be of type String, received ${getType(params.rackspace_region)}`)
|
|
1204
1273
|
}
|
|
1205
1274
|
|
|
1206
|
-
if (params
|
|
1207
|
-
throw new errors.InvalidParameterError(`Bad parameter: rackspace_container must be of type String, received ${getType(params
|
|
1275
|
+
if (params.rackspace_container && !isString(params.rackspace_container)) {
|
|
1276
|
+
throw new errors.InvalidParameterError(`Bad parameter: rackspace_container must be of type String, received ${getType(params.rackspace_container)}`)
|
|
1208
1277
|
}
|
|
1209
1278
|
|
|
1210
|
-
if (params
|
|
1211
|
-
throw new errors.InvalidParameterError(`Bad parameter: one_drive_account_type must be of type String, received ${getType(params
|
|
1279
|
+
if (params.one_drive_account_type && !isString(params.one_drive_account_type)) {
|
|
1280
|
+
throw new errors.InvalidParameterError(`Bad parameter: one_drive_account_type must be of type String, received ${getType(params.one_drive_account_type)}`)
|
|
1212
1281
|
}
|
|
1213
1282
|
|
|
1214
|
-
if (params
|
|
1215
|
-
throw new errors.InvalidParameterError(`Bad parameter: azure_blob_storage_account must be of type String, received ${getType(params
|
|
1283
|
+
if (params.azure_blob_storage_account && !isString(params.azure_blob_storage_account)) {
|
|
1284
|
+
throw new errors.InvalidParameterError(`Bad parameter: azure_blob_storage_account must be of type String, received ${getType(params.azure_blob_storage_account)}`)
|
|
1216
1285
|
}
|
|
1217
1286
|
|
|
1218
|
-
if (params
|
|
1219
|
-
throw new errors.InvalidParameterError(`Bad parameter: azure_blob_storage_container must be of type String, received ${getType(params
|
|
1287
|
+
if (params.azure_blob_storage_container && !isString(params.azure_blob_storage_container)) {
|
|
1288
|
+
throw new errors.InvalidParameterError(`Bad parameter: azure_blob_storage_container must be of type String, received ${getType(params.azure_blob_storage_container)}`)
|
|
1220
1289
|
}
|
|
1221
1290
|
|
|
1222
|
-
if (params
|
|
1223
|
-
throw new errors.InvalidParameterError(`Bad parameter: azure_blob_storage_sas_token must be of type String, received ${getType(params
|
|
1291
|
+
if (params.azure_blob_storage_sas_token && !isString(params.azure_blob_storage_sas_token)) {
|
|
1292
|
+
throw new errors.InvalidParameterError(`Bad parameter: azure_blob_storage_sas_token must be of type String, received ${getType(params.azure_blob_storage_sas_token)}`)
|
|
1224
1293
|
}
|
|
1225
1294
|
|
|
1226
|
-
if (params
|
|
1227
|
-
throw new errors.InvalidParameterError(`Bad parameter: azure_files_storage_account must be of type String, received ${getType(params
|
|
1295
|
+
if (params.azure_files_storage_account && !isString(params.azure_files_storage_account)) {
|
|
1296
|
+
throw new errors.InvalidParameterError(`Bad parameter: azure_files_storage_account must be of type String, received ${getType(params.azure_files_storage_account)}`)
|
|
1228
1297
|
}
|
|
1229
1298
|
|
|
1230
|
-
if (params
|
|
1231
|
-
throw new errors.InvalidParameterError(`Bad parameter: azure_files_storage_share_name must be of type String, received ${getType(params
|
|
1299
|
+
if (params.azure_files_storage_share_name && !isString(params.azure_files_storage_share_name)) {
|
|
1300
|
+
throw new errors.InvalidParameterError(`Bad parameter: azure_files_storage_share_name must be of type String, received ${getType(params.azure_files_storage_share_name)}`)
|
|
1232
1301
|
}
|
|
1233
1302
|
|
|
1234
|
-
if (params
|
|
1235
|
-
throw new errors.InvalidParameterError(`Bad parameter: azure_files_storage_sas_token must be of type String, received ${getType(params
|
|
1303
|
+
if (params.azure_files_storage_sas_token && !isString(params.azure_files_storage_sas_token)) {
|
|
1304
|
+
throw new errors.InvalidParameterError(`Bad parameter: azure_files_storage_sas_token must be of type String, received ${getType(params.azure_files_storage_sas_token)}`)
|
|
1236
1305
|
}
|
|
1237
1306
|
|
|
1238
|
-
if (params
|
|
1239
|
-
throw new errors.InvalidParameterError(`Bad parameter: s3_compatible_bucket must be of type String, received ${getType(params
|
|
1307
|
+
if (params.s3_compatible_bucket && !isString(params.s3_compatible_bucket)) {
|
|
1308
|
+
throw new errors.InvalidParameterError(`Bad parameter: s3_compatible_bucket must be of type String, received ${getType(params.s3_compatible_bucket)}`)
|
|
1240
1309
|
}
|
|
1241
1310
|
|
|
1242
|
-
if (params
|
|
1243
|
-
throw new errors.InvalidParameterError(`Bad parameter: s3_compatible_endpoint must be of type String, received ${getType(params
|
|
1311
|
+
if (params.s3_compatible_endpoint && !isString(params.s3_compatible_endpoint)) {
|
|
1312
|
+
throw new errors.InvalidParameterError(`Bad parameter: s3_compatible_endpoint must be of type String, received ${getType(params.s3_compatible_endpoint)}`)
|
|
1244
1313
|
}
|
|
1245
1314
|
|
|
1246
|
-
if (params
|
|
1247
|
-
throw new errors.InvalidParameterError(`Bad parameter: s3_compatible_region must be of type String, received ${getType(params
|
|
1315
|
+
if (params.s3_compatible_region && !isString(params.s3_compatible_region)) {
|
|
1316
|
+
throw new errors.InvalidParameterError(`Bad parameter: s3_compatible_region must be of type String, received ${getType(params.s3_compatible_region)}`)
|
|
1248
1317
|
}
|
|
1249
1318
|
|
|
1250
|
-
if (params
|
|
1251
|
-
throw new errors.InvalidParameterError(`Bad parameter: s3_compatible_access_key must be of type String, received ${getType(params
|
|
1319
|
+
if (params.s3_compatible_access_key && !isString(params.s3_compatible_access_key)) {
|
|
1320
|
+
throw new errors.InvalidParameterError(`Bad parameter: s3_compatible_access_key must be of type String, received ${getType(params.s3_compatible_access_key)}`)
|
|
1252
1321
|
}
|
|
1253
1322
|
|
|
1254
|
-
if (params
|
|
1255
|
-
throw new errors.InvalidParameterError(`Bad parameter: s3_compatible_secret_key must be of type String, received ${getType(params
|
|
1323
|
+
if (params.s3_compatible_secret_key && !isString(params.s3_compatible_secret_key)) {
|
|
1324
|
+
throw new errors.InvalidParameterError(`Bad parameter: s3_compatible_secret_key must be of type String, received ${getType(params.s3_compatible_secret_key)}`)
|
|
1256
1325
|
}
|
|
1257
1326
|
|
|
1258
|
-
if (params
|
|
1259
|
-
throw new errors.InvalidParameterError(`Bad parameter: files_agent_root must be of type String, received ${getType(params
|
|
1327
|
+
if (params.files_agent_root && !isString(params.files_agent_root)) {
|
|
1328
|
+
throw new errors.InvalidParameterError(`Bad parameter: files_agent_root must be of type String, received ${getType(params.files_agent_root)}`)
|
|
1260
1329
|
}
|
|
1261
1330
|
|
|
1262
|
-
if (params
|
|
1263
|
-
throw new errors.InvalidParameterError(`Bad parameter: files_agent_permission_set must be of type String, received ${getType(params
|
|
1331
|
+
if (params.files_agent_permission_set && !isString(params.files_agent_permission_set)) {
|
|
1332
|
+
throw new errors.InvalidParameterError(`Bad parameter: files_agent_permission_set must be of type String, received ${getType(params.files_agent_permission_set)}`)
|
|
1264
1333
|
}
|
|
1265
1334
|
|
|
1266
|
-
if (params
|
|
1267
|
-
throw new errors.InvalidParameterError(`Bad parameter: files_agent_version must be of type String, received ${getType(params
|
|
1335
|
+
if (params.files_agent_version && !isString(params.files_agent_version)) {
|
|
1336
|
+
throw new errors.InvalidParameterError(`Bad parameter: files_agent_version must be of type String, received ${getType(params.files_agent_version)}`)
|
|
1268
1337
|
}
|
|
1269
1338
|
|
|
1270
|
-
if (params
|
|
1271
|
-
throw new errors.InvalidParameterError(`Bad parameter: filebase_access_key must be of type String, received ${getType(params
|
|
1339
|
+
if (params.filebase_access_key && !isString(params.filebase_access_key)) {
|
|
1340
|
+
throw new errors.InvalidParameterError(`Bad parameter: filebase_access_key must be of type String, received ${getType(params.filebase_access_key)}`)
|
|
1272
1341
|
}
|
|
1273
1342
|
|
|
1274
|
-
if (params
|
|
1275
|
-
throw new errors.InvalidParameterError(`Bad parameter: filebase_secret_key must be of type String, received ${getType(params
|
|
1343
|
+
if (params.filebase_secret_key && !isString(params.filebase_secret_key)) {
|
|
1344
|
+
throw new errors.InvalidParameterError(`Bad parameter: filebase_secret_key must be of type String, received ${getType(params.filebase_secret_key)}`)
|
|
1276
1345
|
}
|
|
1277
1346
|
|
|
1278
|
-
if (params
|
|
1279
|
-
throw new errors.InvalidParameterError(`Bad parameter: filebase_bucket must be of type String, received ${getType(params
|
|
1347
|
+
if (params.filebase_bucket && !isString(params.filebase_bucket)) {
|
|
1348
|
+
throw new errors.InvalidParameterError(`Bad parameter: filebase_bucket must be of type String, received ${getType(params.filebase_bucket)}`)
|
|
1280
1349
|
}
|
|
1281
1350
|
|
|
1282
|
-
if (params
|
|
1283
|
-
throw new errors.InvalidParameterError(`Bad parameter: cloudflare_access_key must be of type String, received ${getType(params
|
|
1351
|
+
if (params.cloudflare_access_key && !isString(params.cloudflare_access_key)) {
|
|
1352
|
+
throw new errors.InvalidParameterError(`Bad parameter: cloudflare_access_key must be of type String, received ${getType(params.cloudflare_access_key)}`)
|
|
1284
1353
|
}
|
|
1285
1354
|
|
|
1286
|
-
if (params
|
|
1287
|
-
throw new errors.InvalidParameterError(`Bad parameter: cloudflare_secret_key must be of type String, received ${getType(params
|
|
1355
|
+
if (params.cloudflare_secret_key && !isString(params.cloudflare_secret_key)) {
|
|
1356
|
+
throw new errors.InvalidParameterError(`Bad parameter: cloudflare_secret_key must be of type String, received ${getType(params.cloudflare_secret_key)}`)
|
|
1288
1357
|
}
|
|
1289
1358
|
|
|
1290
|
-
if (params
|
|
1291
|
-
throw new errors.InvalidParameterError(`Bad parameter: cloudflare_bucket must be of type String, received ${getType(params
|
|
1359
|
+
if (params.cloudflare_bucket && !isString(params.cloudflare_bucket)) {
|
|
1360
|
+
throw new errors.InvalidParameterError(`Bad parameter: cloudflare_bucket must be of type String, received ${getType(params.cloudflare_bucket)}`)
|
|
1292
1361
|
}
|
|
1293
1362
|
|
|
1294
|
-
if (params
|
|
1295
|
-
throw new errors.InvalidParameterError(`Bad parameter: cloudflare_endpoint must be of type String, received ${getType(params
|
|
1363
|
+
if (params.cloudflare_endpoint && !isString(params.cloudflare_endpoint)) {
|
|
1364
|
+
throw new errors.InvalidParameterError(`Bad parameter: cloudflare_endpoint must be of type String, received ${getType(params.cloudflare_endpoint)}`)
|
|
1296
1365
|
}
|
|
1297
1366
|
|
|
1298
|
-
if (params
|
|
1299
|
-
throw new errors.InvalidParameterError(`Bad parameter: linode_access_key must be of type String, received ${getType(params
|
|
1367
|
+
if (params.linode_access_key && !isString(params.linode_access_key)) {
|
|
1368
|
+
throw new errors.InvalidParameterError(`Bad parameter: linode_access_key must be of type String, received ${getType(params.linode_access_key)}`)
|
|
1300
1369
|
}
|
|
1301
1370
|
|
|
1302
|
-
if (params
|
|
1303
|
-
throw new errors.InvalidParameterError(`Bad parameter: linode_secret_key must be of type String, received ${getType(params
|
|
1371
|
+
if (params.linode_secret_key && !isString(params.linode_secret_key)) {
|
|
1372
|
+
throw new errors.InvalidParameterError(`Bad parameter: linode_secret_key must be of type String, received ${getType(params.linode_secret_key)}`)
|
|
1304
1373
|
}
|
|
1305
1374
|
|
|
1306
|
-
if (params
|
|
1307
|
-
throw new errors.InvalidParameterError(`Bad parameter: linode_bucket must be of type String, received ${getType(params
|
|
1375
|
+
if (params.linode_bucket && !isString(params.linode_bucket)) {
|
|
1376
|
+
throw new errors.InvalidParameterError(`Bad parameter: linode_bucket must be of type String, received ${getType(params.linode_bucket)}`)
|
|
1308
1377
|
}
|
|
1309
1378
|
|
|
1310
|
-
if (params
|
|
1311
|
-
throw new errors.InvalidParameterError(`Bad parameter: linode_region must be of type String, received ${getType(params
|
|
1379
|
+
if (params.linode_region && !isString(params.linode_region)) {
|
|
1380
|
+
throw new errors.InvalidParameterError(`Bad parameter: linode_region must be of type String, received ${getType(params.linode_region)}`)
|
|
1312
1381
|
}
|
|
1313
1382
|
|
|
1314
|
-
const response = await Api.sendRequest(
|
|
1383
|
+
const response = await Api.sendRequest('/remote_servers', 'POST', params, options)
|
|
1315
1384
|
|
|
1316
|
-
|
|
1317
1385
|
return new RemoteServer(response?.data, options)
|
|
1318
1386
|
}
|
|
1319
1387
|
}
|