Class: Files::RemoteServerCredential

Inherits:
Object
  • Object
show all
Defined in:
lib/files.com/models/remote_server_credential.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}, options = {}) ⇒ RemoteServerCredential

Returns a new instance of RemoteServerCredential.



7
8
9
10
# File 'lib/files.com/models/remote_server_credential.rb', line 7

def initialize(attributes = {}, options = {})
  @attributes = attributes || {}
  @options = options || {}
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



5
6
7
# File 'lib/files.com/models/remote_server_credential.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/files.com/models/remote_server_credential.rb', line 5

def options
  @options
end

Class Method Details

.all(params = {}, options = {}) ⇒ Object



424
425
426
# File 'lib/files.com/models/remote_server_credential.rb', line 424

def self.all(params = {}, options = {})
  list(params, options)
end

.create(params = {}, options = {}) ⇒ Object

Parameters:

name - string - Internal name for your reference
description - string - Internal description for your reference
server_type - string - Remote server type.  Remote Server Credentials are only valid for a single type of Remote Server.
aws_access_key - string - AWS Access Key.
s3_assume_role_arn - string - AWS IAM Role ARN for AssumeRole authentication.
s3_assume_role_duration_seconds - int64 - Session duration in seconds for AssumeRole authentication (900-43200).
cloudflare_access_key - string - Cloudflare: Access Key.
filebase_access_key - string - Filebase: Access Key.
google_cloud_storage_s3_compatible_access_key - string - Google Cloud Storage: S3-compatible Access Key.
linode_access_key - string - Linode: Access Key
s3_compatible_access_key - string - S3-compatible: Access Key
username - string - Remote server username.
wasabi_access_key - string - Wasabi: Access Key.
password - string - Password, if needed.
private_key - string - Private key, if needed.
private_key_passphrase - string - Passphrase for private key if needed.
aws_secret_key - string - AWS: secret key.
azure_blob_storage_access_key - string - Azure Blob Storage: Access Key
azure_blob_storage_sas_token - string - Azure Blob Storage: Shared Access Signature (SAS) token
azure_files_storage_access_key - string - Azure File Storage: Access Key
azure_files_storage_sas_token - string - Azure File Storage: Shared Access Signature (SAS) token
backblaze_b2_application_key - string - Backblaze B2 Cloud Storage: applicationKey
backblaze_b2_key_id - string - Backblaze B2 Cloud Storage: keyID
cloudflare_secret_key - string - Cloudflare: Secret Key
filebase_secret_key - string - Filebase: Secret Key
google_cloud_storage_credentials_json - string - Google Cloud Storage: JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
google_cloud_storage_s3_compatible_secret_key - string - Google Cloud Storage: S3-compatible secret key
linode_secret_key - string - Linode: Secret Key
s3_compatible_secret_key - string - S3-compatible: Secret Key
wasabi_secret_key - string - Wasabi: Secret Key
workspace_id - int64 - Workspace ID (0 for default workspace)


476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
# File 'lib/files.com/models/remote_server_credential.rb', line 476

