Skip to content

Commit

Permalink
constrains fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
seorgiy committed Nov 17, 2024
1 parent 693813b commit 458ffae
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Telegram
module Bot
module Types
class BackgroundFillFreeformGradient < Base
attribute :type, Types::String.default('freeform_gradient')
attribute :type, Types::String.constrained(eql: 'freeform_gradient').default('freeform_gradient')
attribute :colors, Types::Array.of(Types::Integer)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/telegram/bot/types/background_fill_gradient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Telegram
module Bot
module Types
class BackgroundFillGradient < Base
attribute :type, Types::String.default('gradient')
attribute :type, Types::String.constrained(eql: 'gradient').default('gradient')
attribute :top_color, Types::Integer
attribute :bottom_color, Types::Integer
attribute :rotation_angle, Types::Integer
Expand Down
2 changes: 1 addition & 1 deletion lib/telegram/bot/types/background_fill_solid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Telegram
module Bot
module Types
class BackgroundFillSolid < Base
attribute :type, Types::String.default('solid')
attribute :type, Types::String.constrained(eql: 'solid').default('solid')
attribute :color, Types::Integer
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/telegram/bot/types/background_type_chat_theme.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Telegram
module Bot
module Types
class BackgroundTypeChatTheme < Base
attribute :type, Types::String.default('chat_theme')
attribute :type, Types::String.constrained(eql: 'chat_theme').default('chat_theme')
attribute :theme_name, Types::String
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/telegram/bot/types/background_type_fill.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Telegram
module Bot
module Types
class BackgroundTypeFill < Base
attribute :type, Types::String.default('fill')
attribute :type, Types::String.constrained(eql: 'fill').default('fill')
attribute :fill, BackgroundFill
attribute :dark_theme_dimming, Types::Integer
end
Expand Down
2 changes: 1 addition & 1 deletion lib/telegram/bot/types/background_type_pattern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Telegram
module Bot
module Types
class BackgroundTypePattern < Base
attribute :type, Types::String.default('pattern')
attribute :type, Types::String.constrained(eql: 'pattern').default('pattern')
attribute :document, Document
attribute :fill, BackgroundFill
attribute :intensity, Types::Integer
Expand Down
2 changes: 1 addition & 1 deletion lib/telegram/bot/types/background_type_wallpaper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Telegram
module Bot
module Types
class BackgroundTypeWallpaper < Base
attribute :type, Types::String.default('wallpaper')
attribute :type, Types::String.constrained(eql: 'wallpaper').default('wallpaper')
attribute :document, Document
attribute :dark_theme_dimming, Types::Integer
attribute? :is_blurred, Types::True
Expand Down
2 changes: 1 addition & 1 deletion lib/telegram/bot/types/input_paid_media_photo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Telegram
module Bot
module Types
class InputPaidMediaPhoto < Base
attribute :type, Types::String.default('photo')
attribute :type, Types::String.constrained(eql: 'photo').default('photo')
attribute :media, Types::String
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/telegram/bot/types/input_paid_media_video.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Telegram
module Bot
module Types
class InputPaidMediaVideo < Base
attribute :type, Types::String.default('video')
attribute :type, Types::String.constrained(eql: 'video').default('video')
attribute :media, Types::String
attribute? :thumbnail, Types::String
attribute? :width, Types::Integer
Expand Down
2 changes: 1 addition & 1 deletion lib/telegram/bot/types/paid_media_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Telegram
module Bot
module Types
class PaidMediaPreview < Base
attribute :type, Types::String.default('preview')
attribute :type, Types::String.constrained(eql: 'preview').default('preview')
attribute? :width, Types::Integer
attribute? :height, Types::Integer
attribute? :duration, Types::Integer
Expand Down
2 changes: 1 addition & 1 deletion lib/telegram/bot/types/paid_media_video.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Telegram
module Bot
module Types
class PaidMediaVideo < Base
attribute :type, Types::String.default('video')
attribute :type, Types::String.constrained(eql: 'video').default('video')
attribute :video, Video
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/telegram/bot/types/refunded_payment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Telegram
module Bot
module Types
class RefundedPayment < Base
attribute :currency, Types::String.default('XTR')
attribute :currency, Types::String.constrained(eql: 'XTR').default('XTR')
attribute :total_amount, Types::Integer
attribute :invoice_payload, Types::String
attribute :telegram_payment_charge_id, Types::String
Expand Down
2 changes: 1 addition & 1 deletion lib/telegram/bot/types/transaction_partner_fragment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Telegram
module Bot
module Types
class TransactionPartnerFragment < Base
attribute :type, Types::String.default('fragment')
attribute :type, Types::String.constrained(eql: 'fragment').default('fragment')
attribute? :withdrawal_state, RevenueWithdrawalState
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/telegram/bot/types/transaction_partner_other.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Telegram
module Bot
module Types
class TransactionPartnerOther < Base
attribute :type, Types::String.default('other')
attribute :type, Types::String.constrained(eql: 'other').default('other')
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/telegram/bot/types/transaction_partner_telegram_ads.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Telegram
module Bot
module Types
class TransactionPartnerTelegramAds < Base
attribute :type, Types::String.default('telegram_ads')
attribute :type, Types::String.constrained(eql: 'telegram_ads').default('telegram_ads')
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/telegram/bot/types/transaction_partner_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Telegram
module Bot
module Types
class TransactionPartnerUser < Base
attribute :type, Types::String.default('user')
attribute :type, Types::String.constrained(eql: 'user').default('user')
attribute :user, User
attribute? :invoice_payload, Types::String
attribute? :paid_media, Types::Array
Expand Down

0 comments on commit 458ffae

Please sign in to comment.