Class: Line::Bot::V2::ManageAudience::CreateAudienceGroupResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/line/bot/v2/manage_audience/model/create_audience_group_response.rb

Overview

Create audience for uploading user IDs (by JSON)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(audience_group_id: nil, create_route: nil, type: nil, description: nil, created: nil, permission: nil, expire_timestamp: nil, is_ifa_audience: nil, **dynamic_attributes) ⇒ CreateAudienceGroupResponse

Returns a new instance of CreateAudienceGroupResponse.

Parameters:

  • audience_group_id (Integer, nil) (defaults to: nil)

    The audience ID.

  • create_route (String, nil) (defaults to: nil)

    (‘MESSAGING_API’) How the audience was created. ‘MESSAGING_API`: An audience created with Messaging API.

  • type (String, nil) (defaults to: nil)

    (‘UPLOAD’|‘CLICK’|‘IMP’|‘CHAT_TAG’|‘FRIEND_PATH’|‘RESERVATION’|‘APP_EVENT’|‘VIDEO_VIEW’|‘WEBTRAFFIC’|‘IMAGE_CLICK’|‘RICHMENU_IMP’|‘RICHMENU_CLICK’)

  • description (String, nil) (defaults to: nil)

    The audience’s name.

  • created (Integer, nil) (defaults to: nil)

    When the audience was created (in UNIX time).

  • permission (String, nil) (defaults to: nil)

    (‘READ’|‘READ_WRITE’) Audience’s update permission. Audiences linked to the same channel will be READ_WRITE. ‘READ`: Can use only. `READ_WRITE`: Can use and update.

  • expire_timestamp (Integer, nil) (defaults to: nil)

    Time of audience expiration. Only returned for specific audiences.

  • is_ifa_audience (Boolean, nil) (defaults to: nil)

    The value indicating the type of account to be sent, as specified when creating the audience for uploading user IDs. One of: ‘true`: Accounts are specified with IFAs. `false` (default): Accounts are specified with user IDs.



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
77
78
79
80
81
82
# File 'lib/line/bot/v2/manage_audience/model/create_audience_group_response.rb', line 50

def initialize(
  audience_group_id: nil,
  create_route: nil,
  type: nil,
  description: nil,
  created: nil,
  permission: nil,
  expire_timestamp: nil,
  is_ifa_audience: nil,
  **dynamic_attributes
)
  
  @audience_group_id = audience_group_id
  @create_route = create_route
  @type = type
  @description = description
  @created = created
  @permission = permission
  @expire_timestamp = expire_timestamp
  @is_ifa_audience = is_ifa_audience

  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_group_idInteger?

Returns The audience ID.

Returns:

  • (Integer, nil)

    The audience ID.



19
20
21
# File 'lib/line/bot/v2/manage_audience/model/create_audience_group_response.rb', line 19

def audience_group_id
  @audience_group_id
end

#create_routeString?

Returns (‘MESSAGING_API’) How the audience was created. ‘MESSAGING_API`: An audience created with Messaging API.

Returns:

  • (String, nil)

    (‘MESSAGING_API’) How the audience was created. ‘MESSAGING_API`: An audience created with Messaging API.



22
23
24
# File 'lib/line/bot/v2/manage_audience/model/create_audience_group_response.rb', line 22

def create_route
  @create_route
end

#createdInteger?

Returns When the audience was created (in UNIX time).

Returns:

  • (Integer, nil)

    When the audience was created (in UNIX time).



31
32
33
# File 'lib/line/bot/v2/manage_audience/model/create_audience_group_response.rb', line 31

def created
  @created
end

#descriptionString?

Returns The audience’s name.

Returns:

  • (String, nil)

    The audience’s name.



28
29
30
# File 'lib/line/bot/v2/manage_audience/model/create_audience_group_response.rb', line 28

def description
  @description
end

#expire_timestampInteger?

Returns Time of audience expiration. Only returned for specific audiences.

Returns:

  • (Integer, nil)

    Time of audience expiration. Only returned for specific audiences.



37
38
39
# File 'lib/line/bot/v2/manage_audience/model/create_audience_group_response.rb', line 37

def expire_timestamp
  @expire_timestamp
end

#is_ifa_audienceBoolean?

Returns The value indicating the type of account to be sent, as specified when creating the audience for uploading user IDs. One of: ‘true`: Accounts are specified with IFAs. `false` (default): Accounts are specified with user IDs.

Returns:

  • (Boolean, nil)

    The value indicating the type of account to be sent, as specified when creating the audience for uploading user IDs. One of: ‘true`: Accounts are specified with IFAs. `false` (default): Accounts are specified with user IDs.



40
41
42
# File 'lib/line/bot/v2/manage_audience/model/create_audience_group_response.rb', line 40

def is_ifa_audience
  @is_ifa_audience
end

#permissionString?

Returns (‘READ’|‘READ_WRITE’) Audience’s update permission. Audiences linked to the same channel will be READ_WRITE. ‘READ`: Can use only. `READ_WRITE`: Can use and update.

Returns:

  • (String, nil)

    (‘READ’|‘READ_WRITE’) Audience’s update permission. Audiences linked to the same channel will be READ_WRITE. ‘READ`: Can use only. `READ_WRITE`: Can use and update.



34
35
36
# File 'lib/line/bot/v2/manage_audience/model/create_audience_group_response.rb', line 34

def permission
  @permission
end

#typeString?

Returns (‘UPLOAD’|‘CLICK’|‘IMP’|‘CHAT_TAG’|‘FRIEND_PATH’|‘RESERVATION’|‘APP_EVENT’|‘VIDEO_VIEW’|‘WEBTRAFFIC’|‘IMAGE_CLICK’|‘RICHMENU_IMP’|‘RICHMENU_CLICK’).

Returns:

  • (String, nil)

    (‘UPLOAD’|‘CLICK’|‘IMP’|‘CHAT_TAG’|‘FRIEND_PATH’|‘RESERVATION’|‘APP_EVENT’|‘VIDEO_VIEW’|‘WEBTRAFFIC’|‘IMAGE_CLICK’|‘RICHMENU_IMP’|‘RICHMENU_CLICK’)



25
26
27
# File 'lib/line/bot/v2/manage_audience/model/create_audience_group_response.rb', line 25

def type
  @type
end

Class Method Details

.create(args) ⇒ Line::Bot::V2::ManageAudience::CreateAudienceGroupResponse

Create an instance of the class from a hash

Parameters:

  • args (Hash)

    Hash containing all the required attributes

Returns:



87
88
89
90
# File 'lib/line/bot/v2/manage_audience/model/create_audience_group_response.rb', line 87

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.

Parameters:

  • other (Object)

    Object to compare

Returns:

  • (Boolean)

    true if the objects are equal, false otherwise



94
95
96
97
98
99
100
# File 'lib/line/bot/v2/manage_audience/model/create_audience_group_response.rb', line 94

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

#hashInteger

Returns Hash code of the object.

Returns:

  • (Integer)

    Hash code of the object



103
104
105
# File 'lib/line/bot/v2/manage_audience/model/create_audience_group_response.rb', line 103

def hash
  [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
end