Class: AkamaiApi::ECCU::FindResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/akamai_api/eccu/find_response.rb

Overview

FindResponse exposes the response received when requesting the details of an Akamai ECCU request

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ FindResponse

Returns a new instance of FindResponse.

Parameters:

  • raw (Hash)

    raw response object



11
12
13
# File 'lib/akamai_api/eccu/find_response.rb', line 11

def initialize raw
  @raw = raw
end

Instance Attribute Details

#rawHash (readonly)

Raw response object

Returns:

  • (Hash)

    raw response object



8
9
10
# File 'lib/akamai_api/eccu/find_response.rb', line 8

def raw
  @raw
end

Instance Method Details

#codeFixnum

Request code

Returns:

  • (Fixnum)

    request code



17
18
19
# File 'lib/akamai_api/eccu/find_response.rb', line 17

def code
  raw[:file_id]
end

#emailString Also known as: status_change_email

Email to be notified when the request becomes completed

Returns:

  • (String)

    email to be notified when the request becomes completed



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/akamai_api/eccu/find_response.rb', line 39

{
  :notes       => :notes,
  :email       => :status_change_email,
  :updated_at  => :update_date,
  :uploaded_at => :upload_date,
  :uploaded_by => :uploaded_by,
  :version     => :version_string
}.each do |local_field, soap_field|
  define_method local_field do
    get_if_handleable(raw[soap_field])
  end
end

#fileHash

Uploaded file details

Returns:

  • (Hash)

    file details

    • :content [String] file content

    • :size [Fixnum] file size

    • :name [String] file name

    • :md5 [String] MD5 digest of the file content



63
64
65
66
67
68
69
70
71
# File 'lib/akamai_api/eccu/find_response.rb', line 63

def file
  content64 = get_if_handleable(raw[:contents])
  {
    :content => content64 ? Base64.decode64(content64) : nil,
    :size    => raw[:file_size].to_i,
    :name    => get_if_handleable(raw[:filename]),
    :md5     => get_if_handleable(raw[:md5_digest])
  }.reject { |k, v| v.nil? }
end

#notesString

Notes of the request

Returns:

  • (String)

    notes of the request



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/akamai_api/eccu/find_response.rb', line 39

{
  :notes       => :notes,
  :email       => :status_change_email,
  :updated_at  => :update_date,
  :uploaded_at => :upload_date,
  :uploaded_by => :uploaded_by,
  :version     => :version_string
}.each do |local_field, soap_field|
  define_method local_field do
    get_if_handleable(raw[soap_field])
  end
end

#propertyHash

Digital property details

Returns:

  • (Hash)

    property details

    • :name [String]

    • :exact_match [true,false]

    • :type [String]



93
94
95
96
97
98
99
# File 'lib/akamai_api/eccu/find_response.rb', line 93

def property
  {
    :name        => get_if_handleable(raw[:property_name]),
    :exact_match => (raw[:property_name_exact_match] == true),
    :type        => get_if_handleable(raw[:property_type])
  }.reject { |k, v| v.nil? }
end

#statusHash

Request status

Returns:

  • (Hash)

    request status

    • :extended [String] extended status message

    • :code [Fixnum] status code

    • :message [String] status message

    • :updated_at [String] last time the status has been updated



79
80
81
82
83
84
85
86
# File 'lib/akamai_api/eccu/find_response.rb', line 79

def status
  {
    :extended   => get_if_handleable(raw[:extended_status_message]),
    :code       => raw[:status_code].to_i,
    :message    => get_if_handleable(raw[:status_message]),
    :updated_at => get_if_handleable(raw[:status_update_date])
  }.reject { |k, v| v.nil? }
end

#updated_atString Also known as: update_date

Last time the request was updated

Returns:

  • (String)

    last time the request was updated



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/akamai_api/eccu/find_response.rb', line 39

{
  :notes       => :notes,
  :email       => :status_change_email,
  :updated_at  => :update_date,
  :uploaded_at => :upload_date,
  :uploaded_by => :uploaded_by,
  :version     => :version_string
}.each do |local_field, soap_field|
  define_method local_field do
    get_if_handleable(raw[soap_field])
  end
end

#uploaded_atString Also known as: upload_date

Time the request was uploaded

Returns:

  • (String)

    time the request was uploaded



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/akamai_api/eccu/find_response.rb', line 39

{
  :notes       => :notes,
  :email       => :status_change_email,
  :updated_at  => :update_date,
  :uploaded_at => :upload_date,
  :uploaded_by => :uploaded_by,
  :version     => :version_string
}.each do |local_field, soap_field|
  define_method local_field do
    get_if_handleable(raw[soap_field])
  end
end

#uploaded_byString

User that submitted the request

Returns:

  • (String)

    user name



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/akamai_api/eccu/find_response.rb', line 39

{
  :notes       => :notes,
  :email       => :status_change_email,
  :updated_at  => :update_date,
  :uploaded_at => :upload_date,
  :uploaded_by => :uploaded_by,
  :version     => :version_string
}.each do |local_field, soap_field|
  define_method local_field do
    get_if_handleable(raw[soap_field])
  end
end

#versionString Also known as: version_string

version of the request

Returns:

  • (String)

    version of the request



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/akamai_api/eccu/find_response.rb', line 39

{
  :notes       => :notes,
  :email       => :status_change_email,
  :updated_at  => :update_date,
  :uploaded_at => :upload_date,
  :uploaded_by => :uploaded_by,
  :version     => :version_string
}.each do |local_field, soap_field|
  define_method local_field do
    get_if_handleable(raw[soap_field])
  end
end