Class: Dodopayments::Models::Product::Entitlement
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Dodopayments::Models::Product::Entitlement
- Defined in:
- lib/dodopayments/models/product.rb
Defined Under Namespace
Modules: IntegrationConfig, IntegrationType
Instance Attribute Summary collapse
- #description ⇒ String?
- #id ⇒ String
-
#integration_config ⇒ Dodopayments::Models::Product::Entitlement::IntegrationConfig::GitHubConfig, ...
Platform-specific configuration for an entitlement.
- #integration_type ⇒ Symbol, Dodopayments::Models::Product::Entitlement::IntegrationType
- #name ⇒ String
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Internal::Type::BaseModel
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(activation_message: nil, activations_limit: nil, duration_count: nil, duration_interval: nil) ⇒ Object
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 |
# File 'lib/dodopayments/models/product.rb', line 181 class Entitlement < Dodopayments::Internal::Type::BaseModel # @!attribute id # # @return [String] required :id, String # @!attribute integration_config # Platform-specific configuration for an entitlement. Each variant uses unique # field names so `#[serde(untagged)]` can disambiguate correctly. # # @return [Dodopayments::Models::Product::Entitlement::IntegrationConfig::GitHubConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DiscordConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::TelegramConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FigmaConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FramerConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::NotionConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DigitalFilesConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::LicenseKeyConfig] required :integration_config, union: -> { Dodopayments::Product::Entitlement::IntegrationConfig } # @!attribute integration_type # # @return [Symbol, Dodopayments::Models::Product::Entitlement::IntegrationType] required :integration_type, enum: -> { Dodopayments::Product::Entitlement::IntegrationType } # @!attribute name # # @return [String] required :name, String # @!attribute description # # @return [String, nil] optional :description, String, nil?: true # @!method initialize(id:, integration_config:, integration_type:, name:, description: nil) # Some parameter documentations has been truncated, see # {Dodopayments::Models::Product::Entitlement} for more details. # # Summary of an entitlement attached to a product # # @param id [String] # # @param integration_config [Dodopayments::Models::Product::Entitlement::IntegrationConfig::GitHubConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DiscordConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::TelegramConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FigmaConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FramerConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::NotionConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DigitalFilesConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::LicenseKeyConfig] Platform-specific configuration for an entitlement. # # @param integration_type [Symbol, Dodopayments::Models::Product::Entitlement::IntegrationType] # # @param name [String] # # @param description [String, nil] # Platform-specific configuration for an entitlement. Each variant uses unique # field names so `#[serde(untagged)]` can disambiguate correctly. # # @see Dodopayments::Models::Product::Entitlement#integration_config module IntegrationConfig extend Dodopayments::Internal::Type::Union variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::GitHubConfig } variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::DiscordConfig } variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::TelegramConfig } variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::FigmaConfig } variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::FramerConfig } variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::NotionConfig } variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::DigitalFilesConfig } variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::LicenseKeyConfig } class GitHubConfig < Dodopayments::Internal::Type::BaseModel # @!attribute permission # One of: pull, push, admin, maintain, triage # # @return [String] required :permission, String # @!attribute target_id # # @return [String] required :target_id, String # @!method initialize(permission:, target_id:) # @param permission [String] One of: pull, push, admin, maintain, triage # # @param target_id [String] end class DiscordConfig < Dodopayments::Internal::Type::BaseModel # @!attribute guild_id # # @return [String] required :guild_id, String # @!attribute role_id # # @return [String, nil] optional :role_id, String, nil?: true # @!method initialize(guild_id:, role_id: nil) # @param guild_id [String] # @param role_id [String, nil] end class TelegramConfig < Dodopayments::Internal::Type::BaseModel # @!attribute chat_id # # @return [String] required :chat_id, String # @!method initialize(chat_id:) # @param chat_id [String] end class FigmaConfig < Dodopayments::Internal::Type::BaseModel # @!attribute figma_file_id # # @return [String] required :figma_file_id, String # @!method initialize(figma_file_id:) # @param figma_file_id [String] end class FramerConfig < Dodopayments::Internal::Type::BaseModel # @!attribute framer_template_id # # @return [String] required :framer_template_id, String # @!method initialize(framer_template_id:) # @param framer_template_id [String] end class NotionConfig < Dodopayments::Internal::Type::BaseModel # @!attribute notion_template_id # # @return [String] required :notion_template_id, String # @!method initialize(notion_template_id:) # @param notion_template_id [String] end class DigitalFilesConfig < Dodopayments::Internal::Type::BaseModel # @!attribute digital_file_ids # # @return [Array<String>] required :digital_file_ids, Dodopayments::Internal::Type::ArrayOf[String] # @!attribute external_url # # @return [String, nil] optional :external_url, String, nil?: true # @!attribute instructions # # @return [String, nil] optional :instructions, String, nil?: true # @!method initialize(digital_file_ids:, external_url: nil, instructions: nil) # @param digital_file_ids [Array<String>] # @param external_url [String, nil] # @param instructions [String, nil] end class LicenseKeyConfig < Dodopayments::Internal::Type::BaseModel # @!attribute activation_message # # @return [String, nil] optional :activation_message, String, nil?: true # @!attribute activations_limit # # @return [Integer, nil] optional :activations_limit, Integer, nil?: true # @!attribute duration_count # # @return [Integer, nil] optional :duration_count, Integer, nil?: true # @!attribute duration_interval # # @return [String, nil] optional :duration_interval, String, nil?: true # @!method initialize(activation_message: nil, activations_limit: nil, duration_count: nil, duration_interval: nil) # @param activation_message [String, nil] # @param activations_limit [Integer, nil] # @param duration_count [Integer, nil] # @param duration_interval [String, nil] end # @!method self.variants # @return [Array(Dodopayments::Models::Product::Entitlement::IntegrationConfig::GitHubConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DiscordConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::TelegramConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FigmaConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FramerConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::NotionConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DigitalFilesConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::LicenseKeyConfig)] end # @see Dodopayments::Models::Product::Entitlement#integration_type module IntegrationType extend Dodopayments::Internal::Type::Enum DISCORD = :discord TELEGRAM = :telegram GITHUB = :github FIGMA = :figma FRAMER = :framer NOTION = :notion DIGITAL_FILES = :digital_files LICENSE_KEY = :license_key # @!method self.values # @return [Array<Symbol>] end end |
Instance Attribute Details
#description ⇒ String?
207 |
# File 'lib/dodopayments/models/product.rb', line 207 optional :description, String, nil?: true |
#id ⇒ String
185 |
# File 'lib/dodopayments/models/product.rb', line 185 required :id, String |
#integration_config ⇒ Dodopayments::Models::Product::Entitlement::IntegrationConfig::GitHubConfig, ...
Platform-specific configuration for an entitlement. Each variant uses unique field names so ‘#[serde(untagged)]` can disambiguate correctly.
192 |
# File 'lib/dodopayments/models/product.rb', line 192 required :integration_config, union: -> { Dodopayments::Product::Entitlement::IntegrationConfig } |
#integration_type ⇒ Symbol, Dodopayments::Models::Product::Entitlement::IntegrationType
197 |
# File 'lib/dodopayments/models/product.rb', line 197 required :integration_type, enum: -> { Dodopayments::Product::Entitlement::IntegrationType } |
#name ⇒ String
202 |
# File 'lib/dodopayments/models/product.rb', line 202 required :name, String |
Class Method Details
.variants ⇒ Array(Dodopayments::Models::Product::Entitlement::IntegrationConfig::GitHubConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DiscordConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::TelegramConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FigmaConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FramerConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::NotionConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DigitalFilesConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::LicenseKeyConfig)
|
|
# File 'lib/dodopayments/models/product.rb', line 372
|