class Comet::S3DestinationLocation

S3DestinationLocation is a typed class wrapper around the underlying Comet Server API data structure.

Attributes

s3access_key[RW]

@type [String] s3access_key

s3bucket_name[RW]

@type [String] s3bucket_name

s3secret_key[RW]

@type [String] s3secret_key

s3server[RW]

@type [String] s3server

s3subdir[RW]

@type [String] s3subdir

s3uses_tls[RW]

@type [Boolean] s3uses_tls

s3uses_v2signing[RW]

@type [Boolean] s3uses_v2signing

unknown_json_fields[RW]

@type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations

Public Class Methods

new() click to toggle source
# File lib/comet/models/s3destination_location.rb, line 41
def initialize
  clear
end

Public Instance Methods

clear() click to toggle source
# File lib/comet/models/s3destination_location.rb, line 45
def clear
  @s3server = ''
  @s3access_key = ''
  @s3secret_key = ''
  @s3bucket_name = ''
  @s3subdir = ''
  @unknown_json_fields = {}
end
from_hash(obj) click to toggle source

@param [Hash] obj The complete object as a Ruby hash

# File lib/comet/models/s3destination_location.rb, line 62
def from_hash(obj)
  raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash

  obj.each do |k, v|
    case k
    when 'S3Server'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @s3server = v
    when 'S3UsesTLS'
      @s3uses_tls = v
    when 'S3AccessKey'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @s3access_key = v
    when 'S3SecretKey'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @s3secret_key = v
    when 'S3BucketName'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @s3bucket_name = v
    when 'S3Subdir'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @s3subdir = v
    when 'S3UsesV2Signing'
      @s3uses_v2signing = v
    else
      @unknown_json_fields[k] = v
    end
  end
end
from_json(json_string) click to toggle source

@param [String] json_string The complete object in JSON format

# File lib/comet/models/s3destination_location.rb, line 55
def from_json(json_string)
  raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String

  from_hash(JSON.parse(json_string))
end
to_h() click to toggle source

@return [Hash] The complete object as a Ruby hash

# File lib/comet/models/s3destination_location.rb, line 114
def to_h
  to_hash
end
to_hash() click to toggle source

@return [Hash] The complete object as a Ruby hash

# File lib/comet/models/s3destination_location.rb, line 98
def to_hash
  ret = {}
  ret['S3Server'] = @s3server
  ret['S3UsesTLS'] = @s3uses_tls
  ret['S3AccessKey'] = @s3access_key
  ret['S3SecretKey'] = @s3secret_key
  ret['S3BucketName'] = @s3bucket_name
  ret['S3Subdir'] = @s3subdir
  ret['S3UsesV2Signing'] = @s3uses_v2signing
  @unknown_json_fields.each do |k, v|
    ret[k] = v
  end
  ret
end
to_json(options = {}) click to toggle source

@return [String] The complete object as a JSON string

# File lib/comet/models/s3destination_location.rb, line 119
def to_json(options = {})
  to_hash.to_json(options)
end