def self.create(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: server_type must be an String") if params[:server_type] and !params[:server_type].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: aws_access_key must be an String") if params[:aws_access_key] and !params[:aws_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: s3_assume_role_arn must be an String") if params[:s3_assume_role_arn] and !params[:s3_assume_role_arn].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: s3_assume_role_duration_seconds must be an Integer") if params[:s3_assume_role_duration_seconds] and !params[:s3_assume_role_duration_seconds].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: cloudflare_access_key must be an String") if params[:cloudflare_access_key] and !params[:cloudflare_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: filebase_access_key must be an String") if params[:filebase_access_key] and !params[:filebase_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: google_cloud_storage_s3_compatible_access_key must be an String") if params[:google_cloud_storage_s3_compatible_access_key] and !params[:google_cloud_storage_s3_compatible_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: linode_access_key must be an String") if params[:linode_access_key] and !params[:linode_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: s3_compatible_access_key must be an String") if params[:s3_compatible_access_key] and !params[:s3_compatible_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: username must be an String") if params[:username] and !params[:username].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: wasabi_access_key must be an String") if params[:wasabi_access_key] and !params[:wasabi_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: password must be an String") if params[:password] and !params[:password].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: private_key must be an String") if params[:private_key] and !params[:private_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: private_key_passphrase must be an String") if params[:private_key_passphrase] and !params[:private_key_passphrase].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: aws_secret_key must be an String") if params[:aws_secret_key] and !params[:aws_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: azure_blob_storage_access_key must be an String") if params[:azure_blob_storage_access_key] and !params[:azure_blob_storage_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: azure_blob_storage_sas_token must be an String") if params[:azure_blob_storage_sas_token] and !params[:azure_blob_storage_sas_token].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: azure_files_storage_access_key must be an String") if params[:azure_files_storage_access_key] and !params[:azure_files_storage_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: azure_files_storage_sas_token must be an String") if params[:azure_files_storage_sas_token] and !params[:azure_files_storage_sas_token].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: backblaze_b2_application_key must be an String") if params[:backblaze_b2_application_key] and !params[:backblaze_b2_application_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: backblaze_b2_key_id must be an String") if params[:backblaze_b2_key_id] and !params[:backblaze_b2_key_id].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: cloudflare_secret_key must be an String") if params[:cloudflare_secret_key] and !params[:cloudflare_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: filebase_secret_key must be an String") if params[:filebase_secret_key] and !params[:filebase_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: google_cloud_storage_credentials_json must be an String") if params[:google_cloud_storage_credentials_json] and !params[:google_cloud_storage_credentials_json].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: google_cloud_storage_s3_compatible_secret_key must be an String") if params[:google_cloud_storage_s3_compatible_secret_key] and !params[:google_cloud_storage_s3_compatible_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: linode_secret_key must be an String") if params[:linode_secret_key] and !params[:linode_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: s3_compatible_secret_key must be an String") if params[:s3_compatible_secret_key] and !params[:s3_compatible_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: wasabi_secret_key must be an String") if params[:wasabi_secret_key] and !params[:wasabi_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)

  response, options = Api.send_request("/remote_server_credentials", :post, params, options)
  RemoteServerCredential.new(response.data, options)
end

.delete(id, params = {}, options = {}) ⇒ Object



584
585
586
587
588
589
590
591
592
# File 'lib/files.com/models/remote_server_credential.rb', line 584

def self.delete(id, params = {}, options = {})
  params ||= {}
  params[:id] = id
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]

  Api.send_request("/remote_server_credentials/#{params[:id]}", :delete, params, options)
  nil
end

.destroy(id, params = {}, options = {}) ⇒ Object



594
595
596
597
# File 'lib/files.com/models/remote_server_credential.rb', line 594

def self.destroy(id, params = {}, options = {})
  delete(id, params, options)
  nil
end

.find(id, params = {}, options = {}) ⇒ Object

Parameters:

id (required) - int64 - Remote Server Credential ID.


430
431
432
433
434
435
436
437
438
# File 'lib/files.com/models/remote_server_credential.rb', line 430

def self.find(id, params = {}, options = {})
  params ||= {}
  params[:id] = id
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]

  response, options = Api.send_request("/remote_server_credentials/#{params[:id]}", :get, params, options)
  RemoteServerCredential.new(response.data, options)
end

.get(id, params = {}, options = {}) ⇒ Object



440
441
442
# File 'lib/files.com/models/remote_server_credential.rb', line 440

def self.get(id, params = {}, options = {})
  find(id, params, options)
end

.list(params = {}, options = {}) ⇒ Object

