Class: GetStream::Generated::Models::PollResponseData

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/getstream_ruby/generated/models/poll_response_data.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#==, #inspect, omit_empty_fields, #to_h, #to_json

Constructor Details

#initialize(attributes = {}) ⇒ PollResponseData

Initialize with attributes



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 77

def initialize(attributes = {})
  super(attributes)
  @allow_answers = attributes[:allow_answers] || attributes['allow_answers']
  @allow_user_suggested_options = attributes[:allow_user_suggested_options] || attributes['allow_user_suggested_options']
  @answers_count = attributes[:answers_count] || attributes['answers_count']
  @created_at = attributes[:created_at] || attributes['created_at']
  @created_by_id = attributes[:created_by_id] || attributes['created_by_id']
  @description = attributes[:description] || attributes['description']
  @enforce_unique_vote = attributes[:enforce_unique_vote] || attributes['enforce_unique_vote']
  @id = attributes[:id] || attributes['id']
  @name = attributes[:name] || attributes['name']
  @updated_at = attributes[:updated_at] || attributes['updated_at']
  @vote_count = attributes[:vote_count] || attributes['vote_count']
  @voting_visibility = attributes[:voting_visibility] || attributes['voting_visibility']
  @latest_answers = attributes[:latest_answers] || attributes['latest_answers']
  @options = attributes[:options] || attributes['options']
  @own_votes = attributes[:own_votes] || attributes['own_votes']
  @custom = attributes[:custom] || attributes['custom']
  @latest_votes_by_option = attributes[:latest_votes_by_option] || attributes['latest_votes_by_option']
  @vote_counts_by_option = attributes[:vote_counts_by_option] || attributes['vote_counts_by_option']
  @is_closed = attributes[:is_closed] || attributes['is_closed'] || nil
  @max_votes_allowed = attributes[:max_votes_allowed] || attributes['max_votes_allowed'] || nil
  @created_by = attributes[:created_by] || attributes['created_by'] || nil
end

Instance Attribute Details

#allow_answersBoolean



14
15
16
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 14

def allow_answers
  @allow_answers
end

#allow_user_suggested_optionsBoolean



17
18
19
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 17

def allow_user_suggested_options
  @allow_user_suggested_options
end

#answers_countInteger



20
21
22
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 20

def answers_count
  @answers_count
end

#created_atDateTime



23
24
25
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 23

def created_at
  @created_at
end

#created_byUserResponse



74
75
76
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 74

def created_by
  @created_by
end

#created_by_idString



26
27
28
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 26

def created_by_id
  @created_by_id
end

#customObject



59
60
61
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 59

def custom
  @custom
end

#descriptionString



29
30
31
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 29

def description
  @description
end

#enforce_unique_voteBoolean



32
33
34
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 32

def enforce_unique_vote
  @enforce_unique_vote
end

#idString



35
36
37
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 35

def id
  @id
end

#is_closedBoolean



68
69
70
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 68

def is_closed
  @is_closed
end

#latest_answersArray<PollVoteResponseData>



50
51
52
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 50

def latest_answers
  @latest_answers
end

#latest_votes_by_optionHash<String, Array<PollVoteResponseData>>



62
63
64
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 62

def latest_votes_by_option
  @latest_votes_by_option
end

#max_votes_allowedInteger



71
72
73
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 71

def max_votes_allowed
  @max_votes_allowed
end

#nameString



38
39
40
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 38

def name
  @name
end

#optionsArray<PollOptionResponseData>



53
54
55
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 53

def options
  @options
end

#own_votesArray<PollVoteResponseData>



56
57
58
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 56

def own_votes
  @own_votes
end

#updated_atDateTime



41
42
43
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 41

def updated_at
  @updated_at
end

#vote_countInteger



44
45
46
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 44

def vote_count
  @vote_count
end

#vote_counts_by_optionHash<String, Integer>



65
66
67
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 65

def vote_counts_by_option
  @vote_counts_by_option
end

#voting_visibilityString



47
48
49
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 47

def voting_visibility
  @voting_visibility
end

Class Method Details

.json_field_mappingsObject

Override field mappings for JSON serialization



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/getstream_ruby/generated/models/poll_response_data.rb', line 103

def self.json_field_mappings
  {
    allow_answers: 'allow_answers',
    allow_user_suggested_options: 'allow_user_suggested_options',
    answers_count: 'answers_count',
    created_at: 'created_at',
    created_by_id: 'created_by_id',
    description: 'description',
    enforce_unique_vote: 'enforce_unique_vote',
    id: 'id',
    name: 'name',
    updated_at: 'updated_at',
    vote_count: 'vote_count',
    voting_visibility: 'voting_visibility',
    latest_answers: 'latest_answers',
    options: 'options',
    own_votes: 'own_votes',
    custom: 'custom',
    latest_votes_by_option: 'latest_votes_by_option',
    vote_counts_by_option: 'vote_counts_by_option',
    is_closed: 'is_closed',
    max_votes_allowed: 'max_votes_allowed',
    created_by: 'created_by'
  }
end