Class: Sidemash::Sdk::StreamSquare

Inherits:
Object
  • Object
show all
Defined in:
lib/sidemash/sdk/stream_square.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, url, status, is_elastic, size, play_domain_name, publish_domain_name, publish, hook, description, foreign_data) ⇒ StreamSquare

Returns a new instance of StreamSquare.



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/sidemash/sdk/stream_square.rb', line 34

def initialize(id,
               url,
               status,
               is_elastic,
               size,
               play_domain_name,
               publish_domain_name,
               publish,
               hook,
               description,
               foreign_data)
  @_type = 'StreamSquare'
  @id = id
  @url = url
  @status = status
  @is_elastic = is_elastic
  @size = size
  @play_domain_name = play_domain_name
  @publish_domain_name = publish_domain_name
  @publish = publish
  @hook = hook
  @description = description
  @foreign_data = foreign_data
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



31
32
33
# File 'lib/sidemash/sdk/stream_square.rb', line 31

def description
  @description
end

#foreign_dataObject (readonly)

Returns the value of attribute foreign_data.



32
33
34
# File 'lib/sidemash/sdk/stream_square.rb', line 32

def foreign_data
  @foreign_data
end

#hookObject (readonly)

Returns the value of attribute hook.



30
31
32
# File 'lib/sidemash/sdk/stream_square.rb', line 30

def hook
  @hook
end

#idObject (readonly)

Returns the value of attribute id.



22
23
24
# File 'lib/sidemash/sdk/stream_square.rb', line 22

def id
  @id
end

#is_elasticObject (readonly)

Returns the value of attribute is_elastic.



25
26
27
# File 'lib/sidemash/sdk/stream_square.rb', line 25

def is_elastic
  @is_elastic
end

#play_domain_nameObject (readonly)

Returns the value of attribute play_domain_name.



27
28
29
# File 'lib/sidemash/sdk/stream_square.rb', line 27

def play_domain_name
  @play_domain_name
end

#publishObject (readonly)

Returns the value of attribute publish.



29
30
31
# File 'lib/sidemash/sdk/stream_square.rb', line 29

def publish
  @publish
end

#publish_domain_nameObject (readonly)

Returns the value of attribute publish_domain_name.



28
29
30
# File 'lib/sidemash/sdk/stream_square.rb', line 28

def publish_domain_name
  @publish_domain_name
end

#sizeObject (readonly)

Returns the value of attribute size.



26
27
28
# File 'lib/sidemash/sdk/stream_square.rb', line 26

def size
  @size
end

#statusObject (readonly)

Returns the value of attribute status.



24
25
26
# File 'lib/sidemash/sdk/stream_square.rb', line 24

def status
  @status
end

#urlObject (readonly)

Returns the value of attribute url.



23
24
25
# File 'lib/sidemash/sdk/stream_square.rb', line 23

def url
  @url
end

Class Method Details

._typeObject



59
60
61
# File 'lib/sidemash/sdk/stream_square.rb', line 59

def self._type
  'StreamSquare'
end

.from_hash(h) ⇒ Object



116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/sidemash/sdk/stream_square.rb', line 116

def self.from_hash(h)
  StreamSquare.new(h['id'],
                   h['url'],
                   InstanceStatus.from_s(h['status']),
                   h['is_elastic'],
                   StreamSquareSize.from_s(h['size']),
                   h['play_domain_name'].nil? ? h['play_domain_name'] : nil,
                   h['publish_domain_name'].nil? ? h['publish_domain_name'] : nil,
                   Publish.from_hash(h['publish']),
                   Hook.from_hash(h['hook']),
                   h['description'].nil? ? h['description'] : nil,
                   h['foreign_data'].nil? ? h['foreign_data'] : nil)
end

.from_json(js) ⇒ Object



63
64
65
66
# File 'lib/sidemash/sdk/stream_square.rb', line 63

def self.from_json(js)
  h = JSON.parse(js)
  StreamSquare.from_hash(h)
end

.from_remote(h) ⇒ Object



102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/sidemash/sdk/stream_square.rb', line 102

def self.from_remote(h)
  StreamSquare.new(h['id'],
                   h['url'],
                   InstanceStatus.from_s(h['status']),
                   h['isElastic'],
                   StreamSquareSize.from_s(h['size']),
                   h['playDomainName'].nil? ? h['playDomainName'] : nil,
                   h['publishDomainName'].nil? ? h['publishDomainName'] : nil,
                   Publish.from_remote(h['publish']),
                   Hook.from_remote(h['hook']),
                   h['description'].nil? ? h['description'] : nil,
                   h['foreignData'].nil? ? h['foreignData'] : nil)
end

Instance Method Details

#to_hashObject



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/sidemash/sdk/stream_square.rb', line 85

def to_hash
  result = {}
  result[:_type] = @_type
  result[:id] = @id
  result[:url] = @url
  result[:status] = @status.to_s
  result[:is_elastic] = @is_elastic
  result[:size] = @size.to_s
  result[:play_domain_name] = @play_domain_name unless @play_domain_name.nil?
  result[:publish_domain_name] = @publish_domain_name unless @publish_domain_name.nil?
  result[:publish] = @publish.to_hash
  result[:hook] = @hook.to_hash
  result[:description] = @description unless @description.nil?
  result[:foreign_data] = @foreign_data unless @foreign_data.nil?
  result
end

#to_json(*a) ⇒ Object



130
131
132
# File 'lib/sidemash/sdk/stream_square.rb', line 130

def to_json(*a)
  to_hash.to_json(*a)
end

#to_remoteObject



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/sidemash/sdk/stream_square.rb', line 68

def to_remote
  result = {}
  result[:_type] = @_type
  result[:id] = @id
  result[:url] = @url
  result[:status] = @status.to_s
  result[:isElastic] = @is_elastic
  result[:size] = @size.to_s
  result[:playDomainName] = @play_domain_name unless @play_domain_name.nil?
  result[:publishDomainName] = @publish_domain_name unless @publish_domain_name.nil?
  result[:publish] = @publish.to_remote
  result[:hook] = @hook.to_remote
  result[:description] = @description unless @description.nil?
  result[:foreignData] = @foreign_data unless @foreign_data.nil?
  result
end

#to_sObject



134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/sidemash/sdk/stream_square.rb', line 134

def to_s
  ('StreamSquare(id=' + @id +
                ', url=' + @url +
                ', status=' + @status.to_s +
                ', is_elastic=' + @is_elastic +
                ', size=' + @size.to_s +
                ', play_domain_name=' + @play_domain_name +
                ', publish_domain_name=' + @publish_domain_name +
                ', publish=' + @publish.to_s +
                ', hook=' + @hook.to_s +
                ', description=' + @description +
                ', foreign_data=' + @foreign_data + ')')
end