Parameters:

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.
per_page - int64 - Number of records to show per page.  (Max: 10,000, 1,000 or less is recommended).
sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id` and `id`.
filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `workspace_id` and `name`. Valid field combinations are `[ workspace_id, name ]`.
filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `name`.


412
413
414
415
416
417
418
419
420
421
422
# File 'lib/files.com/models/remote_server_credential.rb', line 412

def self.list(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
  raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)
  raise InvalidParameterError.new("Bad parameter: filter_prefix must be an Hash") if params[:filter_prefix] and !params[:filter_prefix].is_a?(Hash)

  List.new(RemoteServerCredential, params) do
    Api.send_request("/remote_server_credentials", :get, params, options)
  end
end

.update(id, params = {}, options = {}) ⇒ Object

Parameters:

name - string - Internal name for your reference
description - string - Internal description for your reference
server_type - string - Remote server type.  Remote Server Credentials are only valid for a single type of Remote Server.
aws_access_key - string - AWS Access Key.
s3_assume_role_arn - string - AWS IAM Role ARN for AssumeRole authentication.
s3_assume_role_duration_seconds - int64 - Session duration in seconds for AssumeRole authentication (900-43200).
cloudflare_access_key - string - Cloudflare: Access Key.
filebase_access_key - string - Filebase: Access Key.
google_cloud_storage_s3_compatible_access_key - string - Google Cloud Storage: S3-compatible Access Key.
linode_access_key - string - Linode: Access Key
s3_compatible_access_key - string - S3-compatible: Access Key
username - string - Remote server username.
wasabi_access_key - string - Wasabi: Access Key.
password - string - Password, if needed.
private_key - string - Private key, if needed.
private_key_passphrase - string - Passphrase for private key if needed.
aws_secret_key - string - AWS: secret key.
azure_blob_storage_access_key - string - Azure Blob Storage: Access Key
azure_blob_storage_sas_token - string - Azure Blob Storage: Shared Access Signature (SAS) token
azure_files_storage_access_key - string - Azure File Storage: Access Key
azure_files_storage_sas_token - string - Azure File Storage: Shared Access Signature (SAS) token
backblaze_b2_application_key - string - Backblaze B2 Cloud Storage: applicationKey
backblaze_b2_key_id - string - Backblaze B2 Cloud Storage: keyID
cloudflare_secret_key - string - Cloudflare: Secret Key
filebase_secret_key - string - Filebase: Secret Key
google_cloud_storage_credentials_json - string - Google Cloud Storage: JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
google_cloud_storage_s3_compatible_secret_key - string - Google Cloud Storage: S3-compatible secret key
linode_secret_key - string - Linode: Secret Key
s3_compatible_secret_key - string - S3-compatible: Secret Key
wasabi_secret_key - string - Wasabi: Secret Key


544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
# File 'lib/files.com/models/remote_server_credential.rb', line 544

def self.update(id, params = {}, options = {})
  params ||= {}
  params[:id] = id
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: server_type must be an String") if params[:server_type] and !params[:server_type].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: aws_access_key must be an String") if params[:aws_access_key] and !params[:aws_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: s3_assume_role_arn must be an String") if params[:s3_assume_role_arn] and !params[:s3_assume_role_arn].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: s3_assume_role_duration_seconds must be an Integer") if params[:s3_assume_role_duration_seconds] and !params[:s3_assume_role_duration_seconds].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: cloudflare_access_key must be an String") if params[:cloudflare_access_key] and !params[:cloudflare_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: filebase_access_key must be an String") if params[:filebase_access_key] and !params[:filebase_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: google_cloud_storage_s3_compatible_access_key must be an String") if params[:google_cloud_storage_s3_compatible_access_key] and !params[:google_cloud_storage_s3_compatible_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: linode_access_key must be an String") if params[:linode_access_key] and !params[:linode_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: s3_compatible_access_key must be an String") if params[:s3_compatible_access_key] and !params[:s3_compatible_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: username must be an String") if params[:username] and !params[:username].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: wasabi_access_key must be an String") if params[:wasabi_access_key] and !params[:wasabi_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: password must be an String") if params[:password] and !params[:password].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: private_key must be an String") if params[:private_key] and !params[:private_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: private_key_passphrase must be an String") if params[:private_key_passphrase] and !params[:private_key_passphrase].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: aws_secret_key must be an String") if params[:aws_secret_key] and !params[:aws_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: azure_blob_storage_access_key must be an String") if params[:azure_blob_storage_access_key] and !params[:azure_blob_storage_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: azure_blob_storage_sas_token must be an String") if params[:azure_blob_storage_sas_token] and !params[:azure_blob_storage_sas_token].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: azure_files_storage_access_key must be an String") if params[:azure_files_storage_access_key] and !params[:azure_files_storage_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: azure_files_storage_sas_token must be an String") if params[:azure_files_storage_sas_token] and !params[:azure_files_storage_sas_token].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: backblaze_b2_application_key must be an String") if params[:backblaze_b2_application_key] and !params[:backblaze_b2_application_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: backblaze_b2_key_id must be an String") if params[:backblaze_b2_key_id] and !params[:backblaze_b2_key_id].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: cloudflare_secret_key must be an String") if params[:cloudflare_secret_key] and !params[:cloudflare_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: filebase_secret_key must be an String") if params[:filebase_secret_key] and !params[:filebase_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: google_cloud_storage_credentials_json must be an String") if params[:google_cloud_storage_credentials_json] and !params[:google_cloud_storage_credentials_json].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: google_cloud_storage_s3_compatible_secret_key must be an String") if params[:google_cloud_storage_s3_compatible_secret_key] and !params[:google_cloud_storage_s3_compatible_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: linode_secret_key must be an String") if params[:linode_secret_key] and !params[:linode_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: s3_compatible_secret_key must be an String") if params[:s3_compatible_secret_key] and !params[:s3_compatible_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: wasabi_secret_key must be an String") if params[:wasabi_secret_key] and !params[:wasabi_secret_key].is_a?(String)
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]

  response, options = Api.send_request("/remote_server_credentials/#{params[:id]}", :patch, params, options)
  RemoteServerCredential.new(response.data, options)
end

Instance Method Details

#aws_access_keyObject

string - AWS Access Key.



58
59
60
# File 'lib/files.com/models/remote_server_credential.rb', line 58

def aws_access_key
  @attributes[:aws_access_key]
end

#aws_access_key=(value) ⇒ Object



62
63
64
# File 'lib/files.com/models/remote_server_credential.rb', line 62

def aws_access_key=(value)
  @attributes[:aws_access_key] = value
end

#aws_secret_keyObject

string - AWS: secret key.



184
185
186
# File 'lib/files.com/models/remote_server_credential.rb', line 184

def aws_secret_key
  @attributes[:aws_secret_key]
end

#aws_secret_key=(value) ⇒ Object



188
189
190
# File 'lib/files.com/models/remote_server_credential.rb', line 188

def aws_secret_key=(value)
  @attributes[:aws_secret_key] = value
end

#azure_blob_storage_access_keyObject

string - Azure Blob Storage: Access Key



193
194
195
# File 'lib/files.com/models/remote_server_credential.rb', line 193

def azure_blob_storage_access_key
  @attributes[:azure_blob_storage_access_key]
end

#azure_blob_storage_access_key=(value) ⇒ Object



197
198
199
# File 'lib/files.com/models/remote_server_credential.rb', line 197

def azure_blob_storage_access_key=(value)
  @attributes[:azure_blob_storage_access_key] = value
end

#azure_blob_storage_sas_tokenObject

string - Azure Blob Storage: Shared Access Signature (SAS) token



202
203
204
# File 'lib/files.com/models/remote_server_credential.rb', line 202

def azure_blob_storage_sas_token
  @attributes[:azure_blob_storage_sas_token]
end

#azure_blob_storage_sas_token=(value) ⇒ Object



206
207
208
# File 'lib/files.com/models/remote_server_credential.rb', line 206

def azure_blob_storage_sas_token=(value)
  @attributes[:azure_blob_storage_sas_token] = value
end

#azure_files_storage_access_keyObject

string - Azure File Storage: Access Key



211
212
213
# File 'lib/files.com/models/remote_server_credential.rb', line 211

def azure_files_storage_access_key
  @attributes[:azure_files_storage_access_key]
end

#azure_files_storage_access_key=(value) ⇒ Object



215
216
217
# File 'lib/files.com/models/remote_server_credential.rb', line 215

def azure_files_storage_access_key=(value)
  @attributes[:azure_files_storage_access_key] = value
end

#azure_files_storage_sas_tokenObject

string - Azure File Storage: Shared Access Signature (SAS) token



220
221
222
# File 'lib/files.com/models/remote_server_credential.rb', line 220

def azure_files_storage_sas_token
  @attributes[:azure_files_storage_sas_token]
end

#azure_files_storage_sas_token=(value) ⇒ Object



224
225
226
# File 'lib/files.com/models/remote_server_credential.rb', line 224

def azure_files_storage_sas_token=(value)
  @attributes[:azure_files_storage_sas_token] = value
end

#backblaze_b2_application_keyObject

string - Backblaze B2 Cloud Storage: applicationKey



229
230
231
# File 'lib/files.com/models/remote_server_credential.rb', line 229

def backblaze_b2_application_key
  @attributes[:backblaze_b2_application_key]
end

#backblaze_b2_application_key=(value) ⇒ Object



233
234
235
# File 'lib/files.com/models/remote_server_credential.rb', line 233

def backblaze_b2_application_key=(value)
  @attributes[:backblaze_b2_application_key] = value
end

#backblaze_b2_key_idObject

string - Backblaze B2 Cloud Storage: keyID



238
239
240
# File 'lib/files.com/models/remote_server_credential.rb', line 238

def backblaze_b2_key_id
  @attributes[:backblaze_b2_key_id]
end

#backblaze_b2_key_id=(value) ⇒ Object



242
243
244
# File 'lib/files.com/models/remote_server_credential.rb', line 242

def backblaze_b2_key_id=(value)
  @attributes[:backblaze_b2_key_id] = value
end

#cloudflare_access_keyObject

string - Cloudflare: Access Key.



130
131
132
# File 'lib/files.com/models/remote_server_credential.rb', line 130

def cloudflare_access_key
  @attributes[:cloudflare_access_key]
end

#cloudflare_access_key=(value) ⇒ Object



134
135
136
# File 'lib/files.com/models/remote_server_credential.rb', line 134

def cloudflare_access_key=(value)
  @attributes[:cloudflare_access_key] = value
end

#cloudflare_secret_keyObject

string - Cloudflare: Secret Key



247
248
249
# File 'lib/files.com/models/remote_server_credential.rb', line 247

def cloudflare_secret_key
  @attributes[:cloudflare_secret_key]
end

#cloudflare_secret_key=(value) ⇒ Object



251
252
253
# File 'lib/files.com/models/remote_server_credential.rb', line 251

def cloudflare_secret_key=(value)
  @attributes[:cloudflare_secret_key] = value
end

#delete(params = {}) ⇒ Object



380
381
382
383
384
385
386
387
388
# File 'lib/files.com/models/remote_server_credential.rb', line 380

def delete(params = {})
  params ||= {}
  params[:id] = @attributes[:id]
  raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]

  Api.send_request("/remote_server_credentials/#{@attributes[:id]}", :delete, params, @options)
end

#descriptionObject

string - Internal description for your reference



40
41
42
# File 'lib/files.com/models/remote_server_credential.rb', line 40

def description
  @attributes[:description]
end

#description=(value) ⇒ Object



44
45
46
# File 'lib/files.com/models/remote_server_credential.rb', line 44

def description=(value)
  @attributes[:description] = value
end

#destroy(params = {}) ⇒ Object



390
391
392
393
# File 'lib/files.com/models/remote_server_credential.rb', line 390

def destroy(params = {})
  delete(params)
  nil
end

#filebase_access_keyObject

string - Filebase: Access Key.



121
122
123
# File 'lib/files.com/models/remote_server_credential.rb', line 121

def filebase_access_key
  @attributes[:filebase_access_key]
end

#filebase_access_key=(value) ⇒ Object



125
126
127
# File 'lib/files.com/models/remote_server_credential.rb', line 125

def filebase_access_key=(value)
  @attributes[:filebase_access_key] = value
end

#filebase_secret_keyObject

string - Filebase: Secret Key



256
257
258
# File 'lib/files.com/models/remote_server_credential.rb', line 256

def filebase_secret_key
  @attributes[:filebase_secret_key]
end

#filebase_secret_key=(value) ⇒ Object



260
261
262
# File 'lib/files.com/models/remote_server_credential.rb', line 260

def filebase_secret_key=(value)
  @attributes[:filebase_secret_key] = value
end

#google_cloud_storage_credentials_jsonObject

string - Google Cloud Storage: JSON file that contains the private key. To generate see cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey



265
266
267
# File 'lib/files.com/models/remote_server_credential.rb', line 265

def google_cloud_storage_credentials_json
  @attributes[:google_cloud_storage_credentials_json]
end

#google_cloud_storage_credentials_json=(value) ⇒ Object



269
270
271
# File 'lib/files.com/models/remote_server_credential.rb', line 269

def google_cloud_storage_credentials_json=(value)
  @attributes[:google_cloud_storage_credentials_json] = value
end

#google_cloud_storage_s3_compatible_access_keyObject

string - Google Cloud Storage: S3-compatible Access Key.



94
95
96
# File 'lib/files.com/models/remote_server_credential.rb', line 94

def google_cloud_storage_s3_compatible_access_key
  @attributes[:google_cloud_storage_s3_compatible_access_key]
end

#google_cloud_storage_s3_compatible_access_key=(value) ⇒ Object



98
99
100
# File 'lib/files.com/models/remote_server_credential.rb', line 98

def google_cloud_storage_s3_compatible_access_key=(value)
  @attributes[:google_cloud_storage_s3_compatible_access_key] = value
end

#google_cloud_storage_s3_compatible_secret_keyObject

string - Google Cloud Storage: S3-compatible secret key



274
275
276
# File 'lib/files.com/models/remote_server_credential.rb', line 274

def google_cloud_storage_s3_compatible_secret_key
  @attributes[:google_cloud_storage_s3_compatible_secret_key]
end

#google_cloud_storage_s3_compatible_secret_key=(value) ⇒ Object



278
279
280
# File 'lib/files.com/models/remote_server_credential.rb', line 278

def google_cloud_storage_s3_compatible_secret_key=(value)
  @attributes[:google_cloud_storage_s3_compatible_secret_key] = value
end

#idObject

int64 - Remote Server Credential ID



13
14
15
# File 'lib/files.com/models/remote_server_credential.rb', line 13

def id
  @attributes[:id]
end

#id=(value) ⇒ Object



17
18
19
# File 'lib/files.com/models/remote_server_credential.rb', line 17

def id=(value)
  @attributes[:id] = value
end

#linode_access_keyObject

string - Linode: Access Key



139
140
141
# File 'lib/files.com/models/remote_server_credential.rb', line 139

def linode_access_key
  @attributes[:linode_access_key]
end

#linode_access_key=(value) ⇒ Object



143
144
145
# File 'lib/files.com/models/remote_server_credential.rb', line 143

def linode_access_key=(value)
  @attributes[:linode_access_key] = value
end

#linode_secret_keyObject

string - Linode: Secret Key



283
284
285
# File 'lib/files.com/models/remote_server_credential.rb', line 283

def linode_secret_key
  @attributes[:linode_secret_key]
end

#linode_secret_key=(value) ⇒ Object



287
288
289
# File 'lib/files.com/models/remote_server_credential.rb', line 287

def linode_secret_key=(value)
  @attributes[:linode_secret_key] = value
end

#nameObject

string - Internal name for your reference



31
32
33
# File 'lib/files.com/models/remote_server_credential.rb', line 31

def name
  @attributes[:name]
end

#name=(value) ⇒ Object



35
36
37
# File 'lib/files.com/models/remote_server_credential.rb', line 35

def name=(value)
  @attributes[:name] = value
end

#passwordObject

string - Password, if needed.



157
158
159
# File 'lib/files.com/models/remote_server_credential.rb', line 157

def password
  @attributes[:password]
end

#password=(value) ⇒ Object



161
162
163
# File 'lib/files.com/models/remote_server_credential.rb', line 161

def password=(value)
  @attributes[:password] = value
end

#private_keyObject

string - Private key, if needed.



166
167
168
# File 'lib/files.com/models/remote_server_credential.rb', line 166

def private_key
  @attributes[:private_key]
end

#private_key=(value) ⇒ Object



170
171
172
# File 'lib/files.com/models/remote_server_credential.rb', line 170

def private_key=(value)
  @attributes[:private_key] = value
end

#private_key_passphraseObject

string - Passphrase for private key if needed.



175
176
177
# File 'lib/files.com/models/remote_server_credential.rb', line 175

def private_key_passphrase
  @attributes[:private_key_passphrase]
end

#private_key_passphrase=(value) ⇒ Object



179
180
181
# File 'lib/files.com/models/remote_server_credential.rb', line 179

def private_key_passphrase=(value)
  @attributes[:private_key_passphrase] = value
end

#s3_assume_role_arnObject

string - AWS IAM Role ARN for AssumeRole authentication.



67
68
69
# File 'lib/files.com/models/remote_server_credential.rb', line 67

def s3_assume_role_arn
  @attributes[:s3_assume_role_arn]
end

#s3_assume_role_arn=(value) ⇒ Object



71
72
73
# File 'lib/files.com/models/remote_server_credential.rb', line 71

def s3_assume_role_arn=(value)
  @attributes[:s3_assume_role_arn] = value
end

#s3_assume_role_duration_secondsObject

int64 - Session duration in seconds for AssumeRole authentication (900-43200).



76
77
78
# File 'lib/files.com/models/remote_server_credential.rb', line 76

def s3_assume_role_duration_seconds
  @attributes[:s3_assume_role_duration_seconds]
end

#s3_assume_role_duration_seconds=(value) ⇒ Object



80
81
82
# File 'lib/files.com/models/remote_server_credential.rb', line 80

def s3_assume_role_duration_seconds=(value)
  @attributes[:s3_assume_role_duration_seconds] = value
end

#s3_assume_role_external_idObject

string - External ID for AssumeRole authentication.



85
86
87
# File 'lib/files.com/models/remote_server_credential.rb', line 85

def s3_assume_role_external_id
  @attributes[:s3_assume_role_external_id]
end

#s3_assume_role_external_id=(value) ⇒ Object



89
90
91
# File 'lib/files.com/models/remote_server_credential.rb', line 89

def s3_assume_role_external_id=(value)
  @attributes[:s3_assume_role_external_id] = value
end

#s3_compatible_access_keyObject

string - S3-compatible: Access Key



112
113
114
# File 'lib/files.com/models/remote_server_credential.rb', line 112

def s3_compatible_access_key
  @attributes[:s3_compatible_access_key]
end

#s3_compatible_access_key=(value) ⇒ Object



116
117
118
# File 'lib/files.com/models/remote_server_credential.rb', line 116

def s3_compatible_access_key=(value)
  @attributes[:s3_compatible_access_key] = value
end

#s3_compatible_secret_keyObject

string - S3-compatible: Secret Key



292
293
294
# File 'lib/files.com/models/remote_server_credential.rb', line 292

def s3_compatible_secret_key
  @attributes[:s3_compatible_secret_key]
end

#s3_compatible_secret_key=(value) ⇒ Object



296
297
298
# File 'lib/files.com/models/remote_server_credential.rb', line 296

def s3_compatible_secret_key=(value)
  @attributes[:s3_compatible_secret_key] = value
end

#saveObject



395
396
397
398
399
400
401
402
403
404
# File 'lib/files.com/models/remote_server_credential.rb', line 395

def save
  if @attributes[:id]
    new_obj = update(@attributes)
  else
    new_obj = RemoteServerCredential.create(@attributes, @options)
  end

  @attributes = new_obj.attributes
  true
end

#server_typeObject

string - Remote server type. Remote Server Credentials are only valid for a single type of Remote Server.



49
50
51
# File 'lib/files.com/models/remote_server_credential.rb', line 49

def server_type
  @attributes[:server_type]
end

#server_type=(value) ⇒ Object



53
54
55
# File 'lib/files.com/models/remote_server_credential.rb', line 53

def server_type=(value)
  @attributes[:server_type] = value
end

#update(params = {}) ⇒ Object

Parameters:

name - string - Internal name for your reference
description - string - Internal description for your reference
server_type - string - Remote server type.  Remote Server Credentials are only valid for a single type of Remote Server.
aws_access_key - string - AWS Access Key.
s3_assume_role_arn - string - AWS IAM Role ARN for AssumeRole authentication.
s3_assume_role_duration_seconds - int64 - Session duration in seconds for AssumeRole authentication (900-43200).
cloudflare_access_key - string - Cloudflare: Access Key.
filebase_access_key - string - Filebase: Access Key.
google_cloud_storage_s3_compatible_access_key - string - Google Cloud Storage: S3-compatible Access Key.
linode_access_key - string - Linode: Access Key
s3_compatible_access_key - string - S3-compatible: Access Key
username - string - Remote server username.
wasabi_access_key - string - Wasabi: Access Key.
password - string - Password, if needed.
private_key - string - Private key, if needed.
private_key_passphrase - string - Passphrase for private key if needed.
aws_secret_key - string - AWS: secret key.
azure_blob_storage_access_key - string - Azure Blob Storage: Access Key
azure_blob_storage_sas_token - string - Azure Blob Storage: Shared Access Signature (SAS) token
azure_files_storage_access_key - string - Azure File Storage: Access Key
azure_files_storage_sas_token - string - Azure File Storage: Shared Access Signature (SAS) token
backblaze_b2_application_key - string - Backblaze B2 Cloud Storage: applicationKey
backblaze_b2_key_id - string - Backblaze B2 Cloud Storage: keyID
cloudflare_secret_key - string - Cloudflare: Secret Key
filebase_secret_key - string - Filebase: Secret Key
google_cloud_storage_credentials_json - string - Google Cloud Storage: JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
google_cloud_storage_s3_compatible_secret_key - string - Google Cloud Storage: S3-compatible secret key
linode_secret_key - string - Linode: Secret Key
s3_compatible_secret_key - string - S3-compatible: Secret Key
wasabi_secret_key - string - Wasabi: Secret Key


340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# File 'lib/files.com/models/remote_server_credential.rb', line 340

def update(params = {})
  params ||= {}
  params[:id] = @attributes[:id]
  raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: server_type must be an String") if params[:server_type] and !params[:server_type].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: aws_access_key must be an String") if params[:aws_access_key] and !params[:aws_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: s3_assume_role_arn must be an String") if params[:s3_assume_role_arn] and !params[:s3_assume_role_arn].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: s3_assume_role_duration_seconds must be an Integer") if params[:s3_assume_role_duration_seconds] and !params[:s3_assume_role_duration_seconds].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: cloudflare_access_key must be an String") if params[:cloudflare_access_key] and !params[:cloudflare_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: filebase_access_key must be an String") if params[:filebase_access_key] and !params[:filebase_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: google_cloud_storage_s3_compatible_access_key must be an String") if params[:google_cloud_storage_s3_compatible_access_key] and !params[:google_cloud_storage_s3_compatible_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: linode_access_key must be an String") if params[:linode_access_key] and !params[:linode_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: s3_compatible_access_key must be an String") if params[:s3_compatible_access_key] and !params[:s3_compatible_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: username must be an String") if params[:username] and !params[:username].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: wasabi_access_key must be an String") if params[:wasabi_access_key] and !params[:wasabi_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: password must be an String") if params[:password] and !params[:password].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: private_key must be an String") if params[:private_key] and !params[:private_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: private_key_passphrase must be an String") if params[:private_key_passphrase] and !params[:private_key_passphrase].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: aws_secret_key must be an String") if params[:aws_secret_key] and !params[:aws_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: azure_blob_storage_access_key must be an String") if params[:azure_blob_storage_access_key] and !params[:azure_blob_storage_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: azure_blob_storage_sas_token must be an String") if params[:azure_blob_storage_sas_token] and !params[:azure_blob_storage_sas_token].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: azure_files_storage_access_key must be an String") if params[:azure_files_storage_access_key] and !params[:azure_files_storage_access_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: azure_files_storage_sas_token must be an String") if params[:azure_files_storage_sas_token] and !params[:azure_files_storage_sas_token].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: backblaze_b2_application_key must be an String") if params[:backblaze_b2_application_key] and !params[:backblaze_b2_application_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: backblaze_b2_key_id must be an String") if params[:backblaze_b2_key_id] and !params[:backblaze_b2_key_id].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: cloudflare_secret_key must be an String") if params[:cloudflare_secret_key] and !params[:cloudflare_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: filebase_secret_key must be an String") if params[:filebase_secret_key] and !params[:filebase_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: google_cloud_storage_credentials_json must be an String") if params[:google_cloud_storage_credentials_json] and !params[:google_cloud_storage_credentials_json].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: google_cloud_storage_s3_compatible_secret_key must be an String") if params[:google_cloud_storage_s3_compatible_secret_key] and !params[:google_cloud_storage_s3_compatible_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: linode_secret_key must be an String") if params[:linode_secret_key] and !params[:linode_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: s3_compatible_secret_key must be an String") if params[:s3_compatible_secret_key] and !params[:s3_compatible_secret_key].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: wasabi_secret_key must be an String") if params[:wasabi_secret_key] and !params[:wasabi_secret_key].is_a?(String)
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]

  Api.send_request("/remote_server_credentials/#{@attributes[:id]}", :patch, params, @options)
end

#usernameObject

string - Remote server username.



148
149
150
# File 'lib/files.com/models/remote_server_credential.rb', line 148

def username
  @attributes[:username]
end

#username=(value) ⇒ Object



152
153
154
# File 'lib/files.com/models/remote_server_credential.rb', line 152

def username=(value)
  @attributes[:username] = value
end

#wasabi_access_keyObject

string - Wasabi: Access Key.



103
104
105
# File 'lib/files.com/models/remote_server_credential.rb', line 103

def wasabi_access_key
  @attributes[:wasabi_access_key]
end

#wasabi_access_key=(value) ⇒ Object



107
108
109
# File 'lib/files.com/models/remote_server_credential.rb', line 107

def wasabi_access_key=(value)
  @attributes[:wasabi_access_key] = value
end

#wasabi_secret_keyObject

string - Wasabi: Secret Key



301
302
303
# File 'lib/files.com/models/remote_server_credential.rb', line 301

def wasabi_secret_key
  @attributes[:wasabi_secret_key]
end

#wasabi_secret_key=(value) ⇒ Object



305
306
307
# File 'lib/files.com/models/remote_server_credential.rb', line 305

def wasabi_secret_key=(value)
  @attributes[:wasabi_secret_key] = value
end

#workspace_idObject

int64 - Workspace ID (0 for default workspace)



22
23
24
# File 'lib/files.com/models/remote_server_credential.rb', line 22

def workspace_id
  @attributes[:workspace_id]
end

#workspace_id=(value) ⇒ Object



26
27
28
# File 'lib/files.com/models/remote_server_credential.rb', line 26

def workspace_id=(value)
  @attributes[:workspace_id] = value
end