Method: ShopifyAPI::DiscountCode#initialize

Defined in:
lib/shopify_api/rest/resources/2022_04/discount_code.rb,
lib/shopify_api/rest/resources/2022_07/discount_code.rb,
lib/shopify_api/rest/resources/2022_10/discount_code.rb,
lib/shopify_api/rest/resources/2023_01/discount_code.rb,
lib/shopify_api/rest/resources/2023_04/discount_code.rb,
lib/shopify_api/rest/resources/2023_07/discount_code.rb,
lib/shopify_api/rest/resources/2023_10/discount_code.rb,
lib/shopify_api/rest/resources/2024_01/discount_code.rb,
lib/shopify_api/rest/resources/2024_04/discount_code.rb,
lib/shopify_api/rest/resources/2024_07/discount_code.rb,
lib/shopify_api/rest/resources/2024_10/discount_code.rb,
lib/shopify_api/rest/resources/2025_01/discount_code.rb,
lib/shopify_api/rest/resources/2025_04/discount_code.rb,
lib/shopify_api/rest/resources/2025_07/discount_code.rb,
lib/shopify_api/rest/resources/2025_10/discount_code.rb

#initialize(session: ShopifyAPI::Context.active_session, from_hash: nil) ⇒ DiscountCode

Returns a new instance of DiscountCode.



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/shopify_api/rest/resources/2022_04/discount_code.rb', line 19

def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)

  @code = T.let(nil, T.nilable(String))
  @created_at = T.let(nil, T.nilable(String))
  @errors = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
  @id = T.let(nil, T.nilable(Integer))
  @price_rule_id = T.let(nil, T.nilable(Integer))
  @updated_at = T.let(nil, T.nilable(String))
  @usage_count = T.let(nil, T.nilable(Integer))

  super(session: session, from_hash: from_hash)
end