Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,50 @@ module Line
# @see {{ model.model.externalDocumentation.url }}
{% endif -%}
class {{ model.model.classname }}{% if model.model.parent != null %} < {{ model.model.parent }}{% endif %}
{%- for property in model.model.vars %}
{% if model.model.vendorExtensions.get("x-selector").propertyName != property.name %}attr_accessor{% else %}attr_reader{% endif %} :{{ property.name }}{% if property.description != null %} # {{ property.description }}{% endif %}
{%- for variable in model.model.vars %}
# @!attribute [{% if model.model.vendorExtensions.get("x-selector").propertyName != variable.name %}rw{% else %}r{% endif %}] {{ variable.name }}
{% if variable.openApiType == 'array' -%}
{% if variable.items.isModel -%}
# @return [{{ "Array[#{variable.items.openApiType}]" }}{% if not variable.required %},nil{% endif -%}] {{ variable.description }}
{% elseif variable.items.allowableValues != null -%}
# @return [Array[{% for value in variable.items.allowableValues.values %}'{{ value }}'{{ loop.last ? '' : '|' }}{% endfor -%}]] {{ variable.description }}
{% else -%}
# @return [{{ variable.items.openApiType ? "Array[#{typeMapping[variable.items.openApiType]}]" : 'Array[untyped]' }}{% if not variable.required %},nil{% endif -%}] {{ variable.description }}
{% endif -%}
{% elseif variable.isModel -%}
# @return [{{ variable.openApiType }}{% if not variable.required %},nil{% endif -%}] {{ variable.description }}
{% else -%}
{% if variable.allowableValues != null -%}
# @return [String{% if not variable.required %},nil{% endif -%}] ({% for value in variable.allowableValues.values %}'{{ value }}'{{ loop.last ? '' : '|' }}{% endfor %}) {{ variable.description }}
{% else -%}
# @return [{{ typeMapping[variable.openApiType] ? typeMapping[variable.openApiType] : 'untyped' }}{% if not variable.required %},nil{% endif -%}] {{ variable.description }}
{% endif -%}
{% endif -%}
{% if model.model.vendorExtensions.get("x-selector").propertyName != variable.name %}attr_accessor{% else %}attr_reader{% endif %} :{{ variable.name }}
{%- endfor %}

