Class: Line::Bot::V2::ManageAudience::GetAudienceGroupsResponse
- Inherits:
-
Object
- Object
- Line::Bot::V2::ManageAudience::GetAudienceGroupsResponse
- Defined in:
- lib/line/bot/v2/manage_audience/model/get_audience_groups_response.rb
Overview
Gets data for more than one audience.
Instance Attribute Summary collapse
-
#audience_groups ⇒ Array[AudienceGroup]?
An array of audience data.
-
#has_next_page ⇒ Boolean?
True when this is not the last page.
-
#page ⇒ Integer?
The current page number.
-
#read_write_audience_group_total_count ⇒ Integer?
Of the audiences you can get with the specified filter, the number of audiences with the update permission set to READ_WRITE.
-
#size ⇒ Integer?
The maximum number of audiences on the current page.
-
#total_count ⇒ Integer?
The total number of audiences that can be returned with the specified filter.
Class Method Summary collapse
-
.create(args) ⇒ Line::Bot::V2::ManageAudience::GetAudienceGroupsResponse
Create an instance of the class from a hash.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
True if the objects are equal, false otherwise.
-
#hash ⇒ Integer
Hash code of the object.
-
#initialize(audience_groups: nil, has_next_page: nil, total_count: nil, read_write_audience_group_total_count: nil, page: nil, size: nil, **dynamic_attributes) ⇒ GetAudienceGroupsResponse
constructor
A new instance of GetAudienceGroupsResponse.
Constructor Details
#initialize(audience_groups: nil, has_next_page: nil, total_count: nil, read_write_audience_group_total_count: nil, page: nil, size: nil, **dynamic_attributes) ⇒ GetAudienceGroupsResponse
Returns a new instance of GetAudienceGroupsResponse.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/line/bot/v2/manage_audience/model/get_audience_groups_response.rb', line 42 def initialize( audience_groups: nil, has_next_page: nil, total_count: nil, read_write_audience_group_total_count: nil, page: nil, size: nil, **dynamic_attributes ) @audience_groups = audience_groups&.map do |item| if item.is_a?(Hash) Line::Bot::V2::ManageAudience::AudienceGroup.create(**item) # steep:ignore InsufficientKeywordArguments else item end end @has_next_page = has_next_page @total_count = total_count @read_write_audience_group_total_count = read_write_audience_group_total_count @page = page @size = size dynamic_attributes.each do |key, value| self.class.attr_accessor key if value.is_a?(Hash) struct_klass = Struct.new(*value.keys.map(&:to_sym)) struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v } instance_variable_set("@#{key}", struct_klass.new(*struct_values)) else instance_variable_set("@#{key}", value) end end end |
Instance Attribute Details
#audience_groups ⇒ Array[AudienceGroup]?
Returns An array of audience data. If there are no audiences that match the specified filter, an empty array will be returned.
19 20 21 |
# File 'lib/line/bot/v2/manage_audience/model/get_audience_groups_response.rb', line 19 def audience_groups @audience_groups end |
#has_next_page ⇒ Boolean?
Returns true when this is not the last page.
22 23 24 |
# File 'lib/line/bot/v2/manage_audience/model/get_audience_groups_response.rb', line 22 def has_next_page @has_next_page end |
#page ⇒ Integer?
Returns The current page number.
31 32 33 |
# File 'lib/line/bot/v2/manage_audience/model/get_audience_groups_response.rb', line 31 def page @page end |
#read_write_audience_group_total_count ⇒ Integer?
Returns Of the audiences you can get with the specified filter, the number of audiences with the update permission set to READ_WRITE.
28 29 30 |
# File 'lib/line/bot/v2/manage_audience/model/get_audience_groups_response.rb', line 28 def read_write_audience_group_total_count @read_write_audience_group_total_count end |
#size ⇒ Integer?
Returns The maximum number of audiences on the current page.
34 35 36 |
# File 'lib/line/bot/v2/manage_audience/model/get_audience_groups_response.rb', line 34 def size @size end |
#total_count ⇒ Integer?
Returns The total number of audiences that can be returned with the specified filter.
25 26 27 |
# File 'lib/line/bot/v2/manage_audience/model/get_audience_groups_response.rb', line 25 def total_count @total_count end |
Class Method Details
.create(args) ⇒ Line::Bot::V2::ManageAudience::GetAudienceGroupsResponse
Create an instance of the class from a hash
81 82 83 84 |
# File 'lib/line/bot/v2/manage_audience/model/get_audience_groups_response.rb', line 81 def self.create(args) # steep:ignore symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args) return new(**symbolized_args) # steep:ignore end |
Instance Method Details
#==(other) ⇒ Boolean
Returns true if the objects are equal, false otherwise.
88 89 90 91 92 93 94 |
# File 'lib/line/bot/v2/manage_audience/model/get_audience_groups_response.rb', line 88 def ==(other) return false unless self.class == other.class instance_variables.all? do |var| instance_variable_get(var) == other.instance_variable_get(var) end end |
#hash ⇒ Integer
Returns Hash code of the object.
97 98 99 |
# File 'lib/line/bot/v2/manage_audience/model/get_audience_groups_response.rb', line 97 def hash [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash end |