Skip to content

Commit 805c78d

Browse files
committed
Run generate-code.py
1 parent 6621f72 commit 805c78d

560 files changed

Lines changed: 5124 additions & 568 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/line/bot/v2/channel_access_token/model/channel_access_token_key_ids_response.rb

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,30 @@ def initialize(
2121
**dynamic_attributes
2222
)
2323

24-
@kids = kids
24+
@kids = kids.map do |item|
25+
if item.is_a?(Hash)
26+
Line::Bot::V2::ChannelAccessToken::string.create(**item)
27+
else
28+
item
29+
end
30+
end
2531

2632
dynamic_attributes.each do |key, value|
2733
self.class.attr_accessor key
28-
instance_variable_set("@#{key}", value)
34+
35+
if value.is_a?(Hash)
36+
struct_klass = Struct.new(*value.keys.map(&:to_sym))
37+
struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
38+
instance_variable_set("@#{key}", struct_klass.new(*struct_values))
39+
else
40+
instance_variable_set("@#{key}", value)
41+
end
2942
end
3043
end
44+
45+
def self.create(args)
46+
return new(**args)
47+
end
3148
end
3249
end
3350
end

lib/line/bot/v2/channel_access_token/model/error_response.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,20 @@ def initialize(
2727

2828
dynamic_attributes.each do |key, value|
2929
self.class.attr_accessor key
30-
instance_variable_set("@#{key}", value)
30+
31+
if value.is_a?(Hash)
32+
struct_klass = Struct.new(*value.keys.map(&:to_sym))
33+
struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
34+
instance_variable_set("@#{key}", struct_klass.new(*struct_values))
35+
else
36+
instance_variable_set("@#{key}", value)
37+
end
3138
end
3239
end
40+
41+
def self.create(args)
42+
return new(**args)
43+
end
3344
end
3445
end
3546
end

lib/line/bot/v2/channel_access_token/model/issue_channel_access_token_response.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,20 @@ def initialize(
3434

3535
dynamic_attributes.each do |key, value|
3636
self.class.attr_accessor key
37-
instance_variable_set("@#{key}", value)
37+
38+
if value.is_a?(Hash)
39+
struct_klass = Struct.new(*value.keys.map(&:to_sym))
40+
struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
41+
instance_variable_set("@#{key}", struct_klass.new(*struct_values))
42+
else
43+
instance_variable_set("@#{key}", value)
44+
end
3845
end
3946
end
47+
48+
def self.create(args)
49+
return new(**args)
50+
end
4051
end
4152
end
4253
end

lib/line/bot/v2/channel_access_token/model/issue_short_lived_channel_access_token_response.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,20 @@ def initialize(
3131

3232
dynamic_attributes.each do |key, value|
3333
self.class.attr_accessor key
34-
instance_variable_set("@#{key}", value)
34+
35+
if value.is_a?(Hash)
36+
struct_klass = Struct.new(*value.keys.map(&:to_sym))
37+
struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
38+
instance_variable_set("@#{key}", struct_klass.new(*struct_values))
39+
else
40+
instance_variable_set("@#{key}", value)
41+
end
3542
end
3643
end
44+
45+
def self.create(args)
46+
return new(**args)
47+
end
3748
end
3849
end
3950
end

lib/line/bot/v2/channel_access_token/model/issue_stateless_channel_access_token_response.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,20 @@ def initialize(
3131

3232
dynamic_attributes.each do |key, value|
3333
self.class.attr_accessor key
34-
instance_variable_set("@#{key}", value)
34+
35+
if value.is_a?(Hash)
36+
struct_klass = Struct.new(*value.keys.map(&:to_sym))
37+
struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
38+
instance_variable_set("@#{key}", struct_klass.new(*struct_values))
39+
else
40+
instance_variable_set("@#{key}", value)
41+
end
3542
end
3643
end
44+
45+
def self.create(args)
46+
return new(**args)
47+
end
3748
end
3849
end
3950
end

lib/line/bot/v2/channel_access_token/model/verify_channel_access_token_response.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,20 @@ def initialize(
3030

3131
dynamic_attributes.each do |key, value|
3232
self.class.attr_accessor key
33-
instance_variable_set("@#{key}", value)
33+
34+
if value.is_a?(Hash)
35+
struct_klass = Struct.new(*value.keys.map(&:to_sym))
36+
struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
37+
instance_variable_set("@#{key}", struct_klass.new(*struct_values))
38+
else
39+
instance_variable_set("@#{key}", value)
40+
end
3441
end
3542
end
43+
44+
def self.create(args)
45+
return new(**args)
46+
end
3647
end
3748
end
3849
end

lib/line/bot/v2/insight/model/age_tile.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,20 @@ def initialize(
2626

2727
dynamic_attributes.each do |key, value|
2828
self.class.attr_accessor key
29-
instance_variable_set("@#{key}", value)
29+
30+
if value.is_a?(Hash)
31+
struct_klass = Struct.new(*value.keys.map(&:to_sym))
32+
struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
33+
instance_variable_set("@#{key}", struct_klass.new(*struct_values))
34+
else
35+
instance_variable_set("@#{key}", value)
36+
end
3037
end
3138
end
39+
40+
def self.create(args)
41+
return new(**args)
42+
end
3243
end
3344
end
3445
end

lib/line/bot/v2/insight/model/app_type_tile.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,20 @@ def initialize(
2626

2727
dynamic_attributes.each do |key, value|
2828
self.class.attr_accessor key
29-
instance_variable_set("@#{key}", value)
29+
30+
if value.is_a?(Hash)
31+
struct_klass = Struct.new(*value.keys.map(&:to_sym))
32+
struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
33+
instance_variable_set("@#{key}", struct_klass.new(*struct_values))
34+
else
35+
instance_variable_set("@#{key}", value)
36+
end
3037
end
3138
end
39+
40+
def self.create(args)
41+
return new(**args)
42+
end
3243
end
3344
end
3445
end

lib/line/bot/v2/insight/model/area_tile.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,20 @@ def initialize(
2626

2727
dynamic_attributes.each do |key, value|
2828
self.class.attr_accessor key
29-
instance_variable_set("@#{key}", value)
29+
30+
if value.is_a?(Hash)
31+
struct_klass = Struct.new(*value.keys.map(&:to_sym))
32+
struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
33+
instance_variable_set("@#{key}", struct_klass.new(*struct_values))
34+
else
35+
instance_variable_set("@#{key}", value)
36+
end
3037
end
3138
end
39+
40+
def self.create(args)
41+
return new(**args)
42+
end
3243
end
3344
end
3445
end

lib/line/bot/v2/insight/model/error_detail.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,20 @@ def initialize(
2626

2727
dynamic_attributes.each do |key, value|
2828
self.class.attr_accessor key
29-
instance_variable_set("@#{key}", value)
29+
30+
if value.is_a?(Hash)
31+
struct_klass = Struct.new(*value.keys.map(&:to_sym))
32+
struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
33+
instance_variable_set("@#{key}", struct_klass.new(*struct_values))
34+
else
35+
instance_variable_set("@#{key}", value)
36+
end
3037
end
3138
end
39+
40+
def self.create(args)
41+
return new(**args)
42+
end
3243
end
3344
end
3445
end

0 commit comments

Comments
 (0)