{# @param #}
{%- for variable in model.model.vars -%}
{% if model.model.vendorExtensions.get("x-selector").propertyName != variable.name -%}
{% if variable.openApiType == 'array' -%}
{% if variable.items.isModel -%}
# @param {{ variable.name }} [{{ "Array[#{variable.items.openApiType}]" }}{% if not variable.required %},nil{% endif -%}] {{ variable.description }}
{% elseif variable.items.allowableValues != null -%}
# @param {{ variable.name }} [Array[{% for value in variable.items.allowableValues.values %}'{{ value }}'{{ loop.last ? '' : '|' }}{% endfor -%}]{% if not variable.required %},nil{% endif -%}] {{ variable.description }}
{% else -%}
# @param {{ variable.name }} [{{ variable.items.openApiType ? "Array[#{typeMapping[variable.items.openApiType]}]" : 'Array[untyped]' }}{% if not variable.required %},nil{% endif -%}] {{ variable.description }}
{% endif -%}
{% elseif variable.isModel -%}
# @param {{ variable.name }} [{{ variable.openApiType }}{% if not variable.required %},nil{% endif -%}] {{ variable.description }}
{% else -%}
{% if variable.allowableValues != null -%}
# @param {{ variable.name }} [String{% if not variable.required %},nil{% endif -%}] ({% for value in variable.allowableValues.values %}'{{ value }}'{{ loop.last ? '' : '|' }}{% endfor %}) {{ variable.description }}
{% else -%}
# @param {{ variable.name }} [{{ typeMapping[variable.openApiType] ? typeMapping[variable.openApiType] : 'untyped' }}{% if not variable.required %},nil{% endif -%}] {{ variable.description }}
{% endif -%}
{% endif -%}
{% endif -%}
{% endfor -%}
def initialize({% for property in model.model.vars %}{% if model.model.vendorExtensions.get("x-selector").propertyName != property.name %}
{{ property.name }}:{% if property.defaultValue == null %}{{ property.required ? '' : ' nil' }}{% else %}{{ ' ' + property.defaultValue }}{% endif %},{% endif %}{% endfor %}
**dynamic_attributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ module ChannelAccessToken
# Channel access token key IDs
# @see https://developers.line.biz/en/reference/messaging-api/#get-all-valid-channel-access-token-key-ids-v2-1
class ChannelAccessTokenKeyIdsResponse
attr_accessor :kids # Array of channel access token key IDs.
# @!attribute [rw] kids
# @return [Array[String]] Array of channel access token key IDs.
attr_accessor :kids

# @param kids [Array[String]] Array of channel access token key IDs.
def initialize(
kids:,
**dynamic_attributes
Expand Down
10 changes: 8 additions & 2 deletions lib/line/bot/v2/channel_access_token/model/error_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ module V2
module ChannelAccessToken
# Error response of the Channel access token
class ErrorResponse
attr_accessor :error # Error summary
attr_accessor :error_description # Details of the error. Not returned in certain situations.
# @!attribute [rw] error
# @return [String,nil] Error summary
attr_accessor :error
# @!attribute [rw] error_description
# @return [String,nil] Details of the error. Not returned in certain situations.
attr_accessor :error_description

# @param error [String,nil] Error summary
# @param error_description [String,nil] Details of the error. Not returned in certain situations.
def initialize(
error: nil,
error_description: nil,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,23 @@ module ChannelAccessToken
# Issued channel access token
# @see https://developers.line.biz/en/reference/messaging-api/#issue-channel-access-token-v2-1
class IssueChannelAccessTokenResponse
attr_accessor :access_token # Channel access token.
attr_accessor :expires_in # Amount of time in seconds from issue to expiration of the channel access token
attr_accessor :token_type # A token type.
attr_accessor :key_id # Unique key ID for identifying the channel access token.
# @!attribute [rw] access_token
# @return [String] Channel access token.
attr_accessor :access_token
# @!attribute [rw] expires_in
# @return [Integer] Amount of time in seconds from issue to expiration of the channel access token
attr_accessor :expires_in
# @!attribute [rw] token_type
# @return [String] A token type.
attr_accessor :token_type
# @!attribute [rw] key_id
# @return [String] Unique key ID for identifying the channel access token.
attr_accessor :key_id

# @param access_token [String] Channel access token.
# @param expires_in [Integer] Amount of time in seconds from issue to expiration of the channel access token
# @param token_type [String] A token type.
# @param key_id [String] Unique key ID for identifying the channel access token.
def initialize(
access_token:,
expires_in:,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,19 @@ module ChannelAccessToken
# Issued short-lived channel access token
# @see https://developers.line.biz/en/reference/messaging-api/#issue-shortlived-channel-access-token
class IssueShortLivedChannelAccessTokenResponse
attr_accessor :access_token # A short-lived channel access token. Valid for 30 days. Note: Channel access tokens cannot be refreshed.
attr_accessor :expires_in # Time until channel access token expires in seconds from time the token is issued.
attr_accessor :token_type # Token type. The value is always `Bearer`.
# @!attribute [rw] access_token
# @return [String] A short-lived channel access token. Valid for 30 days. Note: Channel access tokens cannot be refreshed.
attr_accessor :access_token
# @!attribute [rw] expires_in
# @return [Integer] Time until channel access token expires in seconds from time the token is issued.
attr_accessor :expires_in
# @!attribute [rw] token_type
# @return [String] Token type. The value is always `Bearer`.
attr_accessor :token_type

# @param access_token [String] A short-lived channel access token. Valid for 30 days. Note: Channel access tokens cannot be refreshed.
# @param expires_in [Integer] Time until channel access token expires in seconds from time the token is issued.
# @param token_type [String] Token type. The value is always `Bearer`.
def initialize(
access_token:,
expires_in:,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,19 @@ module ChannelAccessToken
# Issued stateless channel access token
# @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token
class IssueStatelessChannelAccessTokenResponse
attr_accessor :access_token # A stateless channel access token. The token is an opaque string which means its format is an implementation detail and the consumer of this token should never try to use the data parsed from the token.
attr_accessor :expires_in # Duration in seconds after which the issued access token expires
attr_accessor :token_type # Token type. The value is always `Bearer`.
# @!attribute [rw] access_token
# @return [String] A stateless channel access token. The token is an opaque string which means its format is an implementation detail and the consumer of this token should never try to use the data parsed from the token.
attr_accessor :access_token
# @!attribute [rw] expires_in
# @return [Integer] Duration in seconds after which the issued access token expires
attr_accessor :expires_in
# @!attribute [rw] token_type
# @return [String] Token type. The value is always `Bearer`.
attr_accessor :token_type

# @param access_token [String] A stateless channel access token. The token is an opaque string which means its format is an implementation detail and the consumer of this token should never try to use the data parsed from the token.
# @param expires_in [Integer] Duration in seconds after which the issued access token expires
# @param token_type [String] Token type. The value is always `Bearer`.
def initialize(
access_token:,
expires_in:,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@ module V2
module ChannelAccessToken
# Verification result
class VerifyChannelAccessTokenResponse
attr_accessor :client_id # The channel ID for which the channel access token was issued.
attr_accessor :expires_in # Number of seconds before the channel access token expires.
attr_accessor :scope # Permissions granted to the channel access token.
# @!attribute [rw] client_id
# @return [String] The channel ID for which the channel access token was issued.
attr_accessor :client_id
# @!attribute [rw] expires_in
# @return [Integer] Number of seconds before the channel access token expires.
attr_accessor :expires_in
# @!attribute [rw] scope
# @return [String,nil] Permissions granted to the channel access token.
attr_accessor :scope

# @param client_id [String] The channel ID for which the channel access token was issued.
# @param expires_in [Integer] Number of seconds before the channel access token expires.
# @param scope [String,nil] Permissions granted to the channel access token.
def initialize(
client_id:,
expires_in:,
Expand Down
10 changes: 8 additions & 2 deletions lib/line/bot/v2/insight/model/age_tile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ module Bot
module V2
module Insight
class AgeTile
attr_accessor :age # users' age
attr_accessor :percentage # Percentage
# @!attribute [rw] age
# @return [String,nil] ('from0to14'|'from15to19'|'from20to24'|'from25to29'|'from30to34'|'from35to39'|'from40to44'|'from45to49'|'from50'|'from50to54'|'from55to59'|'from60to64'|'from65to69'|'from70'|'unknown') users' age
attr_accessor :age
# @!attribute [rw] percentage
# @return [Float,nil] Percentage
attr_accessor :percentage

# @param age [String,nil] ('from0to14'|'from15to19'|'from20to24'|'from25to29'|'from30to34'|'from35to39'|'from40to44'|'from45to49'|'from50'|'from50to54'|'from55to59'|'from60to64'|'from65to69'|'from70'|'unknown') users' age
# @param percentage [Float,nil] Percentage
def initialize(
age: nil,
percentage: nil,
Expand Down
10 changes: 8 additions & 2 deletions lib/line/bot/v2/insight/model/app_type_tile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ module Bot
module V2
module Insight
class AppTypeTile
attr_accessor :app_type # users' OS
attr_accessor :percentage # Percentage
# @!attribute [rw] app_type
# @return [String,nil] ('ios'|'android'|'others') users' OS
attr_accessor :app_type
# @!attribute [rw] percentage
# @return [Float,nil] Percentage
attr_accessor :percentage

# @param app_type [String,nil] ('ios'|'android'|'others') users' OS
# @param percentage [Float,nil] Percentage
def initialize(
app_type: nil,
percentage: nil,
Expand Down
10 changes: 8 additions & 2 deletions lib/line/bot/v2/insight/model/area_tile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ module Bot
module V2
module Insight
class AreaTile
attr_accessor :area # users' country and region
attr_accessor :percentage # Percentage
# @!attribute [rw] area
# @return [String,nil] users' country and region
attr_accessor :area
# @!attribute [rw] percentage
# @return [Float,nil] Percentage
attr_accessor :percentage

# @param area [String,nil] users' country and region
# @param percentage [Float,nil] Percentage
def initialize(
area: nil,
percentage: nil,
Expand Down
10 changes: 8 additions & 2 deletions lib/line/bot/v2/insight/model/error_detail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ module Bot
module V2
module Insight
class ErrorDetail
attr_accessor :message # Details of the error. Not included in the response under certain situations.
attr_accessor :property # Location of where the error occurred. Returns the JSON field name or query parameter name of the request. Not included in the response under certain situations.
# @!attribute [rw] message
# @return [String,nil] Details of the error. Not included in the response under certain situations.
attr_accessor :message
# @!attribute [rw] property
# @return [String,nil] Location of where the error occurred. Returns the JSON field name or query parameter name of the request. Not included in the response under certain situations.
attr_accessor :property

# @param message [String,nil] Details of the error. Not included in the response under certain situations.
# @param property [String,nil] Location of where the error occurred. Returns the JSON field name or query parameter name of the request. Not included in the response under certain situations.
def initialize(
message: nil,
property: nil,
Expand Down
10 changes: 8 additions & 2 deletions lib/line/bot/v2/insight/model/error_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ module V2
module Insight
# @see https://developers.line.biz/en/reference/messaging-api/#error-responses
class ErrorResponse
attr_accessor :message # Message containing information about the error.
attr_accessor :details # An array of error details. If the array is empty, this property will not be included in the response.
# @!attribute [rw] message
# @return [String] Message containing information about the error.
attr_accessor :message
# @!attribute [rw] details
# @return [Array[ErrorDetail],nil] An array of error details. If the array is empty, this property will not be included in the response.
attr_accessor :details

# @param message [String] Message containing information about the error.
# @param details [Array[ErrorDetail],nil] An array of error details. If the array is empty, this property will not be included in the response.
def initialize(
message:,
details: nil,
Expand Down
10 changes: 8 additions & 2 deletions lib/line/bot/v2/insight/model/gender_tile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ module Bot
module V2
module Insight
class GenderTile
attr_accessor :gender # users' gender
attr_accessor :percentage # Percentage
# @!attribute [rw] gender
# @return [String,nil] ('male'|'female'|'unknown') users' gender
attr_accessor :gender
# @!attribute [rw] percentage
# @return [Float,nil] Percentage
attr_accessor :percentage

# @param gender [String,nil] ('male'|'female'|'unknown') users' gender
# @param percentage [Float,nil] Percentage
def initialize(
gender: nil,
percentage: nil,
Expand Down
30 changes: 24 additions & 6 deletions lib/line/bot/v2/insight/model/get_friends_demographics_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,31 @@ module Insight
# Get friend demographics
# @see https://developers.line.biz/en/reference/messaging-api/#get-demographic
class GetFriendsDemographicsResponse
attr_accessor :available # true if friend demographic information is available.
attr_accessor :genders # Percentage per gender.
attr_accessor :ages # Percentage per age group.
attr_accessor :areas # Percentage per area.
attr_accessor :app_types # Percentage by OS.
attr_accessor :subscription_periods # Percentage per friendship duration.
# @!attribute [rw] available
# @return [Boolean,nil] true if friend demographic information is available.
attr_accessor :available
# @!attribute [rw] genders
# @return [Array[GenderTile],nil] Percentage per gender.
attr_accessor :genders
# @!attribute [rw] ages
# @return [Array[AgeTile],nil] Percentage per age group.
attr_accessor :ages
# @!attribute [rw] areas
# @return [Array[AreaTile],nil] Percentage per area.
attr_accessor :areas
# @!attribute [rw] app_types
# @return [Array[AppTypeTile],nil] Percentage by OS.
attr_accessor :app_types
# @!attribute [rw] subscription_periods
# @return [Array[SubscriptionPeriodTile],nil] Percentage per friendship duration.
attr_accessor :subscription_periods

# @param available [Boolean,nil] true if friend demographic information is available.
# @param genders [Array[GenderTile],nil] Percentage per gender.
# @param ages [Array[AgeTile],nil] Percentage per age group.
# @param areas [Array[AreaTile],nil] Percentage per area.
# @param app_types [Array[AppTypeTile],nil] Percentage by OS.
# @param subscription_periods [Array[SubscriptionPeriodTile],nil] Percentage per friendship duration.
def initialize(
available: nil,
genders: nil,
Expand Down
Loading