|
| 1 | +# frozen_string_literal: true |
| 2 | + |
| 3 | +module BrandDev |
| 4 | + module Models |
| 5 | + # @see BrandDev::Resources::Brand#ai_product |
| 6 | + class BrandAIProductResponse < BrandDev::Internal::Type::BaseModel |
| 7 | + # @!attribute is_product_page |
| 8 | + # Whether the given URL is a product detail page |
| 9 | + # |
| 10 | + # @return [Boolean, nil] |
| 11 | + optional :is_product_page, BrandDev::Internal::Type::Boolean |
| 12 | + |
| 13 | + # @!attribute platform |
| 14 | + # The detected ecommerce platform, or null if not a product page |
| 15 | + # |
| 16 | + # @return [Symbol, BrandDev::Models::BrandAIProductResponse::Platform, nil] |
| 17 | + optional :platform, enum: -> { BrandDev::Models::BrandAIProductResponse::Platform }, nil?: true |
| 18 | + |
| 19 | + # @!attribute product |
| 20 | + # The extracted product data, or null if not a product page |
| 21 | + # |
| 22 | + # @return [BrandDev::Models::BrandAIProductResponse::Product, nil] |
| 23 | + optional :product, -> { BrandDev::Models::BrandAIProductResponse::Product }, nil?: true |
| 24 | + |
| 25 | + # @!method initialize(is_product_page: nil, platform: nil, product: nil) |
| 26 | + # @param is_product_page [Boolean] Whether the given URL is a product detail page |
| 27 | + # |
| 28 | + # @param platform [Symbol, BrandDev::Models::BrandAIProductResponse::Platform, nil] The detected ecommerce platform, or null if not a product page |
| 29 | + # |
| 30 | + # @param product [BrandDev::Models::BrandAIProductResponse::Product, nil] The extracted product data, or null if not a product page |
| 31 | + |
| 32 | + # The detected ecommerce platform, or null if not a product page |
| 33 | + # |
| 34 | + # @see BrandDev::Models::BrandAIProductResponse#platform |
| 35 | + module Platform |
| 36 | + extend BrandDev::Internal::Type::Enum |
| 37 | + |
| 38 | + AMAZON = :amazon |
| 39 | + TIKTOK_SHOP = :tiktok_shop |
| 40 | + ETSY = :etsy |
| 41 | + GENERIC = :generic |
| 42 | + |
| 43 | + # @!method self.values |
| 44 | + # @return [Array<Symbol>] |
| 45 | + end |
| 46 | + |
| 47 | + # @see BrandDev::Models::BrandAIProductResponse#product |
| 48 | + class Product < BrandDev::Internal::Type::BaseModel |
| 49 | + # @!attribute description |
| 50 | + # Description of the product |
| 51 | + # |
| 52 | + # @return [String] |
| 53 | + required :description, String |
| 54 | + |
| 55 | + # @!attribute features |
| 56 | + # List of product features |
| 57 | + # |
| 58 | + # @return [Array<String>] |
| 59 | + required :features, BrandDev::Internal::Type::ArrayOf[String] |
| 60 | + |
| 61 | + # @!attribute name |
| 62 | + # Name of the product |
| 63 | + # |
| 64 | + # @return [String] |
| 65 | + required :name, String |
| 66 | + |
| 67 | + # @!attribute tags |
| 68 | + # Tags associated with the product |
| 69 | + # |
| 70 | + # @return [Array<String>] |
| 71 | + required :tags, BrandDev::Internal::Type::ArrayOf[String] |
| 72 | + |
| 73 | + # @!attribute target_audience |
| 74 | + # Target audience for the product (array of strings) |
| 75 | + # |
| 76 | + # @return [Array<String>] |
| 77 | + required :target_audience, BrandDev::Internal::Type::ArrayOf[String] |
| 78 | + |
| 79 | + # @!attribute billing_frequency |
| 80 | + # Billing frequency for the product |
| 81 | + # |
| 82 | + # @return [Symbol, BrandDev::Models::BrandAIProductResponse::Product::BillingFrequency, nil] |
| 83 | + optional :billing_frequency, |
| 84 | + enum: -> { BrandDev::Models::BrandAIProductResponse::Product::BillingFrequency }, |
| 85 | + nil?: true |
| 86 | + |
| 87 | + # @!attribute category |
| 88 | + # Category of the product |
| 89 | + # |
| 90 | + # @return [String, nil] |
| 91 | + optional :category, String, nil?: true |
| 92 | + |
| 93 | + # @!attribute currency |
| 94 | + # Currency code for the price (e.g., USD, EUR) |
| 95 | + # |
| 96 | + # @return [String, nil] |
| 97 | + optional :currency, String, nil?: true |
| 98 | + |
| 99 | + # @!attribute image_url |
| 100 | + # URL to the product image |
| 101 | + # |
| 102 | + # @return [String, nil] |
| 103 | + optional :image_url, String, nil?: true |
| 104 | + |
| 105 | + # @!attribute price |
| 106 | + # Price of the product |
| 107 | + # |
| 108 | + # @return [Float, nil] |
| 109 | + optional :price, Float, nil?: true |
| 110 | + |
| 111 | + # @!attribute pricing_model |
| 112 | + # Pricing model for the product |
| 113 | + # |
| 114 | + # @return [Symbol, BrandDev::Models::BrandAIProductResponse::Product::PricingModel, nil] |
| 115 | + optional :pricing_model, |
| 116 | + enum: -> { BrandDev::Models::BrandAIProductResponse::Product::PricingModel }, |
| 117 | + nil?: true |
| 118 | + |
| 119 | + # @!attribute url |
| 120 | + # URL to the product page |
| 121 | + # |
| 122 | + # @return [String, nil] |
| 123 | + optional :url, String, nil?: true |
| 124 | + |
| 125 | + # @!method initialize(description:, features:, name:, tags:, target_audience:, billing_frequency: nil, category: nil, currency: nil, image_url: nil, price: nil, pricing_model: nil, url: nil) |
| 126 | + # The extracted product data, or null if not a product page |
| 127 | + # |
| 128 | + # @param description [String] Description of the product |
| 129 | + # |
| 130 | + # @param features [Array<String>] List of product features |
| 131 | + # |
| 132 | + # @param name [String] Name of the product |
| 133 | + # |
| 134 | + # @param tags [Array<String>] Tags associated with the product |
| 135 | + # |
| 136 | + # @param target_audience [Array<String>] Target audience for the product (array of strings) |
| 137 | + # |
| 138 | + # @param billing_frequency [Symbol, BrandDev::Models::BrandAIProductResponse::Product::BillingFrequency, nil] Billing frequency for the product |
| 139 | + # |
| 140 | + # @param category [String, nil] Category of the product |
| 141 | + # |
| 142 | + # @param currency [String, nil] Currency code for the price (e.g., USD, EUR) |
| 143 | + # |
| 144 | + # @param image_url [String, nil] URL to the product image |
| 145 | + # |
| 146 | + # @param price [Float, nil] Price of the product |
| 147 | + # |
| 148 | + # @param pricing_model [Symbol, BrandDev::Models::BrandAIProductResponse::Product::PricingModel, nil] Pricing model for the product |
| 149 | + # |
| 150 | + # @param url [String, nil] URL to the product page |
| 151 | + |
| 152 | + # Billing frequency for the product |
| 153 | + # |
| 154 | + # @see BrandDev::Models::BrandAIProductResponse::Product#billing_frequency |
| 155 | + module BillingFrequency |
| 156 | + extend BrandDev::Internal::Type::Enum |
| 157 | + |
| 158 | + MONTHLY = :monthly |
| 159 | + YEARLY = :yearly |
| 160 | + ONE_TIME = :one_time |
| 161 | + USAGE_BASED = :usage_based |
| 162 | + |
| 163 | + # @!method self.values |
| 164 | + # @return [Array<Symbol>] |
| 165 | + end |
| 166 | + |
| 167 | + # Pricing model for the product |
| 168 | + # |
| 169 | + # @see BrandDev::Models::BrandAIProductResponse::Product#pricing_model |
| 170 | + module PricingModel |
| 171 | + extend BrandDev::Internal::Type::Enum |
| 172 | + |
| 173 | + PER_SEAT = :per_seat |
| 174 | + FLAT = :flat |
| 175 | + TIERED = :tiered |
| 176 | + FREEMIUM = :freemium |
| 177 | + CUSTOM = :custom |
| 178 | + |
| 179 | + # @!method self.values |
| 180 | + # @return [Array<Symbol>] |
| 181 | + end |
| 182 | + end |
| 183 | + end |
| 184 | + end |
| 185 | +end |
0 commit comments